solid_waffle.correlation_run

Routines to run the infrared flat correlations.

Classes

EmptyClass

Blank, can add attributes later.

Config

Extracts configuration data from a multiline string.

Functions

run_ir_all

Runs the IR characterization.

run_vis_all

Runs the visible characterization.

Classes

EmptyClass

Blank, can add attributes later.

Config

Extracts configuration data from a multiline string.

Functions

run_ir_all(infile)

Runs the IR characterization.

run_vis_all(infile[, run_ir_first])

Runs the visible characterization.

Module Contents

class EmptyClass[source]

Blank, can add attributes later.

class Config(cfg, visible_run=False, verbose=False)[source]

Extracts configuration data from a multiline string.

Some attributes may not be present depending on the configuration.

Parameters:
  • cfg (str or list) – The configuration (as a single string or list of strings).

  • visible_run (bool, optional) – Is this configured to run visible light correlations?

  • verbose (bool, optional) – Whether to specify lots of information when reading the configuration.

visible_run[source]

Is this configured to run visible light correlations?

Type:

bool

outstem[source]

The stem for output files.

Type:

str

use_cmap[source]

The color bar range to use.

Type:

str

mydet[source]

Name of the detector.

Type:

str

lightfiles[source]

List of the flat field file names.

Type:

list of str

darkfiles[source]

List of the dark exposure file names, same length as lightfiles.

Type:

list of str

formatpars[source]

The format type for these images.

Type:

int

nx, ny

The number of bins to break the detector array into on the x and y axes.

Type:

int

tslices[source]

Time slices to use for BFE correlations. Length 4, ascending.

Type:

list of int

tslicesM2a, tslicesM2b, tslicesM3

Time slices to use for alternative BFE tests. Length 4, ascending.

Type:

list of int

fullref[source]

Apply full reference pixel corrrection?

Type:

bool

sensitivity_spread_cut[source]

The fractional deviation from the median flat at which to cut pixels.

Type:

float

critfrac[source]

Fraction of the pixels that need to be good to keep a superpixel.

Type:

float

mychar[source]

Type of characterization to use (options are “Basic” and “Advanced”).

Type:

str

hotpix[source]

Whether to do the hot pixel analysis.

Type:

bool

hotpix_ADU_range

Hot pixel selection range (length 4: [Smin, Smax, stability, f_isolation]).

Type:

list of float

ref_for_hotpix_is_autocorr[source]

Plot hot pixel results relative to autocorrelation results?

Type:

bool

hotpix_logtspace[source]

Space hot pixel samples logarithmically?

Type:

bool

hotpix_slidemed[source]

Use sliding median method to get hot pixel IPC measuremenent?

Type:

bool

s_bfe[source]

Radius of BFE kernel.

Type:

int

p_order[source]

If >0, builds non-linearity polynomial table through this order.

Type:

int

basicpar[source]

Basic characterization parameters.

Type:

class

bfepar[source]

BFE characterization parameters.

Type:

class

narrowfig[source]

Output figures in narrow format?

Type:

bool

maskX, maskY

Super-pixel regions to mask out (can be empty).

Type:

list of int

tchar1, tchar2

Time steps for advanced characterization.

Type:

int

ncycle

Number of iterations for advanced characterization.

Type:

int

ipnltype

Inter-pixel non-linearity model: ‘bfe’ or ‘nlipc’.

Type:

str

nlfit_ts, nlfit_te

Range of time stamps for fitting the non-linearity curve.

Type:

int

NTMAX[source]

Maximum time slice allowed.

Type:

int

swi[source]

Column information.

Type:

class

N[source]

Size of the SCA.

Type:

int

dx, dy

Size of super-pixels.

Type:

int

npix[source]

Number of pixels in a super-pixel.

Type:

int

full_info[source]

Calibration results, shape = (ny, nx, …).

Type:

np.array

is_good[source]

Good super-pixel map, shape = (ny, nx).

Type:

np.array

lightref, darkref

Reference pixel corrections for the flats and darks.

Type:

np.array

mean_full_info, std_full_info

Array mean and standard deviation of full_info.

Type:

np.array

nlfit, nlder

Array of the ramp fit and derivative, shape = (nt, ny, nx).

Type:

np.array

used_2a, used_2b, used_3

Whether the alternative methods were implemented.

Type:

bool

ntM2a, ntM2b, ntM3

Number of time stamps in each alternative method.

Type:

int

Method2a_slopes, Method2b_slopes, Method3_slopes

Alternative gain/IPC calculation slopes, shape = (ny, nx).

Type:

np.array

Method2a_vals, Method2b_vals, Method3_vals

Alternative gain/IPC calculation values, shape = (ny, nx, …).

Type:

np.array

tfmin, tfmax, tfminB, tfmaxB, tfmin3, tfmax3

Time stamps for Methods 2a, 2b, and 3.

Type:

int

slope_2a_BFE, slope_2a_NLIPC

Predicted slopes for the different alternative methods for different sources of IPNL (Method 2a).

Type:

float

slope_2b_BFE, slope_2b_NLIPC

Predicted slopes for the different alternative methods for different sources of IPNL (Method 2b).

Type:

float

