FifiLsChannelData¶
- class sofia_redux.scan.custom.fifi_ls.channels.channel_data.channel_data.FifiLsChannelData(channels=None)[source]¶
Bases:
SingleColorChannelData
,SofiaChannelData
Initialize the channel data for the FIFI-LS instrument.
- Parameters:
- channelsFifiLsChannels, optional
The full channel object on which to base the data.
Attributes Summary
Return the central wavelength in the channel data.
Return the defaults for the various channel data parameters.
Return the instrument information object.
Return the spectral FWHM for the wavelength.
Methods Summary
apply_hdul_weights
(stddev)Read in the weights from the HDU list.
calculate_overlaps
(point_size[, maximum_radius])Calculates the overlaps between channels.
copy
()Return a copy of the channel data.
Return the number of geometric columns in the detector array.
Return the number of geometric rows in the detector array.
initialize_from_detector
(detector)Apply detector information to create and populate the channel data.
populate_positions
(xs, ys)Populate the pixel positions from HDUList data.
read_channel_data_file
(filename)Read a channel data file and return the information within.
read_hdul
(hdul)Read an HDU list and apply to the channel data.
set_channel_data
(index, channel_info)Set the channel info for a selected index.
set_uniform_gains
([field])Sets the gain and coupling to 1.0 for all channels.
to_string
([indices, frame])Return a string representation of channels.
Validates data read from the pixel data file.
Attributes Documentation
- central_wavelength¶
Return the central wavelength in the channel data.
- Returns:
- wave_centerunits.Quantity
- default_field_types¶
Return the defaults for the various channel data parameters.
- Returns:
- defaultsdict
- info¶
Return the instrument information object.
- Returns:
- sofia_redux.scan.custom.fifi_ls.info.info.FifiLsInfo
- spectral_fwhm¶
Return the spectral FWHM for the wavelength.
- Returns:
- fwhmunits.Quantity
Methods Documentation
- apply_hdul_weights(stddev)[source]¶
Read in the weights from the HDU list.
- Parameters:
- stddevnumpy.ndarray (float)
The error values from the HDU list of shape (n_frames, n_spexels, n_spaxels).
- Returns:
- None
- calculate_overlaps(point_size, maximum_radius=2.0)[source]¶
Calculates the overlaps between channels.
The overlap array (in the
overlaps
attribute) is a csr_sparse array of shape (n_channels, n_channels) where overlaps[i, j] givens the overlap value of channel j from the channel i.- Parameters:
- point_sizeCoordinate2D1
The point size for calculating the overlaps. Typically, the beam FWHM.
- maximum_radiusfloat, optional
The maximum radius in units of
point_size
to search for channel overlaps. Will be overwritten by any values present in the overlaps.radius configuration section.
- Returns:
- overlap_indicesscipy.sparse.csr.csr_matrix (bool)
A Compressed Sparse Row (CSR) matrix of shape (channels, channels) where a
True
value for overlap_indices[i, j] signals that channeli
overlaps with the channelj
.
- geometric_cols()[source]¶
Return the number of geometric columns in the detector array.
- Returns:
- colsint
- geometric_rows()[source]¶
Return the number of geometric rows in the detector array.
- Returns:
- rowsint
- initialize_from_detector(detector)[source]¶
Apply detector information to create and populate the channel data.
The following attributes are determined from the detector:
- col: The column on the array - row: The row on the array - spexel: The spexel index - spaxel: The spaxel index - position: The spaxel offset on the array (arcseconds) - wavelength : The spexel wavelength (um). Set to NaN.
Additionally, the channel string ID is set to:
<CHANNEL>[<spexel>,<spaxel>]
where spexel and spaxel are described above and CHANNEL may be one of {B, R} for the RED and BLUE channels respectively.
- Parameters:
- detectorFifiLsDetectorArrayInfo
- Returns:
- None
- populate_positions(xs, ys)[source]¶
Populate the pixel positions from HDUList data.
- Parameters:
- xsnumpy.ndarray (float)
The pixel x-positions of shape (n_frames, n_spexel, n_spaxel) in arcseconds.
- ysnumpy.ndarray (float)
The pixel y-positions of shape (n_frames, n_spexel, n_spaxel) in arcseconds.
- Returns:
- None
- classmethod read_channel_data_file(filename)[source]¶
Read a channel data file and return the information within.
Returns a
pandas
DataFrame with the following columns: {gain, weight, flag, coupling, mux_gain, idx, sub, row, col, unknown}.- Parameters:
- filenamestr
The path to a channel data file.
- Returns:
- channel_infopandas.DataFrame
- read_hdul(hdul)[source]¶
Read an HDU list and apply to the channel data.
- Parameters:
- hdulastropy.io.fits.HDUList
- Returns:
- None
- set_channel_data(index, channel_info)[source]¶
Set the channel info for a selected index.
- Parameters:
- indexint
The channel index for which to set new data.
- channel_infodict
A dictionary of the form {field: value} where. The attribute field at ‘index’ will be set to value.
- Returns:
- None
- set_uniform_gains(field=None)[source]¶
Sets the gain and coupling to 1.0 for all channels.
- Parameters:
- fieldstr, optional
If supplied, sets all values of the requested field to unity.
- Returns:
- None
- to_string(indices=None, frame=False)[source]¶
Return a string representation of channels.
- Parameters:
- indicesnumpy.ndarray or slice, optional
The channel indices (not fixed) to return. The default is all channels.
- framebool, optional
If
True
, returns apd.DataFrame
instead of a string representation.
- Returns:
- str or pd.DataFrame