sreduce for reducing time-series spectroscopy

sreduce is the main ultracam program for reducing spectra. It can extract spectra of multiple objects from multiple CCDs. These can be dumped to molly files.

Most of the customisation of sreduce is done through an ASCII data file read in at the start, although other options that one often wants to vary (and which make no difference to the final reduced data) are entered through the command input section. Look at sreduce.sre for an example file. See the descriptions below for what each parameter does.

Invocation

sreduce [source] rfile logfile ((url)/(file) first trim [(ncol nrow) twait tmax])/(flist) plot

Command line arguments

source---Data source, either 'l' for local, 's' for server or 'u' for ucm files. 'Local' means the usual .xml and .dat files accessed directly. Do not add either .xml or .dat to the file name; these are assumed. 'u' means you will need to specify a list of files which should all be .ucm files (either with or without the extension)
rfile---ASCII File defining the reduction. The extension ".sre" is added by default.
logfile---File to record the results of the reduction. The extension ".log" is added by default. Molly files with the same root will also be created along with the CCD and aperture number as is 'run034_1_2.mol' which would be the second aperture of the CCD 1. The CCD number is omitted if there is only one of them, but the aperture number is always added. Do not add the '.log' yourself.
url/file---If source = 'S', this argument specifies the name of the file of interest (it can be a full URL or just the file name in which case the program will attempt to fill in the rest using either the environment variable ULTRACAM_DEFAULT_URL or a URL appropriate to a server running on the local host). If source = 'L', this should be a plain file name without .xml or .dat
first---If source = 'S' or 'L', this argument specifies the first frame to reduce starting from 1
trim---If source = 'S' or 'L', set trim=true to enable trimming of potential junk rows and columns of each window
ncol---If trim, then this specifies the number of columns nearest the readouts of each window to be snipped off as these can be corrupted.
nrow---If trim, then this specifies the number of rows to snip off the bottom of each window as these can be corrupted.
twait---If source = 'S' or 'L', time to wait between attempts to find a new exposure (seconds).
tmax---If source = 'S' or 'L', maximum time to wait before giving up (seconds). Set = 0 to quit as soon as a frame is not found.
flist---If source = 'U', this is the name of a list of ULTRACAM files to reduce. These should be arranged in temporal order to help the reduction move from one exposure to the next successfully.
splot---true/false according to whether you want line plots of the spectra
tplot---true/false according to whether you want trailed spectrum plots
hplot---true/false according to whether you want a hard copy of the trailed spectrum plots at the end.

Reduction file

