We use so-called `self-flat' approach - as mentioned earlier, sky is much brighter than the object and it should illuminate the array sufficiently and uniformly (ideal for flat!). CAUTION: this approach can only be used for those data taken with on-chip chopping. Even thought it is buried in the sky and invisible, there is an object somewhere in the frame, so that position (where the object is) is not flat. Therefore, we have to produce two flat frames: one with beamA (used to flat the object position at beamB) and the other with beamB (for beamA). ______________ ______________ ______________ | | | | | | (A-B) | A | - | B | = | A B | |____________| |____________| |____________| ______________ | | flatA | A | |____________| ______________ | | flatA treated file = (A-B)/flatA | x B | |____________| ______________ | | flatB | B | |____________| ______________ | | flatB treated file = (A-B)/flatB | A x | |____________| To produce a flat frame, you also need a dark frame. Here are the steps you should follow. 1. Dark frame construction a. Look for a dark COMA file taken using the same clock pattern used to take the object frame. The FITS keywords to look for are: Q_PIXTIM (frame rate) Q_RRSTRT (ND) Q_YSTRT (starting Y-axis row) NAXIS2 (number of rows) b. Slice the 4-D COMA file into a bunch of 2-D frames using e.g. imslice in IRAF. c. Average these 2-D dark frames using e.g. imcombine in IRAF. d. Divide this average frame by Q_CHEB (number of co-adds at one beam position) so that we would be dealing with one exposure only. This is our dark frame (DARK). 2. Flat frame construction a. As in 1b, slice up the object COMA file. A1B1A2B2A3B3... -> A1,B1,A2,B2,... b. As in 1d, divide each 2-D frame by Q_CHEB of these frames (may be different from that of the dark frame). c. Subtract the DARK constructed in 1d from each of these frames. d. Separate each beam. e. Make median frames from these two set of frames. i.e. a median from (A1, A2, A3,...) -> medianA a median from (B1, B2, B3,...) -> medianB f. Normalise them. normalise(medianA) -> flatA normalise(medianB) -> flatB These are the flat frames, and as mentioned above, each frame will be used to flatten essentially a half of a frame.