pstat

wfc3tools.pstat.pstat(filename, col_slice=None, row_slice=None, extname='sci', units='counts', stat='midpt', title=None, xlabel=None, ylabel=None, plot=True, overplot=False)[source]

A function to plot the statistics of one or more pixels up an IR ramp.

Parameters:
filenamestr

Input MultiAccum image filename. This should be either a _raw or _ima file, containing all the data from multiple readouts. Only the filename should be be specified (i.e., no image section or extension name).

col_slicetuple of ints, default = None

A tuple representing the columns to be included as part of the analysis. The default value of None indicates use of all columns.

row_slicetuple of ints, default = None

A tuple representing the rows to be included as part of the analysis. The default value of None indicates use of all rows.

extnamestr, default=”sci”

Extension name (EXTNAME keyword value) of data to plot. Allowed values are “sci”, “err”, and “dq”.

unitsstr, default=”counts”

Plot “sci” or “err” data in units of counts or countrate (“rate”). Input data can be in either unit; conversion will be performed automatically. Ignored when plotting “dq”, “samp”, or “time” data. Allowed values are “counts” and “rate”.

statstr, default=”midpt”

Type of statistic to compute. Allowed values are “mean”, “midpt”, “mode”, “stddev”, “min”, and “max”.

titlestr, default=None

Title for the plot. If left blank, the name of the input image, appended with the extname and image section, is used.

xlabelstr, default=None

Label for the X-axis of the plot. If left blank, a suitable default is generated.

ylabelstr, default=None

Label for the Y-axis of the plot. If left blank, a suitable default based on the plot units and the extname of the data is generated.

plotbool, default=True

If False, return data and do not plot.

overplotbool, default=False

If True, the results will be overplotted on the previous plot.

Returns:
xaxisnumpy.ndarray

Array of x-axis values that will be plotted.

yaxisnumpy.ndarray

Array of y-axis values that will be plotted as specified by ‘units’.

Notes

Pixel values here are 0 based, not 1 based.

Examples

Using an image section to generate output in counts:

>>> from wfc3tools import pstat
>>> time, counts = pstat('ibh719grq_ima.fits', col_slice=(100, 104), row_slice=(20, 25), units="counts")

Using the entire image to generate output in countrate:

>>> time, counts = pstat('ibh719grq_ima.fits', col_slice=None, row_slice=None, units="rate")