-
Notifications
You must be signed in to change notification settings - Fork 0
COMICS Imaging Reduction
COMICS Imaging Reduction
There are two key differences for COMICS image reduction compared to standard processes (e.g., MIRSI):
-
Flat fields are taken by coadding lots of B-frames (sky only) at the local airmass, AFTER you take them and remove the low-level variability over the frame using a Gaussian smoothing function with a FWHM that we suggest should be around 10 pixels.
-
Dark-frame contributions are removed by subtracting the radiances of the darks that are taken at the end of the night. You just have to match the detailed integration time with the observation. For Jupiter or Saturn, the dark counts are virtually negligible. Less so for Uranus or Neptune.
The COMICS imaging data comes in a slightly different format to that of MIRSI or VISIR, and so some modifications are required in the processing stages. The images are contained in COMA*.gz files, which contain multiple exposures of both the target (A frame) and sky (B frame). The B-frames must be separated out and used to create a flat.
1. Pre-processing:
- Separate the A and B frames and write out the files into a raw/ directory. Use /prvt/kevin1/IDL/convert_coma2ab.pro, entering the path to the rrawa files. The script requires that a raw/ directory has already been created.
- In DRM, use Programs -> Preprocess -> All Selected to process the files into the wavelength/target directory structure and add the appropriate key words to the FITS header.
2. Generate the Flat:
COMICS images generally have a pockmarked appearance which can be removed by treating the sky images as our flat.
- Within a given wavelength directory, select all of the B frames. -Edit->Expressions->multiply all selected by image tool zero, where you change _a(0) to _x(#) where the # is the number of the bad pixel mask.
- Programs -> Coadd without Bad Pixels Use Primary as Bad Pixel Mask: No. Use initial offsets: No Alignment Method: No alignment Done. -> Opens the flat in a(0).
- Programs -> Despike (no mask). Do this once or twice, but make sure you're not eliminating any features.
- The COMICS optics are shifted so that the left and bottom of the array appear black. We need to manually replace this with the mean value of the rest of the flat.
- Tools -> Pixel Access Tool. Use the cursor to find the pixel numbers for the left (X) and bottom (Y) edge. Replace with zeros by entering the general expressions 'image(0:X,)=0.0' and 'image(,0:Y)=0.0' and pressing enter. At the bottom of the screen, select to 'Replace the Zeros with Mean'. Finally, click on 'Normalize' and Save As -> flat_wavelength.gz.
Clear the selection window.
3. ABAB Subtraction:
- Get all of the A and B frames within a wavelength directory, select them all.
- Edit -> Expression -> ABAB Format Subtraction
- Select Updated (this should now display only the A frames).
4. Divide by the flat:
-
Get the flat you just created in the left column, noting the number of the file.
-
Edit -> Expression -> Divide all by image zero, changing x(0) to the x value of your flat. -> Done.
-
Despike the images again by Edit -> Expression -> Despike all selected -> OK. (Retain nsigma=5.0 for this purpose).
-
Save -> All Selected -> (1) No Prompt to save all of the A frames.
NOTE: Sometimes this division does not fully remove the pock-marking. If not, we sometimes try dividing by the flat to a different power (still close to 1.0) using Edit -> Expression -> 'a/(x_0)^n' where n=0.9-1.1 (maybe).
5. Create a Bad Pixel Mask:
- Select the first of the A frames and open it in Image Tool.
- Use Tools -> Pixel Access tool to set the left and bottom to zero again: 'image(0:X,)=0.0' and 'image(,0:Y)=0.0'. Now set the rest of the image to 1.0 using the expression 'n=where(image ne 0.0) & image(n) = 1.0' -> Done.
- Save As -> badpixelmask.gz
6. Coadd the Images:
The COMICS images may have a dithered sequence of 3-5 on a particular target on the planet. Sometimes, single images are good enough that they can be analysed independently, but on other occasions we need to select a subset of the images to coadd.
- Programs -> Coadd without bad pixels:
- Use primary as bad pixel mask: Yes. Ensure that the badpixelmask.gz file is in the left hand column and is identified as the primary file at the bottom of the screen.
- Toggle the 'Use initial offsets' to 'No'
- Alignment method: Astro Correlate. -> Done.
A second method of coaddition, if this doesn't produce good results, is more labour-intensive: assign geometry to every file, save them as j_xxxxx.fits.gz (where xxxxx is a file number for reference), then read them in and choose Programs -> Coadd without bad pixels using the 'Geometry' method.
IF we coadded, save the image tool window as jc_xxxxx.fits.gz. IF we didn't coadd, save as j_xxxxx.fits.gz
7. Filtering:
If image deconvolution via PIXON is not going to be applied, then do some fourier filtering to clean the image and remove white noise:
- Tools -> Fourier Filter Tool -> Apply Optimal -> Done.
- Save As -> jf_xxxxx.fits.gz.
Otherwise, skip this step, apply PIXON, and complete the remaining stages using the PIXONated images.
8. Geometrical Fitting: 9. Cylindrical Mapping: 10. Absolute Calibration: