grabs files from server and turns them into FITS

grab2fits grabs an ultracam run from the server or local disk and splits it up into FITS files. The files will be dumped in whichever disk this is run. One server file can generate many FITS files. These will have names consisting of the server file name + "_001" etc. In addition, an extra "_1", "_2" etc can be added if the files are split by CCD number as well. The server must be running for this program to work of course, or you can access the local disk directly instead. You may experience problems defining the directory path. It is helpful to look at the messages the server produces to see where it is trying to find the files in this case. Note that grab2fits will skip over junk data in the case of drift mode, so your first file might be number 5 say even though you asked for number 1.

The FITS files produced by this routine can be displayed with 'ds9' and the command-line option '-mosaicimage wcs' allows all windows to be displayed at once.


grab2fits [source] (url)/(file) ndigit first last trim [(ncol nrow) twait tmax] bias (biasframe flat (flatframe) threshold (photon) naccum (split) overwrite


source---Data source, either 'l' for local or 's' for server. 'Local' means the usual .xml and .dat files accessed directly. Do not add either .xml or .dat to the file name; these are assumed.
url/file---If source='S', this should be the complete URL of the file, e.g. '', or just the file part in which case the program will try to find a default part to add from the environment variable ULTRACAM_DEFAULT_URL. Failing this it will add, i.e. the local host. If source='L', this should just be a plain file name.
ndigit---The minimum number of digits to use on output to tack on the frame number. If ndigit=0, then just enough will be used for each frame, however specifying a number > 0 has the advantage that it is then much easier to get a listing of the files in temporal order since this is also alphabetical. e.g. you will end up with files of the form run0012_001, run0012_002, etc if you set ndigit=3.
first---The first file, starting from 1.
last---The last file. last=0 will just try to grab as many as possible, otherwise it should be >= first
trim---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---Time to wait between attempts to find a new exposure (seconds).
tmax---Maximum time to wait before giving up (seconds). Set = 0 to quit as soon as a frame is not found.
bias---true/false according to whether you want to subtract a bias frame. You can specify a full-frame bias because it will be cropped to match whatever your format is. This is useful for ultracam because of the different bias levels of the 6 readouts.
biasframe---If bias, then you need to specify the name of the bias frame.
flat---true/false according to whether you want to apply a flat field. You can specify a full-frame flat because it will be cropped to match whatever your format is..
flatframe---If flat, then you need to specify the name of the flatfield frame.
threshold---If you are applying a bias to ULTRASPEC L3CCD data, you have the option of converting to photon counts (0 or 1 whether above or below a certain threshold).
photon---The threshold level if threshold = true
naccum---Accumulate data into the sum of naccum frames before writing to disk. If some are still accumulating at the end, they will be written out even if they have not reach 'naccum'.
split---true/false according to whether you want to split up the resulting files into one per CCD. Otherwise all CCDs and windows will be dumped to a single FITS file per exposure
overwrite---true/false according to whether you want to allow existing files to be overwritten

Related routines: ucm2fits, fits2ucm


This command is a member of the classes: FITS, IO, Observing, Programs.

Author: T.R. Marsh
Created: 06 May 2002
Revised: 25 Jan 2008

Page generated Fri Jul 5 12:23:42 2013