As well as the command line parameters, there are many others required to define the reduction, so many in fact that file input is preferable, as many of them do not change much and for later checking on what was done. The file is in ASCII with a series of lines of the form "option = value". Both "option" and "value" must contain no blanks. Lines will only be read if they start with a non-blank character, with the exception of '#' which acts as a comment flag. Some inputs are required, others are optional. These are indicated below. The option is read as the first string before the '=' sign. The value is read as everything after the '=' sign up to the first '#' (not escaped) or the end of the string. In more-or-less alphabetical order (some grouping by purpose too), the options are as follows:
abort_behaviour---How to deal with problems. 'fussy' = give up at the first hint of trouble. 'relaxed' = continue regardless.Required.
region_file---Name of a master spectrum extraction region file, e.g. as set up by setreg. Required.
region_reposition_mode---The method to be used to reposition the regions from frame to frame. Options: fixed = no change. individual = move each region separately. reference all objects are moved according to the movement of just one of them, the reference object. Required.
region_fwhm---If regions are to be shifted, then their position is measured by measuring the position of the respective object and using this to adjust all regions. The measurement is carried out using corss-correlation with a gaussian. The FWHM of this is fxed and specified by this parameter. It is measured in unbinned pixels but will be truncated to at least 2 unbinned pixels. Required if region_reposition_mode = 'individual' or 'reference'.
region_max_shift---When the extraction regions are adjusted, this parameter imposes a maximum upon the shift of the regions. It is measured in unbinned pixels. Required if region_reposition_mode = 'individual' or 'reference'.
region_hwidth---Regions are adjusted by measurement of the object position in a collapsed profile. This option allows you to median filter in X when making this profile to remove cosmic rays.
clobber---[yes/no] Can the log file overwrite any previously existing file of the same name or not? For safety say no, and the program will fall over if it finds the same name. Say yes if this irritates you. Required.
coerce---[yes/no] Should calibration frames be cropped to match data frames? Required if any calibration has been enabled. Normally yes. You should never coerce biases when it involves a change of binning factors. When coercing flat fields, gain frames and readout noise frames, the programs scales to give an average rather than a sum. It warns when it does this in case it is not what you want.
naccum---Accumulate data by adding groups of frames prior to extraction
threshold---Apply a threshold to give photon counts or not. Note that if you choose this mode then any dark frame must correctly converted to photons as well. The thresholding is applied immediately after bias subtraction is carried out. The gain should be set equal to 1 everywhere in this case.
photon---If threshold = true, this is the threshold level above which a pixel counts as 1 photon, below = 0
bias---Name of bias frame. If not specified, no bias subtraction is carried out.
dark---Name of dark frame. If not specified, no dark subtraction is carried out. The frame, if specified, should be bias subtracted. Typically this should be the average of a large number of dark frames to reduce noise.
flat---Name of flat field frame (divide into data to correct). If not specified, not flat fielding is carried out. The frame, if specified, should be bias-subtracted.
bad_pixel---Name of a bad pixel mask file. Ignored if not specified. This is an ordinary ULTRACAM file set to 0 everywhere except for 'bad' pixels. These should have positive integer values which rise according to how 'bad' they are. It is up to you, the user, to define your own levels of badness. Programs smooth and badgen are supplied to help with the development of bad pixel masks.
gain---Gain, electrons/count, or if preceded by '@', the name of a gain frame frame giving gain for every pixel. Required.
readout---Readout noise, or if preceded by '@', the name of readout noise frame giving the readout noise for every pixel in terms of variance (counts**2). Required.
spectrum_device---Device to be used for line plots of spectra. Required.
trail_device---Device to be used for trailed plots of spectra. Required.
trail_start---The trail plots will start with this number of slots, and will be extended by the same number if necessary
hard_device---Device to be used for hard copy of trailed spectra at the end. Required.
saturation---Pixels in the output spectra can be masked if any pixel within the object region is saturated.
sky_fit---Whether you want to subtract the sky or not. Not for example if you are trying to extract arc spectra. Note that you should also not re-position the apertures in this case.
sky_npoly---Sky will be estimated using polynomial fits; this is the number of coefficients. sky_npoly = 1 implies a constant.
sky_reject---The rejection threshold for sky fits in terms of a sigma
version---Date of version of sreduce which has to match the date in this program for anything to work at all. Required.
spectrum_scale_individual---yes/no to scale spectra individually or not. If yes then the y limits for the spectrum plot are worked out per spectrum, otherwise they are set to the most extreme values of all extracted spectra
spectrum_scale_method---The method to use when computing the spectrum y-limits. Values are 'direct' which just uses user-defined fixed limits, 'automatic' which sets to the total range and 'percentile' which uses percentile ranges.
spectrum_ylow---Lower limit in the case of direct scaling
spectrum_yhigh---Upper limit in the case of direct scaling
spectrum_plow---Lower percentile limit in the case of percentile scaling
spectrum_phigh---Upper percentile limit in the case of percentile scaling
trail_scale_method---The method to use when computing the spectrum y-limits. Values are 'direct' which just uses user-defined fixed limits, 'automatic' which sets to the total range and 'percentile' which uses percentile ranges.
trail_ilow---Lower limit in the case of direct scaling
trail_ihigh---Upper limit in the case of direct scaling
trail_plow---Lower percentile limit in the case of percentile scaling
trail_phigh---Upper percentile limit in the case of percentile scaling

Classes

This command is a member of the classes: Observing, Reduction, Spectra.

Author: T.R. Marsh
Created: 31 May 2006
Revised: 06 July 2007


Page generated Fri Jul 5 12:23:42 2013