Dataset

class jwst.refpix.reference_pixels.Dataset(input_model, odd_even_columns, use_side_ref_pixels, side_smoothing_length, side_gain, conv_kernel_params, siglimit, odd_even_rows)[source]

Bases: object

Data container for passing data from routine to routine.

Parameters:
input_modelJwstDataModel

Science data model to be corrected

odd_even_columnsbool

Flag that controls whether odd and even-numbered columns are processed separately (NIR only)

use_side_ref_pixelsbool

Flag that controls whether the side reference pixels are used in the correction (NIR only)

side_smoothing_lengthint

Smoothing length to use in calculating the running median of the side reference pixels (NIR only)

side_gainfloat

Gain to use in applying the side reference pixel correction (NIR only)

conv_kernel_paramsdict

Dictionary containing the parameters needed for the optimized convolution kernel for Simple Improved Reference Subtraction (SIRS)

siglimitfloat

Sigma clipping limit to use in calculating the mean of reference pixels.

odd_even_rowsbool

Flag that controls whether odd and even-numbered rows are handled separately (MIR only)

Methods Summary

count_good_side_refpixels()

Count the number of good side reference pixels.

count_good_top_bottom_refpixels()

Count the number of good top and bottom reference pixels.

get_group(integration, group)

Get a properly sized copy of the array for each group.

get_pixeldq()

Get the properly sized pixeldq array from the input model.

log_parameters()

Log the parameters that are valid for this type of data, and those that aren't.

restore_group(integration, group)

Replace input model data with processed group array.

sigma_clip(data, dq[, low, high])

Wrap scipy.stats.sigmaclip so that data with zero variance is handled cleanly.

Methods Documentation

count_good_side_refpixels()[source]

Count the number of good side reference pixels.

Returns:
ngoodint

Number of good side reference pixels

count_good_top_bottom_refpixels()[source]

Count the number of good top and bottom reference pixels.

Returns:
ngoodint

Number of good top and bottom reference pixels

get_group(integration, group)[source]

Get a properly sized copy of the array for each group.

Parameters:
integrationint

Index of the integration from the input model from which to extract the group array

groupint

Index of the group, within the integration, from which to extract the group array

get_pixeldq()[source]

Get the properly sized pixeldq array from the input model.

Returns:
pixeldqndarray

Numpy array for the pixeldq data with the full shape of the detector

log_parameters()[source]

Log the parameters that are valid for this type of data, and those that aren’t.

restore_group(integration, group)[source]

Replace input model data with processed group array.

Parameters:
integrationint

Index of the integration from the input model which needs to be updated with the newly processed group array

groupint

Index of the group, within the integration, which needs to be updated with the newly processed group array

sigma_clip(data, dq, low=None, high=None)[source]

Wrap scipy.stats.sigmaclip so that data with zero variance is handled cleanly.

Parameters:
datandarray

Array of pixels to be sigma-clipped

dqndarray

DQ array for data

lowfloat or None, optional

Lower clipping boundary, in standard deviations from the mean

highfloat or None, optional

Upper clipping boundary, in standard deviations from the mean

Returns:
meanfloat

Clipped mean of data array