@@ -27,16 +27,50 @@ guiding document for spectroscopic development in the Astropy Project.
27
27
Changes in version 2
28
28
====================
29
29
30
+ The ``Spectrum1D `` class has been renamed to `~specutils.Spectrum ` to reduce confusion
31
+ about multi-dimensional flux arrays being supported. The current class name will be
32
+ deprecated in version 2.1; importing the old name will work but raise a deprecation
33
+ warning until then.
34
+
35
+ Single-dimensional flux use cases should be mostly unchanged in 2.0, with the exception
36
+ being that spectrum arithmetic now checks that the spectral axis of both operands are
37
+ equal, rather than simply checking that they are the same length. Thus, you will need
38
+ to resample onto a common spectral axis if doing arithmetic on spectra with differing
39
+ spectral axes.
40
+
30
41
Specutils version 2 implemented a major change in that `~specutils.Spectrum `
31
42
no longer forces the spectral axis to be last for multi-dimensional data. This
32
43
was motivated by the desire for greater flexibility to allow for interoperability
33
44
with other packages that may wish to use ``specutils `` classes as the basis for
34
45
their own, and by the desire for consistency with the axis order that results
35
46
from a simple ``astropy.io.fits.read `` of a file. The legacy behavior can be
36
47
replicated by setting ``move_spectral_axis='last' `` when creating a new
37
- `~specutils.Spectrum ` object.
38
-
39
- For a summary of other changes in version 2, please see the
48
+ `~specutils.Spectrum ` object. `~specutils.Spectrum ` will attempt to automatically
49
+ determine which flux axis corresponds to the spectral axis during initialization
50
+ based on the WCS (if provided) or the shape of the flux and spectral axis arrays,
51
+ but if the spectral axis index is unable to be automatically determined you will
52
+ need to specify which flux array axis is the dispersion axis with the
53
+ ``spectral_axis_index `` keyword. Note that since the ``spectral_axis `` can specify
54
+ either bin edges or bin centers, a flux array of shape ``(10,11) `` with spectral axis
55
+ of length 11 would be ambigious. In this case you could initialize a
56
+ `~specutils.Spectrum ` with ``bin_specification `` set to either "edges" or "centers"
57
+ to break the degeneracy.
58
+
59
+ An additional change for multi-dimensional spectra is that previously, initializing
60
+ such a `~specutils.Spectrum ` with a ``spectral_axis `` specified, but no WCS, would
61
+ create a `~specutils.Spectrum ` instance with a one-dimensional GWCS that was essentially
62
+ a lookup table with the spectral axis values. This case will now result in a GWCS with
63
+ dimensionality matching that of the flux array to facilitate use with downstream packages
64
+ that expect WCS dimensionality to match that of the data. The resulting spatial axes
65
+ transforms are simple pixel to pixel identity operations, since no actual spatial
66
+ coordinate information is available.
67
+
68
+ In addition to the changes to the generated GWCS, handling of input GWCS has also been
69
+ improved. This mostly manifests in the full GWCS (including spatial information) being
70
+ retained in the resulting `~specutils.Spectrum ` objects when reading, e.g., JWST spectral
71
+ cubes.
72
+
73
+ For a summary of the changes in version 2, you many also refer to the
40
74
`release notes <https://github.com/astropy/specutils/releases >`_.
41
75
42
76
0 commit comments