7 Writing an import task

 7.1 Case Study: DREAM

In order to import data into Surf that has not been taken with the SCUBA VAX/VMS data acquisition system, it is necessary to convert the original file format to a form that Surf can understand. The file can be converted to the same format as written by the SCUBA acquisition system (§2.1) or the format written by the reduce_switch task (§2.2).

It is expected that the conversion of the data structure to the correct format will be fairly simple. The difficulty lies in generating the required FITS information (with the correct FITS keywords) and the NDF extensions.

7.1 Case Study: DREAM

DREAM is a SCUBA observing mode where the chopping is done as part of the jiggle pattern and the resulting signal is reconstructued by tiling the bolometer patterns (le Poole and Greve, 1998, SPIE 3357). In this case it is not necessary to subtract switches, despike or flatfield the data and Surf is required simply to perform the regridding and coadding. In this case, the Surf format was chosen to simulate the output of the flatfield task (the HISTORY component of the NDF was updated to reflect this).

The required stages are:

(1)
Read in the import data file.
(2)
Create output NDF.
(3)
Convert data array to a 2-d array of dimensions (N_BOLS × N_SAMPLES). Also create Variance and Quality arrays.
(4)
Write AXIS information. This is simply bolometer number for the X axis and integration number for the Y axis.
(5)
Create the SCUCD, SCUBA and REDS extensions.
(6)
Construct the DEM_PNTR array.
(7)
Construct the LST_STRT array.
(8)
Store the jiggle patterns in JIGL_X and JIGL_Y.
(9)
Construct BOL_CHAN and BOL_ADC arrays.
(10)
Store the flatfield information (essentially for the X and Y offsets of each bolometer). This is done by reading in a flatfield file using SCULIB_READBOLS.
(11)
Create FITS header (see table 1 for required keywords for jiggle map).
(12)
Write fake history information to convince Surf that reduce_switch and flatfield have been run on the file.
(13)
Shut down.