corgidrp.l2b_to_l3#

Functions#

create_wcs(input_dataset, astrom_calibration[, offset])

Create the WCS headers for the dataset.

divide_by_exptime(input_dataset)

Divide the data by the exposure time to get the units in electrons/s

split_image_by_polarization_state(input_dataset[, ...])

Split each polarimetric input image into two images by its polarization state,

crop(input_dataset[, sizexy, centerxy])

Crop the Images in a Dataset to a desired field of view. Default behavior is to

update_to_l3(input_dataset)

Updates the data level to L3. Only works on L2b data.

Module Contents#

corgidrp.l2b_to_l3.create_wcs(input_dataset, astrom_calibration, offset=None)[source]#

Create the WCS headers for the dataset.

Parameters:
  • input_dataset (corgidrp.data.Dataset) – a dataset of Images (L2b-level)

  • astrom_calibration (corgidrp.data.AstrometricCalibration) – an astrometric calibration file for the input dataset

  • offset (optional, tuple(float, float)) – x and y offset in units of pixel between the dataset and WCS center (for spectroscopy or other optics offset from imaging mode)

Returns:

a version of the input dataset with the WCS headers added

Return type:

corgidrp.data.Dataset

corgidrp.l2b_to_l3.divide_by_exptime(input_dataset)[source]#

Divide the data by the exposure time to get the units in electrons/s

Parameters:

input_dataset (corgidrp.data.Dataset) – a dataset of Images (L2b-level)

Returns:

a version of the input dataset with the data in units of electrons/s

Return type:

corgidrp.data.Dataset

corgidrp.l2b_to_l3.split_image_by_polarization_state(input_dataset, image_center_x=512, image_center_y=512, separation_diameter_arcsec=7.5, alignment_angle_WP1=0.0, alignment_angle_WP2=45.0, image_size=None, padding=5)[source]#

Split each polarimetric input image into two images by its polarization state, recompose the two images into a 2 x image_size x image_size datacube

Parameters:
  • input_dataset (corgidrp.data.Dataset) – a dataset of Images (L2b-level), should all be taken with the same color filter (same CFAMNAME header)

  • image_center_x (optional, float) – x pixel coordinate location of the center location between the two polarized images on the detector, default is the detector center at x=512.0

  • image_center_y (optional, float) – y pixel coordinate location of the center location between the two polarized images on the detector, default is the detector center at y=512.0

  • separation_diameter_arcsec (optional, float) – Distance between the centers of the two polarized images on the detector in arcsec, default for Roman CGI is 7.5”

  • alignment_angle_WP1 (optional, float) – the angle in degrees of how the two polarized images are aligned with respect to the horizontal for WP1, defaults to 0

  • alignment_angle_WP2 (optional, float) – the angle in degrees of how the two polarized images are aligned with respect to the horizontal for WP1, defaults to 45

  • image_size (optional, int) – length/width of the cropped polarized images, if none is provided, the size is automatically determined based on the coronagraph mask used

  • padding (optional, int) – number of pixels to leave as blank space between the outer radius of each PSF and the edge of the image, default is 5, is overriden if a custom image size is provided

Returns:

The input dataset with each image now being a 2 x image_size x image_size datacube

Return type:

corgidrp.data.Dataset

corgidrp.l2b_to_l3.crop(input_dataset, sizexy=None, centerxy=None)[source]#

Crop the Images in a Dataset to a desired field of view. Default behavior is to crop the image to the dark hole region, centered on the pixel intersection nearest to the star location. Assumes 3D Image data is a stack of 2D data arrays, so only crops the last two indices.

Parameters:
  • input_dataset (corgidrp.data.Dataset) – a dataset of Images (any level)

  • sizexy (int or array of int) – desired frame size, if only one number is provided the desired shape is assumed to be square, otherwise xy order. If not provided, defaults to 61 for NFOV (narrow field-of-view) observations. Defaults to None.

  • centerxy (float or array of float) – desired center (xy order), should be a pixel center (aka integer) or intersection (aka half-integer) otherwise the function rounds to the nearest pixel or pixel intersection. Defaults to the “EACQ_ROW/COL” header values.

Returns:

a version of the input dataset cropped to the desired FOV.

Return type:

corgidrp.data.Dataset

corgidrp.l2b_to_l3.update_to_l3(input_dataset)[source]#

Updates the data level to L3. Only works on L2b data.

Currently only checks that data is at the L2b level

Parameters:

input_dataset (corgidrp.data.Dataset) – a dataset of Images (L2b-level)

Returns:

same dataset now at L3-level

Return type:

corgidrp.data.Dataset