Plot the stack of MultiAccum sample values for a specified pixel in an IR multiaccum image. Pixels from any of the SCI, ERR, DQ, or TIME image extensions can be plotted. The total number of samples is determined from the primary header keyword NSAMP and all samples (excluding the zeroth read) are plotted. The SCI, ERR, DQ, values are plotted as a function of sample time, while TIME values are plotted as a function of sample number. The sample times are read from the SAMPTIME keyword in the SCI header for each readout. If any of the ERR, DQ, SAMP, or TIME extensions have null data arrays, the value of the PIXVALUE extension header keyword is substituted for the pixel values. The plotted data values can be saved to an output text table or printed to the terminal.

The BUNIT keyword value is used to determine the starting units of the data, but you can plot either counts or rate using the optional keyword units.


>>> from wfc3tools import pstack
>>> xdata, ydata = pstack('ibh719grq_ima.fits',
>>> xdata
array([ 100.651947,   93.470573,   86.2892  ,   79.107826,   71.926453,
         64.745079,   57.563702,   50.382328,   43.200954,   36.019581,
         28.838205,   21.65683 ,   14.475455,    7.29408 ,    0.112705,
          0.      ])
>>> ydata
array([ 136.75660802,  151.46077054,  133.8688648 ,  108.50410805,
        109.17918583,   81.5139582 ,   90.26712192,   61.68512157,
         59.11241987,   39.01870227,   32.63157047,   16.07532735,
         33.69198196,   16.90631634,   13.54113704,    0.        ])
wfc3tools.pstack(filename, column=0, row=0, extname='sci', units='counts', title=None, xlabel=None, ylabel=None, plot=True)[source]

A function to plot the statistics of one pixels up the IR ramp image. Original implementation in the iraf nicmos package. Pixel values here are 0 based, not 1 based.



Input MultiAccum image name. This should be either a _ima or _raw file, containing all the data from multiple readouts. You must specify just the file name, with no extension designation.

columnint, default=0

The column index of the pixel to be plotted.

rowint, default=0

The row index of the pixel to be plotted.

extnamestr, default=”sci”

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

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”.

titlestr, default=None

Title for the plot. If left blank, the name of the input image, appended with the extname and column and row being plotted, 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.



Array of x-axis values that will be plotted.


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


>>> from wfc3tools import pstack
>>> inputFilename = 'ibh719grq_ima.fits'
>>> x, y = 100, 25
>>> xdata, ydata = pstack(inputFilename,