77from astropy .io import fits , ascii as astropy_ascii
88from astropy .time import Time
99from astropy .wcs import WCS
10- from specutils import Spectrum1D
10+ from specutils import Spectrum
1111
1212from tom_dataproducts .data_processor import DataProcessor
1313from tom_dataproducts .exceptions import InvalidFileFormatException
@@ -46,16 +46,16 @@ def process_data(self, data_product):
4646
4747 def _process_spectrum_from_fits (self , data_product ):
4848 """
49- Processes the data from a spectrum from a fits file into a Spectrum1D object, which can then be serialized and
49+ Processes the data from a spectrum from a fits file into a Spectrum object, which can then be serialized and
5050 stored as a ReducedDatum for further processing or display. File is read using specutils as specified in the
5151 below documentation.
5252 # https://specutils.readthedocs.io/en/doc-testing/specutils/read_fits.html
5353
54- :param data_product: Spectroscopic DataProduct which will be processed into a Spectrum1D
54+ :param data_product: Spectroscopic DataProduct which will be processed into a Spectrum
5555 :type data_product: tom_dataproducts.models.DataProduct
5656
57- :returns: Spectrum1D object containing the data from the DataProduct
58- :rtype: specutils.Spectrum1D
57+ :returns: Spectrum object containing the data from the DataProduct
58+ :rtype: specutils.Spectrum
5959
6060 :returns: Datetime of observation, if it is in the header and the file is from a supported facility, current
6161 datetime otherwise
@@ -86,13 +86,13 @@ def _process_spectrum_from_fits(self, data_product):
8686 header ['CUNIT1' ] = 'Angstrom'
8787 wcs = WCS (header = header , naxis = 1 )
8888
89- spectrum = Spectrum1D (flux = flux , wcs = wcs )
89+ spectrum = Spectrum (flux = flux , wcs = wcs )
9090
9191 return spectrum , Time (date_obs ).to_datetime (), facility_name
9292
9393 def _process_spectrum_from_plaintext (self , data_product ):
9494 """
95- Processes the data from a spectrum from a plaintext file into a Spectrum1D object, which can then be serialized
95+ Processes the data from a spectrum from a plaintext file into a Spectrum object, which can then be serialized
9696 and stored as a ReducedDatum for further processing or display. File is read using astropy as specified in
9797 the below documentation. The file is expected to be a multi-column delimited file, with headers for wavelength
9898 and flux. The file also requires comments containing, at minimum, 'DATE-OBS: [value]', where value is an
@@ -102,11 +102,11 @@ def _process_spectrum_from_plaintext(self, data_product):
102102
103103 Parameters
104104 ----------
105- :param data_product: Spectroscopic DataProduct which will be processed into a Spectrum1D
105+ :param data_product: Spectroscopic DataProduct which will be processed into a Spectrum
106106 :type data_product: tom_dataproducts.models.DataProduct
107107
108- :returns: Spectrum1D object containing the data from the DataProduct
109- :rtype: specutils.Spectrum1D
108+ :returns: Spectrum object containing the data from the DataProduct
109+ :rtype: specutils.Spectrum
110110
111111 :returns: Datetime of observation, if it is in the comments and the file is from a supported facility, current
112112 datetime otherwise
@@ -132,6 +132,6 @@ def _process_spectrum_from_plaintext(self, data_product):
132132
133133 spectral_axis = np .array (data ['wavelength' ]) * wavelength_units
134134 flux = np .array (data ['flux' ]) * flux_constant
135- spectrum = Spectrum1D (flux = flux , spectral_axis = spectral_axis )
135+ spectrum = Spectrum (flux = flux , spectral_axis = spectral_axis )
136136
137137 return spectrum , Time (date_obs ).to_datetime (), facility_name
0 commit comments