pyimcom.diagnostics.outimage_utils.helper

Helper functions to read metadata in output coadded map diagnostics

Functions

UNIT_to_bels

Convert a unit string to units of bels.

HDU_to_bels

Convert a FITS header to units of bels.

Functions

UNIT_to_bels(unitstring)

Convert a UNIT string (usually a FITS header value) to units of bels

HDU_to_bels(inhdu)

Reads the UNIT keyword from a FITS header and converts it to bels.

Module Contents

UNIT_to_bels(unitstring)[source]

Convert a UNIT string (usually a FITS header value) to units of bels

Parameters:

unitstring (str) – A number and optional SI prefix, e.g. 0.2uB (supports m=milli, u=micro, n=nano).

Returns:

Floating version of the unitstring, e.g., 2.0e-7. Returns np.nan if no match or unrecognized.

Return type:

float

HDU_to_bels(inhdu)[source]

Reads the UNIT keyword from a FITS header and converts it to bels.

Parameters:

inhdu (astropy.io.fits.ImageHDU) – The FITS HDU to read.

Returns:

Floating version of the unitstring encoded in the FITS header. Returns np.nan if no match or unrecognized.

Return type:

float