chandra_aca.dark_subtract

chandra_aca.dark_subtract.get_aca_images_bgd_sub(img_table, t_ccd_vals, img_dark, tccd_dark)[source]

Get the background subtracted ACA images.

Parameters:
img_tableastropy.table.Table

Table of ACA images with columns ‘IMG’, ‘IMGROW0_8X8’, ‘IMGCOL0_8X8’, ‘INTEG’.

t_ccd_valsnp.array

CCD temperature values at the times of the ACA images (deg C).

img_darknp.array

Dark calibration image. Must be 1024x1024 (e-/s).

tccd_darkfloat

Reference temperature of the dark calibration image (deg C).

Returns:
tuple (imgs_bgsub, imgs_dark)
imgs_bgsubnp.array

Background subtracted ACA images (DN).

imgs_darknp.array

Dark current images (DN).

chandra_aca.dark_subtract.get_dark_backgrounds(raw_dark_img, imgrow0, imgcol0, size=8)[source]

Get dark background cutouts at a set of ACA image positions.

Parameters:
raw_dark_imgnp.array

Dark calibration image.

imgrow0np.array (int)

Row of ACA image.

imgcol0np.array (int)

Column of ACA image.

sizeint, optional

Size of ACA image (default=8).

Returns:
imgs_darknp.array (len(imgrow0), size, size)

Dark backgrounds for image locations sampled from raw_dark_img (e-/s). Pixels outside raw_dark_img are set to 0.0.

chandra_aca.dark_subtract.get_dark_current_imgs(img_table, img_dark, tccd_dark, t_ccds)[source]

Get the scaled dark current values for a table of ACA images.

This scales the dark current to the appropriate temperature and integration time, returning the dark current in DN matching the ACA images in img_table.

Parameters:
img_tableastropy.table.Table

Table of ACA images with columns ‘IMG’, ‘IMGROW0_8X8’, ‘IMGCOL0_8X8’, ‘INTEG’.

img_dark1024x1024 array

Dark calibration image.

tccd_darkfloat

Reference temperature of the dark calibration image.

t_ccdsarray

Cheta temperature values at the times of img_table.

Returns:
imgs_darknp.array (len(img_table), 8, 8)

Temperature scaled dark current for each ACA image in img_table (DN).

chandra_aca.dark_subtract.get_tccd_data(times, smooth_window=30, median_window=3, source='maude', maude_channel=None)[source]

Get the CCD temperature for given times and interpolate and smooth.

This is a light wrapper around cheta.fetch_sci.Msid(“aacccdpt”, start, stop) to handle an option to use the maude data source in an explicit way.

Parameters:
times: np.array (float)

Sampling times for CCD temperature data (CXC seconds).

sourcestr, optional

Source of CCD temperature data (‘maude’ (default) or ‘cxc’ for cheta archive).

median_windowint, optional

Median filter window to remove outliers (default=3).

smooth_windowint, optional

Smooth data using a hanning window of this length in samples (default=30).

maude_channelstr, optional

Maude channel to use (default is flight).

Returns:
valsnp.array

CCD temperature values.