slope_3_beta, slope_3_BFE, slope_3_NLIPC

Predicted slopes for the different alternative methods for different sources of IPNL (Method 3).

Type:

float

PV2a, PV2b, PV3

Peak-to-valley errors of alternative method fits.

Type:

float

hotX, hotY

Coordinates of the hot pixels; same length.

Type:

np.array of int

htsteps

Time steps for the hot pixel analysis.

Type:

list of int

hotpix_signal

Signal levels of the hot pixels, shape = (len(hotX), len(htsteps))

Type:

np.array

hotpix_alpha

IPC estimated from the hot pixels, shape = (len(hotX), len(htsteps))

Type:

np.array

ipcmed_x, ipcmed_y, ipcmed_yerr

Signal, IPC, and IPC error for the hot pixel signal-dependent IPC method. 1D arrays.

Type:

np.array

grid_alphaCorr, grid_alphaCorrErr, grid_alphaHot, grid_alphaHotErr

The correlation- and hot pixel-based IPC in each of the 16 hexadecants of the detector array, and their uncertainties.

Type:

np.array

ts_vis, te_vis, tchar1_vis, tchar2_vis

The time stamps for visible characterization.

Type:

int

has_visbfe

Visible BFE enabled?

Type:

bool

tslices_visbfe

Time slices for visible BFE analysis.

Type:

list of int

copy_ir_bfe

Assume IR BFE applies to visible? (May improve S/N.)

Type:

bool

vis_out_data

The visible characterization data, shape = (ny, nx, 56)

Type:

np.array

vis_col

Column mapping for the visible characterization.

Type:

dict

__init__()[source]

Constructor.

fit_parameters()[source]

Build general parameters (gain, IPC, NL) and BFE Method 1.

generate_nonlinearity()[source]

Generates non-linearity data.

write_basic_figure()[source]

Makes a PDF figure of the SCA parameter maps.

alt_methods()[source]

Methods 2a, 2b, and 3 trend computation.

method_23_plot()[source]

Method 2 and 3 characterization Multi-panel figure showing basic characterization.

text_output()[source]

Generate a text summary.

hotpix_analysis()[source]

Hot pixel analysis.

hotpix_plots()[source]

Makes the hot pixel plots.

compute_vis_quantities()[source]

Computations for the visible light characterization.

vis_plots()[source]

Make plots for the visible light characterization.

visible_run = False[source]
outstem = 'default_output'[source]
use_cmap = 'gnuplot'[source]
mydet = ''[source]
lightfiles = [][source]
darkfiles = [][source]
formatpars = 1[source]
tslices = [3, 11, 13, 21][source]
tslicesM2a = [][source]
tslicesM2b = [][source]
tslicesM3 = [][source]
fullref = True[source]
sensitivity_spread_cut = 0.1[source]
critfrac = 0.75[source]
mychar = 'Basic'[source]
hotpix = False[source]
ref_for_hotpix_is_autocorr = False[source]
hotpix_logtspace = False[source]
hotpix_slidemed = False[source]
swi[source]
s_bfe = 2[source]
p_order = 0[source]
basicpar[source]
bfepar[source]
narrowfig = False[source]
maskX = [][source]
maskY = [][source]
NTMAX = 16384[source]
N = 4096[source]
dx = 128[source]
dy = 128[source]
npix[source]
full_info[source]
is_good[source]
fit_parameters(verbose=False)[source]

Build general parameters (gain, IPC, NL) and BFE Method 1.

Parameters:

verbose (bool) – Whether to talk a lot.

Return type:

None

generate_nonlinearity(write_to_file=True)[source]

Generates non-linearity data.

Parameters:

write_to_file (bool, optional) – Write the non-linearity table to a file as well?

Return type:

None

write_basic_figure()[source]

Makes a PDF figure of the SCA parameter maps.

alt_methods(verbose=False)[source]

Methods 2a, 2b, and 3 trend computation.

Parameters:

verbose (bool, optional) – Whether to print a lot to the output.

Return type:

None

method_23_plot()[source]

Method 2 and 3 characterization Multi-panel figure showing basic characterization.

text_output()[source]

Generate a text summary.

Parameters:

None

Returns:

The output text table.

Return type:

str

hotpix_analysis(verbose=False)[source]

Hot pixel analysis.

Parameters:

verbose (bool, optional) – Whether to talk a lot.

Returns:

Hot pixel report.

Return type:

str

hotpix_plots()[source]

Makes the hot pixel plots.

compute_vis_quantities(ir_output=None, verbose=False)[source]

Computations for the visible light characterization.

Parameters:
  • ir_output (str, optional) – The data from the IR output characterization as a string; if not specified, tries to load from the file.

  • verbose (bool, optional) – Whether to talk a lot.

Return type:

None

vis_plots()[source]

Make plots for the visible light characterization.

run_ir_all(infile)[source]

Runs the IR characterization.

Parameters:

infile (str) – The input file.

Return type:

None

run_vis_all(infile, run_ir_first=True)[source]

Runs the visible characterization.

Parameters:
  • infile (str) – The input file.

  • run_ir_first (bool, optional) – Run the IR characterization first (turn off if you already ran it!).

Return type:

None