STScI Logo

coadd stsdas.analysis.timeseries


NAME · USAGE · DESCRIPTION · PARAMETERS · EXAMPLES · BUGS · REFERENCES
SEE_ALSO

NAME

coadd - Calculate average measurements in specified phase intervals.

USAGE

coadd infile phasefile inmask outfile errorfile outmask nbins fillval

DESCRIPTION

After sorting a time series observation according to phase (i.e., by using the task orderphase) you may want a smoother light curve. This task produces such a curve by dividing data between phases zero and one into several bins and taking the average of points in each bin.

The input data are expected in order of increasing fractional phase, i.e., it must have been ordered by the orderphase task. Synchronous co-addition is done by calculating the average value of the data contained in each fractional phase interval.

The binning scheme is illustrated by the following example: if there are 5 bins between phases 0 and 1, the points in [0, 0.1) and in [0.9, 1) go to bin #1, points in [0.1, 0.3) go to bin #2, points in [0.3, 0.5) go to bin #3, etc.

The input time series can have an associated mask file, in which case the output data will have a corresponding mask file where fractional phase is the independent parameter.

PARAMETERS

infile = "" [string]
Name of the input science data file (this can be a template).
phasefile = "" [string]
Name of the input phase data file (this can also be a template).
inmask = "" [string]
Name of the input science mask file, if used.
outfile = "" [string]
Name of the output data file. Output files contain average count rates for each phase bin.

If the number of input files is the same as the number of output files, then each input file will produce one output file and one phase file. If there are several input files but only one output file, then results will be combined into a single output file and phase file.

errorfile = "" [string]
Name of the file in which to store the mean error of the output data file.
outmask = "" [string]
Name of the output mask file.
nbins = [integer, min = 1]
Number of bins in the output file.
fillval = 1. [real]
Fill value to be used in the output mask file to represent bins without output data.

EXAMPLES

1. Average the data in the input file data1.d0h in each of 15 phase bins. The phase file associated with the input file is phase1.d0h. Put the result in the science file dataout.d0h, the error file error.d0h, and the output mask maskout.d0h. If there are no data in any phase bin, put the value 16 at the corresponding pixel in the output mask file.


ti> coadd infile = "data1.d0h" phasefile = "phase1.d0h"  \
>>> outfile = "dataout.d0h" errorfile = "error.d0h" \
>>> outmask = "maskout.d0h" nbins = 15 fillval = 16

BUGS

REFERENCES

SEE ALSO

orderphase


Source Code · Package Help · Search Form · STSDAS