teareduce 0.6.7__tar.gz → 0.6.9__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.
- {teareduce-0.6.7/src/teareduce.egg-info → teareduce-0.6.9}/PKG-INFO +2 -2
- {teareduce-0.6.7 → teareduce-0.6.9}/README.md +1 -1
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/cosmicraycleanerapp.py +8 -7
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/reviewcosmicray.py +22 -10
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/simulateccdexposure.py +3 -1
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/version.py +1 -1
- {teareduce-0.6.7 → teareduce-0.6.9/src/teareduce.egg-info}/PKG-INFO +2 -2
- {teareduce-0.6.7 → teareduce-0.6.9}/LICENSE.txt +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/pyproject.toml +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/setup.cfg +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/__init__.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/avoid_astropy_warnings.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/__init__.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/__main__.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/askextension.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/centerchildparent.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/definitions.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/dilatemask.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/find_closest_true.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/gausskernel2d_elliptical.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/imagedisplay.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/interpolate.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/interpolation_a.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/interpolation_x.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/interpolation_y.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/interpolationeditor.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/lacosmicpad.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/mergemasks.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/modalprogressbar.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/parametereditor.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cleanest/trackedbutton.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cookbook/__init__.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cookbook/get_cookbook_file.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/correct_pincushion_distortion.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/cosmicrays.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/ctext.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/draw_rectangle.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/elapsed_time.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/histogram1d.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/imshow.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/numsplines.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/peaks_spectrum.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/polfit.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/robust_std.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/sdistortion.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/sliceregion.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/statsummary.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/tests/__init__.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/tests/test_cleanest.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/tests/test_sliceregion.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/tests/test_version.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/wavecal.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/write_array_to_fits.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce/zscale.py +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce.egg-info/SOURCES.txt +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce.egg-info/dependency_links.txt +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce.egg-info/entry_points.txt +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce.egg-info/requires.txt +0 -0
- {teareduce-0.6.7 → teareduce-0.6.9}/src/teareduce.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: teareduce
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.9
|
|
4
4
|
Summary: Utilities for astronomical data reduction
|
|
5
5
|
Author-email: Nicolás Cardiel <cardiel@ucm.es>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -113,7 +113,7 @@ In addition, in order to make use of the **PyCosmic** algorithm with
|
|
|
113
113
|
(venv_teareduce) $ ipython
|
|
114
114
|
In [1]: import teareduce as tea
|
|
115
115
|
In [2]: print(tea.__version__)
|
|
116
|
-
0.6.
|
|
116
|
+
0.6.7
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Note that in PyPI there is a package called **tea** that provides utilities
|
|
@@ -74,7 +74,7 @@ In addition, in order to make use of the **PyCosmic** algorithm with
|
|
|
74
74
|
(venv_teareduce) $ ipython
|
|
75
75
|
In [1]: import teareduce as tea
|
|
76
76
|
In [2]: print(tea.__version__)
|
|
77
|
-
0.6.
|
|
77
|
+
0.6.7
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
Note that in PyPI there is a package called **tea** that provides utilities
|
|
@@ -20,11 +20,13 @@ from astropy.io import fits
|
|
|
20
20
|
|
|
21
21
|
try:
|
|
22
22
|
import PyCosmic
|
|
23
|
+
|
|
23
24
|
PYCOSMIC_AVAILABLE = True
|
|
24
25
|
except ModuleNotFoundError as e:
|
|
25
|
-
print(
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
print(
|
|
27
|
+
"The 'teareduce.cleanest' module requires the 'PyCosmic' package.\n"
|
|
28
|
+
"Please install this module using:\n"
|
|
29
|
+
"`pip install git+https://github.com/nicocardiel/PyCosmic.git@test`"
|
|
28
30
|
)
|
|
29
31
|
PYCOSMIC_AVAILABLE = False
|
|
30
32
|
|
|
@@ -391,7 +393,6 @@ class CosmicRayCleanerApp(ImageDisplay):
|
|
|
391
393
|
)
|
|
392
394
|
self.stop_button.pack(side=tk.LEFT, padx=5)
|
|
393
395
|
|
|
394
|
-
|
|
395
396
|
# Row 2 of buttons
|
|
396
397
|
self.button_frame2 = tk.Frame(self.root)
|
|
397
398
|
self.button_frame2.pack(pady=5)
|
|
@@ -850,8 +851,8 @@ class CosmicRayCleanerApp(ImageDisplay):
|
|
|
850
851
|
hdu.writeto(output_fits, overwrite=True)
|
|
851
852
|
print(f"Last mask saved to {output_fits}")
|
|
852
853
|
except Exception as e:
|
|
853
|
-
print(f"Error saving mask into a FITS file: {e}")
|
|
854
|
-
|
|
854
|
+
print(f"Error saving mask into a FITS file: {e}")
|
|
855
|
+
|
|
855
856
|
def set_cursor_onoff(self):
|
|
856
857
|
"""Toggle cursor selection mode on or off."""
|
|
857
858
|
if not self.use_cursor:
|
|
@@ -1539,7 +1540,7 @@ class CosmicRayCleanerApp(ImageDisplay):
|
|
|
1539
1540
|
cleandata_deepcr=self.cleandata_deepcr,
|
|
1540
1541
|
cr_labels=tmp_cr_labels,
|
|
1541
1542
|
num_features=1,
|
|
1542
|
-
first_cr_index=
|
|
1543
|
+
first_cr_index=first_cr_index,
|
|
1543
1544
|
single_cr=True,
|
|
1544
1545
|
last_dilation=self.lacosmic_params["dilation"]["value"],
|
|
1545
1546
|
last_npoints=self.last_npoints,
|
|
@@ -98,6 +98,8 @@ class ReviewCosmicRay(ImageDisplay):
|
|
|
98
98
|
Number of connected cosmic ray pixel groups.
|
|
99
99
|
first_cr_index : int, optional
|
|
100
100
|
The index of the first cosmic ray to review (default is 1).
|
|
101
|
+
If set to 0, the user have selected the CR region
|
|
102
|
+
directly with the mouse cursor.
|
|
101
103
|
single_cr : bool, optional
|
|
102
104
|
Whether to review a single cosmic ray (default is False).
|
|
103
105
|
If True, the review window will close after reviewing the
|
|
@@ -236,7 +238,11 @@ class ReviewCosmicRay(ImageDisplay):
|
|
|
236
238
|
if self.num_features == 0:
|
|
237
239
|
print("No CR hits found!")
|
|
238
240
|
else:
|
|
239
|
-
self.
|
|
241
|
+
self.first_cr_index = first_cr_index
|
|
242
|
+
if self.first_cr_index == 0: # Select CR directly with mouse cursor
|
|
243
|
+
self.cr_index = 1
|
|
244
|
+
else:
|
|
245
|
+
self.cr_index = self.first_cr_index
|
|
240
246
|
self.single_cr = single_cr
|
|
241
247
|
self.create_widgets()
|
|
242
248
|
center_on_parent(child=self.root, parent=self.root.master, offset_x=50, offset_y=50)
|
|
@@ -494,11 +500,14 @@ class ReviewCosmicRay(ImageDisplay):
|
|
|
494
500
|
ycr_list, xcr_list = np.where(self.cr_labels == self.cr_index)
|
|
495
501
|
ycr_list_original, xcr_list_original = np.where(self.cr_labels_original == self.cr_index)
|
|
496
502
|
if self.first_plot:
|
|
497
|
-
|
|
498
|
-
f"
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
503
|
+
if self.first_cr_index == 0:
|
|
504
|
+
print(f"Centroid = ({np.mean(xcr_list)+1:.2f}, {np.mean(ycr_list)+1:.2f})")
|
|
505
|
+
else:
|
|
506
|
+
print(
|
|
507
|
+
f"Cosmic ray {self.cr_index}: "
|
|
508
|
+
f"Number of pixels = {len(xcr_list)}, "
|
|
509
|
+
f"Centroid = ({np.mean(xcr_list)+1:.2f}, {np.mean(ycr_list)+1:.2f})"
|
|
510
|
+
)
|
|
502
511
|
# Use original positions to define the region to display in order
|
|
503
512
|
# to avoid image shifts when some pixels are unmarked or new ones are marked
|
|
504
513
|
i0 = int(np.mean(ycr_list_original) + 0.5)
|
|
@@ -564,7 +573,10 @@ class ReviewCosmicRay(ImageDisplay):
|
|
|
564
573
|
self.ax.plot([xcr - 0.5, xcr + 0.5], [ycr - 0.5, ycr + 0.5], "r-")
|
|
565
574
|
self.ax.set_xlim(xlim)
|
|
566
575
|
self.ax.set_ylim(ylim)
|
|
567
|
-
self.
|
|
576
|
+
if self.first_cr_index == 0:
|
|
577
|
+
self.ax.set_title("Selecting CR pixels with mouse cursor")
|
|
578
|
+
else:
|
|
579
|
+
self.ax.set_title(f"Cosmic ray #{self.cr_index}/{self.num_features}")
|
|
568
580
|
if self.first_plot:
|
|
569
581
|
self.first_plot = False
|
|
570
582
|
self.canvas.draw_idle()
|
|
@@ -743,7 +755,7 @@ class ReviewCosmicRay(ImageDisplay):
|
|
|
743
755
|
self.num_cr_cleaned += 1
|
|
744
756
|
self.set_buttons_after_cleaning_cr()
|
|
745
757
|
self.update_display(cleaned=True)
|
|
746
|
-
|
|
758
|
+
|
|
747
759
|
def use_deepcr(self):
|
|
748
760
|
"""Use deepCR cleaned data to clean a cosmic ray."""
|
|
749
761
|
if self.cleandata_deepcr is None:
|
|
@@ -895,10 +907,10 @@ class ReviewCosmicRay(ImageDisplay):
|
|
|
895
907
|
iy = int(y + 0.5) - 1 # from pixel to index
|
|
896
908
|
if int(self.cr_labels[iy, ix]) == self.cr_index:
|
|
897
909
|
self.cr_labels[iy, ix] = 0
|
|
898
|
-
print(f"Pixel ({ix+1}, {iy+1}) unmarked as
|
|
910
|
+
print(f"Pixel ({ix+1}, {iy+1}) unmarked as CR pixel.")
|
|
899
911
|
else:
|
|
900
912
|
self.cr_labels[iy, ix] = self.cr_index
|
|
901
|
-
print(f"Pixel ({ix+1}, {iy+1}), with signal {self.data[iy, ix]}, marked as
|
|
913
|
+
print(f"Pixel ({ix+1}, {iy+1}), with signal {self.data[iy, ix]}, marked as CR pixel.")
|
|
902
914
|
xcr_list, ycr_list = np.where(self.cr_labels == self.cr_index)
|
|
903
915
|
if len(xcr_list) == 0:
|
|
904
916
|
self.disable_interpolation_buttons()
|
|
@@ -194,7 +194,7 @@ class SimulateCCDExposure:
|
|
|
194
194
|
|
|
195
195
|
CCD exposures are simulated making use of basic CCD parameters,
|
|
196
196
|
such as gain, readout noise, bias, dark and flat field.
|
|
197
|
-
A data model can also be employed to simulate more
|
|
197
|
+
A data model can also be employed to simulate more realistic
|
|
198
198
|
CCD exposures.
|
|
199
199
|
|
|
200
200
|
The saturated pixels in 'data_model' are returned as 2**bitpix - 1
|
|
@@ -230,6 +230,8 @@ class SimulateCCDExposure:
|
|
|
230
230
|
Numpy array with the pixel to pixel sensitivity (without units).
|
|
231
231
|
data_model : Quantity
|
|
232
232
|
Numpy array with the model of the source to be simulated (ADU).
|
|
233
|
+
Note that this is the model before applying the flatfield.
|
|
234
|
+
The values in this array must be the total ADU for each pixel.
|
|
233
235
|
seed : int or None
|
|
234
236
|
Random number generator seed.
|
|
235
237
|
_rng : np.random.RandomState
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: teareduce
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.9
|
|
4
4
|
Summary: Utilities for astronomical data reduction
|
|
5
5
|
Author-email: Nicolás Cardiel <cardiel@ucm.es>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -113,7 +113,7 @@ In addition, in order to make use of the **PyCosmic** algorithm with
|
|
|
113
113
|
(venv_teareduce) $ ipython
|
|
114
114
|
In [1]: import teareduce as tea
|
|
115
115
|
In [2]: print(tea.__version__)
|
|
116
|
-
0.6.
|
|
116
|
+
0.6.7
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Note that in PyPI there is a package called **tea** that provides utilities
|
|
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
|