HawcPlusInfo

class sofia_redux.scan.custom.hawc_plus.info.info.HawcPlusInfo(configuration_path=None)[source]

Bases: SofiaInfo

Initialize a HawcPlusInfo object.

The HAWC+ information contains metadata on various parts of an observation that are specific to observations with the instrument.

Parameters:
configuration_pathstr, optional

An alternate directory path to the configuration tree to be used during the reduction. The default is <package>/data/configurations.

Methods Summary

determine_hwp_angle(filename, hwp_step)

Determine the mean HWP angle in the given file.

edit_header(header)

Edit an image header with available information.

get_file_id()

Return the file ID.

get_si_pixel_size()

Get the science instrument pixel size.

group_files_by_hwp(filenames[, jobs, ...])

Group HAWC+ files by HWP angle.

max_pixels()

Return the maximum number of pixels.

parallel_safe_determine_hwp_angle(args, ...)

Return the HWP (half-wave-plate) angle for a single file.

perform_reduction(reduction, filenames)

Fully reduce a given reduction and set of files.

split_reduction(reduction, file_groups)

Split the reduction based on files grouped by HWP angle.

validate_scans(scans)

Validate a list of scans specific to the instrument.

Methods Documentation

classmethod determine_hwp_angle(filename, hwp_step)[source]

Determine the mean HWP angle in the given file.

Parameters:
filenamestr

The FITS file to search.

hwp_stepunits.Quantity

The HWP step size for each HWP count.

Returns:
hwp_angleunits.Quantity

The average HWP angle in the file.

edit_header(header)[source]

Edit an image header with available information.

Parameters:
headerastropy.fits.Header

The FITS header to apply.

Returns:
None
classmethod get_file_id()[source]

Return the file ID.

Returns:
str
get_si_pixel_size()[source]

Get the science instrument pixel size.

Returns:
sizeCoordinate2D

The (x, y) pixel sizes, each of which is a units.Quantity.

group_files_by_hwp(filenames, jobs=1, force_threading=False)[source]

Group HAWC+ files by HWP angle.

Parameters:
filenameslist (str)

A list of HAWC+ FITS files to group.

jobsint

The number of parallel jobs used to determine the grouping.

force_threadingbool

If True, force parallel processing using threads.

Returns:
file_groupsdict

The files grouped by HWP angle {angle : [files]}

max_pixels()[source]

Return the maximum number of pixels.

Returns:
countint
classmethod parallel_safe_determine_hwp_angle(args, file_index)[source]

Return the HWP (half-wave-plate) angle for a single file.

This function is safe for multiprocessing using multiprocessing.multitask().

Parameters:
args2-tuple
args[0]list (str)

A list of FITS file names.

args[1]units.Quantity

The HWP step used to convert HWP counts to a HWP angle.

file_indexint

The index of the file in args[0] for which to determine the HWP angle.

Returns:
hwp_angle: units.Quantity
perform_reduction(reduction, filenames)[source]

Fully reduce a given reduction and set of files.

While it is possible for the reduction object to fully reduce a set of files, certain special considerations may be required for certain instruments. Therefore, the instrument specific Info object is given control of how a reduction should progress.

HAWC+ requires special processing for scan polarimetry data. When multiple files are provided, files will be grouped by half-wave-plate (HWP) angle and each group will then be reduced for the R0 and T0 subarrays. Note that a standard reduction will be performed if multiple HWP angles are not detected.

Parameters:
reductionReduction

The reduction object.

filenamesstr or list (str)

A single file (str) or list of files to be included in the reduction.

Returns:
None
static split_reduction(reduction, file_groups)[source]

Split the reduction based on files grouped by HWP angle.

Parameters:
reductionReduction
file_groupsdict
Returns:
None
validate_scans(scans)[source]

Validate a list of scans specific to the instrument.

Parameters:
scanslist (HawcPlusScan)

A list of scans. Scans are culled in-place if they do not meet certain criteria.

Returns:
None