Initialise Modules, Read Plan/Parameter Files
Foreach filter {
Read 2D (Nframes x Ncolumns) bias structure from idB*.fit file
Read data quartiles for all frames from scFang*.fit files
Calculate bias drift, flat-field and sky for all frames
Foreach frame {
Smooth and interpolate bias drift, flat-field and (sky)
Write flat-field to file psFF*.fit
}
Cleanup
}
Initialise Modules, Read Plan/Parameter Files
Foreach filter {
Determine mean (over all frames) gains and dark variances
}
Retrieve information on 200x200 stamps
Foreach filter {
Foreach frame {
Read the flat-field vector (from a psFF*.fit file)
Read 65x65 stamps (from a scFang*.fit file)
Extract profiles for 65x65 stamps
If available { Read 200x200 stamps
Extract profiles for 200x200 stamps
}
}
Reject objects with any of individual flags set on
}
/* these two loops over filters are separated beacuse the above is
coded at Tcl level, and the following one in C */
Foreach filter {
Foreach frame {
Form a subsample of objects
Clip the subsample on the deviation from a median in each cell
Clip the subsample on the extracted profile shape
Clip the subsample on the extracted profile size
Clip the subsample by using a best-fit model PSF
Clip the subsample until it is uniform
Determine the mean PSF profile and the best-fit model PSF
Determine composite profile
Add bright objects' profiles to the composite profile
Calculate photometric corrections (aperture corrrection etc.)
}
}
Cleanup
Read astrometric transformation coefficients for each frame and filter
(from asTrans*.fit file)
Calculate time and airmass for each frame and filter
(by using information from scFang*.fit files headers)
Read zero points, extinction coefficients and color terms for each filter
(from exPhotom*.par file)
Read positions and magnitudes (in each filter) of objects detected in the MT pipeline
(from kaCalObj*.fit files, aka patch files)
Read color terms for each filter from psParam.par file
(to be used in log(flux20) = a + color_term * color_index)
Read counts in each filter for a 20th mag object
(from an old calibration file, psCT*.fit)
Setup extinction arrays for interpolation
(extinction coefficient as a function of time and color)
Foreach frame {
If No MT patches
Use old calibration(time) from psCT*.fit
Else {
Foreach patch file {
Match PS stars with MT stars
Determine calibration(time) for this patch file
}
}
Interpolate calibration(time) to each frame
}
Please send any comments or suggestions to Zeljko Ivezic