HawcPlusChannels

class sofia_redux.scan.custom.hawc_plus.channels.channels.HawcPlusChannels(parent=None, info=None, size=0, name='hawc_plus')[source]

Bases: SofiaCamera

Initialize HAWC+ channels.

Parameters:
parentobject, optional

The owner of the channels such as a Reduction, Scan or Integration.

infoHawcPlusInfo, optional

The info object relating to these channels.

sizeint, optional

The intended size of the channels (number of total data channels).

namestr, optional

The name for the channels.

Attributes Summary

band_id

Return the HAWC_PLUS Band

dark_squid_lookup

Return the dark squid lookup array.

detector

Return the detector info.

pixel_sizes

Return the (x,y) pixel size.

Methods Summary

add_hdu(hdul, hdu, extname)

Add a FITS HDU to the HDUList.

copy()

Return a copy of the HAWC+ channels.

create_dark_squid_lookup()

Create the dark squid lookup array.

get_si_pixel_size()

Return the science instrument pixel size

get_table_entry(name)

Return a channel parameter for the given name.

init_divisions()

Initializes channel divisions.

init_groups()

Initializes channel groups for HAWC+.

init_modalities()

Initializes channel modalities.

load_channel_data()

Load the channel data.

max_pixels()

Return the maximum pixels in the detector array.

normalize_array_gains()

Normalize the relative channel gains in observing channels.

read_data(hdul)

Read a FITS HDU list to populate channel data.

read_jump_levels(filename)

Read the jump levels from a data file.

set_nominal_pixel_positions(pixel_sizes)

Set the nominal pixel positions for the given pixel sizes.

slim([reindex])

Remove all DEAD or DISCARD flagged channels.

validate_scan(scan)

Validate the channels with a scan.

write_flat_field(filename[, include_nonlinear])

Write a flat field file used for chop-nod pipelines.

Attributes Documentation

band_id

Return the HAWC_PLUS Band

Returns:
bandstr
dark_squid_lookup

Return the dark squid lookup array.

The lookup array is of the form lookup[sub, col] = fixed_index. Invalid values are marked with values of -1 (good pixels).

Returns:
lookupnumpy.ndarray (int)
detector

Return the detector info.

Returns:
HawcPlusDetectorArrayInfo
pixel_sizes

Return the (x,y) pixel size.

Returns:
numpy.ndarray (astropy.units.Quantity)

An array of size 2 containing the x, y pixel size in arc seconds.

Methods Documentation

add_hdu(hdul, hdu, extname)[source]

Add a FITS HDU to the HDUList.

Parameters:
hdulfits.HDUList

The HDUList to append to.

hdufits.ImageHDU or fits.PrimaryHDU or fits.BinTableHDU

The fits HDU to append.

extnamestr

The name of the HDU extension.

Returns:
None
copy()[source]

Return a copy of the HAWC+ channels.

Returns:
HawcPlusChannels
create_dark_squid_lookup()[source]

Create the dark squid lookup array.

The dark squid lookup array is stored in the info.detector_array object.

Returns:
None
get_si_pixel_size()[source]

Return the science instrument pixel size

Returns:
x, yCoordinate2D

The (x, y) pixel sizes

get_table_entry(name)[source]

Return a channel parameter for the given name.

Parameters:
namestr
Returns:
value
init_divisions()[source]

Initializes channel divisions.

Divisions contain sets of channel groups.

The HAWC_PLUS channel adds divisions consisting of groups where each contains a unique value of a certain data field. For example, the “rows” division contains a group for row 1, a group for row 2, etc.

Returns:
None
init_groups()[source]

Initializes channel groups for HAWC+.

Each group contains a subset of the channel data, referenced by index.

The HAWC_PLUS groups contain additional groups based on sub-array.

Returns:
None
init_modalities()[source]

Initializes channel modalities.

A modality is based of a channel division and contains a mode for each channel group in the channel division.

The HAWC_PLUS modalities simply contain additional correlated modes based on the additional channel fields. A new coupled modality is also created according to polarization arrays.

Returns:
None
load_channel_data()[source]

Load the channel data.

The pixel data and wiring data files should be defined in the configuration.

Returns:
None
max_pixels()[source]

Return the maximum pixels in the detector array.

Returns:
countint
normalize_array_gains()[source]

Normalize the relative channel gains in observing channels.

Returns:
average_gainfloat

The average gain prior to normalization.

read_data(hdul)[source]

Read a FITS HDU list to populate channel data.

Parameters:
hdulfits.HDUList
Returns:
None
read_jump_levels(filename)[source]

Read the jump levels from a data file.

Parameters:
filenamestr
Returns:
None
set_nominal_pixel_positions(pixel_sizes)[source]

Set the nominal pixel positions for the given pixel sizes.

Parameters:
pixel_sizesCoordinate2D
Returns:
None
slim(reindex=True)[source]

Remove all DEAD or DISCARD flagged channels.

Will also update channel groups, divisions, and modalities.

Parameters:
reindexbool, optional

If True, reindex channels if slimmed.

Returns:
slimmedbool

True if channels were discarded, False otherwise.

validate_scan(scan)[source]

Validate the channels with a scan.

Parameters:
scanScan
Returns:
None
write_flat_field(filename, include_nonlinear=False)[source]

Write a flat field file used for chop-nod pipelines.

Parameters:
filenamestr

The filename to write to.

include_nonlinearbool, optional

If True, include the nonlinear responses.

Returns:
None