PyNOT-redux 2.2.3__tar.gz → 2.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/PKG-INFO +1 -1
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/PyNOT_redux.egg-info/PKG-INFO +1 -1
- pynot_redux-2.2.5/PyNOT_redux.egg-info/top_level.txt +5 -0
- pynot_redux-2.2.5/pynot/VERSION +1 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calibs.py +8 -1
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/io.py +5 -1
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/obs.py +5 -1
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/functions.py +5 -1
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/identify_gui.py +8 -8
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/main.py +22 -9
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/spectrum.py +2 -2
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/viewer.py +36 -10
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/setup.py +2 -2
- pynot_redux-2.2.3/PyNOT_redux.egg-info/top_level.txt +0 -1
- pynot_redux-2.2.3/pynot/VERSION +0 -1
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/.gitattributes +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/.github/dependabot.yml +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/.gitignore +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/LICENSE +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/MANIFEST.in +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/PyNOT_redux.egg-info/SOURCES.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/PyNOT_redux.egg-info/dependency_links.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/PyNOT_redux.egg-info/entry_points.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/PyNOT_redux.egg-info/requires.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/README.md +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/.extract_msg +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/.identify_msg +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/.instrument.cfg +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/.response_msg +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/__init__.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/alfosc.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/HeAr_linelist.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/HeNe_linelist.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/ThAr_linelist.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/al-gr18_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/al-gr19_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/al-gr4_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/al-gr7_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/alfosc_filters.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/default_options.yml +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/default_options_img.yml +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/ef-gr13_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/ef-gr14_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/ef-gr1_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/ef-gr3_pixeltable.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/efosc_filters.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/lapalma.ext +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/lasilla.ext +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/paranal.ext +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/bd174708.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/bd262606.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/bd332642.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/bd75325.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/eg21.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/feige110.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/feige34.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/gd153.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/gd50.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/gd71.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/hd19445.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/hd84937.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/hd93521.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/he3.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/hiltner600.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/ltt3864.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/tcs_namelist.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/calib/std/wolf1346.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/__init__.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/alfosc.rules +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/efosc.rules +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/help/welcome_msg_extract.html +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/help/welcome_msg_identify.html +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/help/welcome_msg_response.html +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/data/organizer.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/efosc.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/extract_gui.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/extraction.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/fitsio.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/images.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/insconfig.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/logging.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/operations.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/phot.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/phot_redux.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/redux.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/reports.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/response.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/response_gui.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/scired.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/scombine.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/skysub.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/tasks.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/transients.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/txtio.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/__init__.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/containers.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/default_linelists.json +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/dust.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/linelists.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/messages.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/models.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/notes.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/tablemodels.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/targets.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/Assef_2010.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/FeII.Vestergaard.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/FeIII.Vestergaard.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/Hernan_Caballero_quasar_NIR_template.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_selsing.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_template.Krawczyk_all.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_template.Krawczyk_high.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_template.Krawczyk_low.dat +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/wavecal.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/wcs.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/welcome.py +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/pyproject.toml +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/requirements.txt +0 -0
- {pynot_redux-2.2.3 → pynot_redux-2.2.5}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.5
|
|
@@ -62,6 +62,9 @@ def combine_bias_frames(bias_frames, output='', kappa=15, method='mean', overwri
|
|
|
62
62
|
"""
|
|
63
63
|
msg = list()
|
|
64
64
|
|
|
65
|
+
if len(bias_frames) == 1:
|
|
66
|
+
msg.append("[WARNING] - Only 1 frame provided! More than 1 frame is expected!!\n")
|
|
67
|
+
|
|
65
68
|
bias = list()
|
|
66
69
|
for frame in bias_frames:
|
|
67
70
|
msg.append(" - Loaded bias frame: %s" % frame)
|
|
@@ -172,6 +175,10 @@ def combine_flat_frames(raw_frames, output, mbias='', mode='spec', dispaxis=None
|
|
|
172
175
|
The log of the function steps and errors
|
|
173
176
|
"""
|
|
174
177
|
msg = list()
|
|
178
|
+
|
|
179
|
+
if len(raw_frames) == 1:
|
|
180
|
+
msg.append("[WARNING] - Only 1 frame provided! More than 1 frame is expected!!\n")
|
|
181
|
+
|
|
175
182
|
if mbias and exists(mbias):
|
|
176
183
|
bias = fits.getdata(mbias)
|
|
177
184
|
# bias_hdr = instrument.get_header(mbias)
|
|
@@ -380,7 +387,7 @@ def normalize_spectral_flat(fname, output='', fig_dir='', dispaxis=None, order=2
|
|
|
380
387
|
if len(edges) != 2:
|
|
381
388
|
msg.append("[WARNING] - Automatic edge detection failed. Using full frame!")
|
|
382
389
|
edges = [0, len(x)]
|
|
383
|
-
except:
|
|
390
|
+
except Exception:
|
|
384
391
|
msg.append("[WARNING] - Automatic edge detection failed. Using full frame!")
|
|
385
392
|
edges = [0, len(x)]
|
|
386
393
|
|
|
@@ -6,6 +6,7 @@ Input / Output functions for the DataSet class.
|
|
|
6
6
|
|
|
7
7
|
from astropy.io import fits
|
|
8
8
|
import numpy as np
|
|
9
|
+
import warnings
|
|
9
10
|
|
|
10
11
|
from pynot.data.organizer import TagDatabase
|
|
11
12
|
from pynot import instrument
|
|
@@ -77,7 +78,10 @@ def save_database(database, output_fname):
|
|
|
77
78
|
|
|
78
79
|
def load_database(input_fname):
|
|
79
80
|
"""Load file database from file."""
|
|
80
|
-
|
|
81
|
+
with warnings.catch_warnings():
|
|
82
|
+
# Suppress empty line warning from numpy 1.23+
|
|
83
|
+
warnings.simplefilter('ignore', UserWarning)
|
|
84
|
+
all_lines = np.loadtxt(input_fname, dtype=str, usecols=(0, 1), comments='##')
|
|
81
85
|
# file_database = {key: val for key, val in all_lines}
|
|
82
86
|
# inactive_files = {key: val for key, val in all_lines}
|
|
83
87
|
file_database = {}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
from collections import defaultdict
|
|
3
3
|
import numpy as np
|
|
4
4
|
import os
|
|
5
|
+
import warnings
|
|
5
6
|
|
|
6
7
|
from pynot.data import io
|
|
7
8
|
from pynot.data import organizer as do
|
|
@@ -12,7 +13,10 @@ output_base_spec = 'spectra'
|
|
|
12
13
|
class OBDatabase:
|
|
13
14
|
def __init__(self, fname):
|
|
14
15
|
if os.path.exists(fname):
|
|
15
|
-
|
|
16
|
+
with warnings.catch_warnings():
|
|
17
|
+
# Suppress empty line warning from numpy 1.23+
|
|
18
|
+
warnings.simplefilter('ignore', UserWarning)
|
|
19
|
+
data = np.loadtxt(fname, dtype=str, delimiter=':')
|
|
16
20
|
if len(data.shape) == 1:
|
|
17
21
|
data = np.array([data])
|
|
18
22
|
self.data = {obid.strip(): status.strip() for obid, status in data}
|
|
@@ -3,6 +3,7 @@ import numpy as np
|
|
|
3
3
|
import yaml
|
|
4
4
|
import os
|
|
5
5
|
import glob
|
|
6
|
+
import warnings
|
|
6
7
|
|
|
7
8
|
from pynot import instrument
|
|
8
9
|
|
|
@@ -15,7 +16,10 @@ standard_stars = [fname.strip('.dat') for fname in _standard_star_files]
|
|
|
15
16
|
# Look-up table from target-names -> star names
|
|
16
17
|
# (mostly used for ALFOSC where TCSTGT is different)
|
|
17
18
|
std_fname = os.path.join(path, 'calib/std/tcs_namelist.txt')
|
|
18
|
-
|
|
19
|
+
with warnings.catch_warnings():
|
|
20
|
+
# Suppress warning about empty rows not counting towards max_rows
|
|
21
|
+
warnings.simplefilter('ignore', UserWarning)
|
|
22
|
+
calib_names = np.loadtxt(std_fname, dtype=str, delimiter=':')
|
|
19
23
|
tcs_standard_stars = {row[1].strip(): row[0].strip() for row in calib_names}
|
|
20
24
|
|
|
21
25
|
|
|
@@ -188,20 +188,20 @@ class ResidualView(object):
|
|
|
188
188
|
line.set_visible(visible)
|
|
189
189
|
|
|
190
190
|
def set_scatter(self, sig):
|
|
191
|
-
self.u68_line.set_ydata(self.mean + sig)
|
|
192
|
-
self.l68_line.set_ydata(self.mean - sig)
|
|
191
|
+
self.u68_line.set_ydata([self.mean + sig])
|
|
192
|
+
self.l68_line.set_ydata([self.mean - sig])
|
|
193
193
|
self.scatter = sig
|
|
194
194
|
|
|
195
195
|
def set_mean(self, mean):
|
|
196
|
-
self.u68_line.set_ydata(mean + self.scatter)
|
|
197
|
-
self.l68_line.set_ydata(mean - self.scatter)
|
|
196
|
+
self.u68_line.set_ydata([mean + self.scatter])
|
|
197
|
+
self.l68_line.set_ydata([mean - self.scatter])
|
|
198
198
|
self.mean = mean
|
|
199
199
|
|
|
200
200
|
def set_values(self, mean, scatter):
|
|
201
201
|
self.mean = mean
|
|
202
202
|
self.scatter = scatter
|
|
203
|
-
self.u68_line.set_ydata(mean + scatter)
|
|
204
|
-
self.l68_line.set_ydata(mean - scatter)
|
|
203
|
+
self.u68_line.set_ydata([mean + scatter])
|
|
204
|
+
self.l68_line.set_ydata([mean - scatter])
|
|
205
205
|
|
|
206
206
|
|
|
207
207
|
def load_linelist(fname):
|
|
@@ -912,7 +912,7 @@ class GraphicInterface(QtWidgets.QMainWindow):
|
|
|
912
912
|
item.setBackground(QtGui.QColor('lightgray'))
|
|
913
913
|
self.linetable.setItem(idx, 0, item)
|
|
914
914
|
self.pixel_list[idx] = x_cen
|
|
915
|
-
self.vlines[idx].set_xdata(x_cen)
|
|
915
|
+
self.vlines[idx].set_xdata([x_cen])
|
|
916
916
|
self.update_plot()
|
|
917
917
|
|
|
918
918
|
def refit_all(self):
|
|
@@ -1304,7 +1304,7 @@ class Image2DWindow(QtWidgets.QDialog):
|
|
|
1304
1304
|
def update_loc(self):
|
|
1305
1305
|
new_loc = int(self.loc_editor.text())
|
|
1306
1306
|
self.loc = new_loc
|
|
1307
|
-
self.loc_line.set_xdata(new_loc)
|
|
1307
|
+
self.loc_line.set_xdata([new_loc])
|
|
1308
1308
|
self.canvas.draw()
|
|
1309
1309
|
|
|
1310
1310
|
def update_info(self):
|
|
@@ -15,7 +15,6 @@ import os
|
|
|
15
15
|
import sys
|
|
16
16
|
import numpy as np
|
|
17
17
|
import warnings
|
|
18
|
-
import distutils
|
|
19
18
|
|
|
20
19
|
from pynot.functions import get_options, get_option_descr, get_version_number
|
|
21
20
|
|
|
@@ -38,6 +37,13 @@ def print_credits():
|
|
|
38
37
|
print(" version %s\n" % __version__)
|
|
39
38
|
print("")
|
|
40
39
|
|
|
40
|
+
def _strtobool(val: str) -> bool:
|
|
41
|
+
val = val.lower()
|
|
42
|
+
if val in ('y', 'yes', 't', 'true', 'on', '1'):
|
|
43
|
+
return True
|
|
44
|
+
if val in ('n', 'no', 'f', 'false', 'off', '0'):
|
|
45
|
+
return False
|
|
46
|
+
raise ValueError(f"Invalid truth value {val!r}")
|
|
41
47
|
|
|
42
48
|
def set_default_pars(parser, *, section, default_type, ignore_pars=[], mode='spec'):
|
|
43
49
|
if mode == 'spec':
|
|
@@ -56,7 +62,7 @@ def set_default_pars(parser, *, section, default_type, ignore_pars=[], mode='spe
|
|
|
56
62
|
if val is None:
|
|
57
63
|
value_type = default_type
|
|
58
64
|
if isinstance(val, bool):
|
|
59
|
-
value_type = lambda x: bool(
|
|
65
|
+
value_type = lambda x: bool(_strtobool(x))
|
|
60
66
|
else:
|
|
61
67
|
value_type = type(val)
|
|
62
68
|
|
|
@@ -647,13 +653,13 @@ def main(inspect=False):
|
|
|
647
653
|
elif task == 'bias':
|
|
648
654
|
from pynot.calibs import combine_bias_frames
|
|
649
655
|
print("Running task: Bias combination")
|
|
650
|
-
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,))
|
|
656
|
+
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,), ndmin=1)
|
|
651
657
|
_, log = combine_bias_frames(input_list, args.output, kappa=args.kappa, method=args.method)
|
|
652
658
|
|
|
653
659
|
elif task == 'sflat':
|
|
654
660
|
from pynot.calibs import combine_flat_frames, normalize_spectral_flat
|
|
655
661
|
print("Running task: Spectral flat field combination and normalization")
|
|
656
|
-
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,))
|
|
662
|
+
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,), ndmin=1)
|
|
657
663
|
flatcombine, log = combine_flat_frames(input_list, output='', mbias=args.bias, mode='spec',
|
|
658
664
|
dispaxis=args.axis, kappa=args.kappa, method=args.method)
|
|
659
665
|
|
|
@@ -777,10 +783,14 @@ def main(inspect=False):
|
|
|
777
783
|
if '*' in input_arg or '?' in input_arg:
|
|
778
784
|
filelist = glob(input_arg)
|
|
779
785
|
else:
|
|
780
|
-
filelist = np.loadtxt(input_arg, usecols=(0,), dtype=str)
|
|
786
|
+
filelist = np.loadtxt(input_arg, usecols=(0,), dtype=str, ndmin=1)
|
|
781
787
|
else:
|
|
782
788
|
filelist = args.input
|
|
783
789
|
|
|
790
|
+
if len(filelist) == 1:
|
|
791
|
+
print("Must provide more than one frame to combine!\n")
|
|
792
|
+
sys.exit()
|
|
793
|
+
|
|
784
794
|
# Check if data are 1D or 2D:
|
|
785
795
|
try:
|
|
786
796
|
data = fits.getdata(filelist[0])
|
|
@@ -858,7 +868,7 @@ def main(inspect=False):
|
|
|
858
868
|
elif task == 'imflat':
|
|
859
869
|
print("Running task: Combination of Imaging Flat Fields")
|
|
860
870
|
from pynot.calibs import combine_flat_frames
|
|
861
|
-
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,))
|
|
871
|
+
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,), ndmin=1)
|
|
862
872
|
_, log = combine_flat_frames(input_list, output=args.output, mbias=args.bias, mode='img',
|
|
863
873
|
kappa=args.kappa, method=args.method)
|
|
864
874
|
|
|
@@ -878,7 +888,7 @@ def main(inspect=False):
|
|
|
878
888
|
if args.input.endswith('.fits'):
|
|
879
889
|
input_list = [args.input]
|
|
880
890
|
else:
|
|
881
|
-
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,))
|
|
891
|
+
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,), ndmin=1)
|
|
882
892
|
|
|
883
893
|
for fname in input_list:
|
|
884
894
|
print(" Trimming image: %s" % fname)
|
|
@@ -887,7 +897,10 @@ def main(inspect=False):
|
|
|
887
897
|
elif task == 'imcombine':
|
|
888
898
|
print("Running task: Image Combination")
|
|
889
899
|
from pynot.phot import image_combine
|
|
890
|
-
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,))
|
|
900
|
+
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,), ndmin=1)
|
|
901
|
+
if len(input_list) == 1:
|
|
902
|
+
print("Must provide more than one frame to combine!\n")
|
|
903
|
+
sys.exit()
|
|
891
904
|
options = copy(vars(args))
|
|
892
905
|
vars_to_remove = ['task', 'input', 'output', 'log', 'fringe']
|
|
893
906
|
for varname in vars_to_remove:
|
|
@@ -897,7 +910,7 @@ def main(inspect=False):
|
|
|
897
910
|
elif task == 'fringe':
|
|
898
911
|
print("Running task: Creating Average Fringe Image")
|
|
899
912
|
from pynot.phot import create_fringe_image
|
|
900
|
-
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,))
|
|
913
|
+
input_list = np.loadtxt(args.input, dtype=str, usecols=(0,), ndmin=1)
|
|
901
914
|
log = create_fringe_image(input_list, output=args.output, fig_fname=args.fig, threshold=args.sigma)
|
|
902
915
|
|
|
903
916
|
elif task == 'sep':
|
|
@@ -83,9 +83,9 @@ class Spectrum:
|
|
|
83
83
|
plot_graph.setLabel("bottom", f"Spectral Axis [{self.wavelength.unit}]")
|
|
84
84
|
self.plot_line = line
|
|
85
85
|
if yerr is not None:
|
|
86
|
-
err_color = QtGui.QColor(
|
|
86
|
+
err_color = QtGui.QColor('red')
|
|
87
87
|
h, s, l, a = err_color.getHsl()
|
|
88
|
-
err_color.setHsl(h, int(s*0.
|
|
88
|
+
err_color.setHsl(h, int(s*0.8), l, 200)
|
|
89
89
|
err_pen = pg.mkPen(color=err_color, style=ls)
|
|
90
90
|
error_line = plot_graph.plot(self.wavelength, yerr, pen=err_pen,
|
|
91
91
|
name=f"{self.parent.name} {self.name} 1σ")
|
|
@@ -81,7 +81,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
81
81
|
self.linelists["All"] = superset
|
|
82
82
|
self.line_objects = []
|
|
83
83
|
self.active_lines = []
|
|
84
|
-
self.linePen = pg.mkPen(color=
|
|
84
|
+
self.linePen = pg.mkPen(color='RoyalBlue')
|
|
85
85
|
|
|
86
86
|
self.all_targets = TableModel([])
|
|
87
87
|
self.active_targets = ActiveTableModel([])
|
|
@@ -627,6 +627,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
627
627
|
if len(self.active_targets._data) != 1:
|
|
628
628
|
logging.error("Cannot add flags to more than one target at a time. Remove other targets.")
|
|
629
629
|
return
|
|
630
|
+
|
|
630
631
|
target_flag = DataFlag(0)
|
|
631
632
|
for checkbox, val in zip(self.flag_inputs, DataFlag):
|
|
632
633
|
if checkbox.isChecked():
|
|
@@ -634,16 +635,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
634
635
|
|
|
635
636
|
target: Target = self.active_targets._data[0]
|
|
636
637
|
self.target_flags[target.name] = target_flag
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
if target.name not in self.target_notes:
|
|
641
|
-
target_note = TargetNote.from_target(target, "Visually updated redshift")
|
|
638
|
+
if target.name not in self.target_notes:
|
|
639
|
+
target_note = TargetNote.from_target(target, "")
|
|
640
|
+
if DataFlag.Z_VI_CONFIRM in target_flag:
|
|
642
641
|
target_note.redshift = float(self.z_input.text())
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
target_note.note = ""
|
|
646
|
-
self.note_input.setText("")
|
|
642
|
+
target_note.note = "Visually updated redshift"
|
|
643
|
+
self.target_notes[target.name] = target_note
|
|
647
644
|
|
|
648
645
|
def create_notes_toolbar(self):
|
|
649
646
|
notes_toolbar = QtWidgets.QToolBar()
|
|
@@ -706,6 +703,13 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
706
703
|
self.slider_scale = 100_000
|
|
707
704
|
self.slider.setRange(int(-0.1*self.slider_scale), int(7*self.slider_scale))
|
|
708
705
|
|
|
706
|
+
self.z_plus_btn = QtWidgets.QPushButton("+")
|
|
707
|
+
self.z_minus_btn = QtWidgets.QPushButton("-")
|
|
708
|
+
self.z_plus_btn.clicked.connect(self.z_increment)
|
|
709
|
+
self.z_minus_btn.clicked.connect(self.z_decrement)
|
|
710
|
+
self.z_reset_btn = QtWidgets.QPushButton("Reset z")
|
|
711
|
+
self.z_reset_btn.clicked.connect(self.reset_table_redshift)
|
|
712
|
+
|
|
709
713
|
self.z_input = QtWidgets.QLineEdit("0.0")
|
|
710
714
|
self.z_input.setFixedWidth(60)
|
|
711
715
|
|
|
@@ -713,7 +717,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
713
717
|
lines_toolbar.addWidget(self.linelist_edit_btn)
|
|
714
718
|
lines_toolbar.addWidget(QtWidgets.QLabel("Redshift: "))
|
|
715
719
|
lines_toolbar.addWidget(self.slider)
|
|
720
|
+
lines_toolbar.addWidget(self.z_plus_btn)
|
|
721
|
+
lines_toolbar.addWidget(self.z_minus_btn)
|
|
716
722
|
lines_toolbar.addWidget(self.z_input)
|
|
723
|
+
lines_toolbar.addWidget(self.z_reset_btn)
|
|
717
724
|
self.slider.valueChanged.connect(self.update_from_slider)
|
|
718
725
|
self.z_input.editingFinished.connect(self.update_from_text)
|
|
719
726
|
self.addToolBar(lines_toolbar)
|
|
@@ -787,6 +794,24 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
787
794
|
except (ValueError, TypeError):
|
|
788
795
|
logging.error("Invalid redshift input: {z}. Must be a numeral")
|
|
789
796
|
|
|
797
|
+
def z_increment(self):
|
|
798
|
+
z = float(self.z_input.text())
|
|
799
|
+
self.update_redshift(z + 0.0001)
|
|
800
|
+
|
|
801
|
+
def z_decrement(self):
|
|
802
|
+
z = float(self.z_input.text())
|
|
803
|
+
self.update_redshift(z - 0.0001)
|
|
804
|
+
|
|
805
|
+
def reset_table_redshift(self):
|
|
806
|
+
targets = self.get_real_active_targets()
|
|
807
|
+
if len(targets) != 1:
|
|
808
|
+
return
|
|
809
|
+
|
|
810
|
+
target = targets[0]
|
|
811
|
+
if self.redshift_table and len(target.spectra) > 0:
|
|
812
|
+
z, spectype = redshift_table_lookup(self.redshift_table, target.spectra[0])
|
|
813
|
+
self.update_redshift(z)
|
|
814
|
+
|
|
790
815
|
def toggle_gridlines(self):
|
|
791
816
|
show_grid = self.grid_radio_button.isChecked()
|
|
792
817
|
self.plot_graph.showGrid(x=show_grid, y=show_grid)
|
|
@@ -899,6 +924,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
899
924
|
def resample_target(self):
|
|
900
925
|
current = self.active_table.selectedIndexes()
|
|
901
926
|
logging.info(f"Currently selected target(s): {current}")
|
|
927
|
+
logging.info("Resampling is not implemented yet")
|
|
902
928
|
|
|
903
929
|
def show_log_window(self, event):
|
|
904
930
|
self.log_dialog.show()
|
|
@@ -6,7 +6,7 @@ https://github.com/pypa/sampleproject
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
# Always prefer setuptools over distutils
|
|
9
|
-
from setuptools import setup,
|
|
9
|
+
from setuptools import setup, find_namespace_packages
|
|
10
10
|
# To use a consistent encoding
|
|
11
11
|
from codecs import open
|
|
12
12
|
from os import path
|
|
@@ -87,7 +87,7 @@ setup(
|
|
|
87
87
|
|
|
88
88
|
# You can just specify the packages manually here if your project is
|
|
89
89
|
# simple. Or you can use find_packages().
|
|
90
|
-
packages=
|
|
90
|
+
packages=find_namespace_packages(exclude=['docs', 'tests']),
|
|
91
91
|
|
|
92
92
|
# Alternatively, if you want to distribute just a my_module.py, uncomment
|
|
93
93
|
# this:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pynot
|
pynot_redux-2.2.3/pynot/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.2.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_template.Krawczyk_all.dat
RENAMED
|
File without changes
|
{pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_template.Krawczyk_high.dat
RENAMED
|
File without changes
|
{pynot_redux-2.2.3 → pynot_redux-2.2.5}/pynot/viewer/templates/QSO_template.Krawczyk_low.dat
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|