solpolpy.instruments#

Instrument specific code.

Functions#

get_data_angle(header)

load_data(→ ndcube.NDCollection)

Basic loading function. See load_with_occulter_mask.

construct_mask(→ numpy.ndarray)

Constructs a mask where False indicates the pixel is valid and True masks the pixel as invalid.

get_instrument_mask(→ numpy.ndarray)

Gets a coronograph mask for common instruments.

Module Contents#

solpolpy.instruments.get_data_angle(header)#
solpolpy.instruments.load_data(path_list: list[str], mask: numpy.ndarray | None = None, use_instrument_mask: bool = False) ndcube.NDCollection#

Basic loading function. See load_with_occulter_mask.

Parameters:
  • path_list (List[str]) – list of paths to FITS files to be loaded

  • mask (Optional[np.ndarray]) – An optional mask to couple with images. Overrides any mask computed when use_instrument_mask=True.

  • use_instrument_mask (bool) – If true, loads an instrument mask for common instruments defined in get_instrument_mask.

Returns:

The data are loaded as NDCollection object with WCS and header information available. The keys are labeled as ‘angle_1’, ‘angle_2, ‘angle_3’, …

Return type:

NDCollection

solpolpy.instruments.construct_mask(inner_radius: float, outer_radius: float, center_x: int, center_y: int, shape: tuple[int, int]) numpy.ndarray#

Constructs a mask where False indicates the pixel is valid and True masks the pixel as invalid.

Pixels with radial distance between inner_radius and outer_radius are valid. Every other pixel is invalid. This is a standard coronograph mask.

Parameters:
  • inner_radius (float) – inner radius of the mask. pixels closer to the center than this are masked as invalid

  • outer_radius (float) – outer radius of the mask. pixels farther from the center than this are masked as invalid

  • center_x (int) – center pixel x coordinate

  • center_y (int) – center pixel y coordinate

  • shape (Tuple[int, int]) – the image dimensions

Returns:

a coronograph mask that marks invalid pixels (those with radius less than inner_radius or greater than outer_radius) as True

Return type:

np.ndarray

solpolpy.instruments.get_instrument_mask(header: astropy.io.fits.Header) numpy.ndarray#

Gets a coronograph mask for common instruments.

Supports common solar instruments: LASCO, COSMO K, SECCHI

Parameters:

header (astropy.io.fits.Header) – a FITS header for the file in question

Returns:

a pixel mask where valid pixels are marked False, masked out invalid pixels are flagged as True

Return type:

np.ndarray