Skip to content

Commit c9e076e

Browse files
committed
Make default flux unit DN; bump minimum Python req
1 parent 4b0bdd5 commit c9e076e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ github_project = astropy/specreduce
1414
[options]
1515
zip_safe = False
1616
packages = find:
17-
python_requires = >=3.7
17+
python_requires = >=3.8
1818
setup_requires = setuptools_scm
1919
install_requires =
2020
astropy

specreduce/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _parse_image(self, image, disp_axis=1):
7070
else:
7171
uncertainty = VarianceUncertainty(np.ones(img.shape))
7272

73-
unit = getattr(image, 'unit', u.Unit('DN')) # or u.Unit()?
73+
unit = getattr(image, 'unit', u.Unit('DN'))
7474

7575
spectral_axis = getattr(image, 'spectral_axis',
7676
np.arange(img.shape[disp_axis]) * u.pix)

specreduce/extract.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class HorneExtract(SpecreduceOperation):
258258
unit : `~astropy.units.Unit` or str, optional
259259
(Only used if ``image`` is not an NDData object.)
260260
The associated unit for the data in ``image``. If blank,
261-
fluxes are interpreted as unitless. [default: None]
261+
fluxes are interpreted in DN. [default: None]
262262
263263
"""
264264
image: NDData
@@ -307,7 +307,7 @@ def _parse_image(self, image,
307307
unit : `~astropy.units.Unit` or str, optional
308308
(Only used if ``image`` is not an NDData object.)
309309
The associated unit for the data in ``image``. If blank,
310-
fluxes are interpreted as unitless.
310+
fluxes are interpreted in DN.
311311
disp_axis : int, optional
312312
The index of the image's dispersion axis. Should not be
313313
changed until operations can handle variable image
@@ -381,7 +381,7 @@ def _parse_image(self, image,
381381
variance = VarianceUncertainty(variance)
382382

383383
unit = getattr(image, 'unit',
384-
u.Unit(unit) if unit is not None else u.Unit())
384+
u.Unit(unit) if unit is not None else u.Unit('DN'))
385385

386386
spectral_axis = getattr(image, 'spectral_axis',
387387
np.arange(img.shape[disp_axis]) * u.pix)
@@ -434,7 +434,7 @@ def __call__(self, image=None, trace_object=None,
434434
unit : `~astropy.units.Unit` or str, optional
435435
(Only used if ``image`` is not an NDData object.)
436436
The associated unit for the data in ``image``. If blank,
437-
fluxes are interpreted as unitless.
437+
fluxes are interpreted in DN.
438438
439439
440440
Returns

specreduce/tests/test_extract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ def test_horne_image_validation():
116116
ext = extract(image=image.data, variance=err, mask=mask)
117117

118118
# an array-type image given without mask and unit arguments is fine
119-
# and produces an extraction with unitless flux and spectral axis in pixels
119+
# and produces an extraction with flux in DN and spectral axis in pixels
120120
err = np.ones_like(image)
121121
ext = extract(image=image.data, variance=err, mask=None, unit=None)
122-
assert ext.unit == u.Unit()
122+
assert ext.unit == u.Unit('DN')
123123
assert np.all(ext.spectral_axis
124124
== np.arange(image.shape[extract.disp_axis]) * u.pix)
125125

0 commit comments

Comments
 (0)