Continuum subtraction |
|
program names, file names
variable names
prompts, commands, program code
This section is appropriate only for narrow-band data, not for broadband data. If you have narrow-band data, you probably have three impacks at this point: the lower continuum wavelenth, the line wavelength, and the upper continuum wavelength. What we need to do now is to use the two continuum emission images to interpolate the spatial distribution and intensity of the continuum emission at the line wavelength. The "line" emission image is actually line+continuum emission, so we need to subtract from that the continuum emission. The result will be just line emission.
A couple of complications to the continuum subtraction are that, in
general, the registration and magnification of the three wavelengths don't
match. You'll need to know the platescale of the three wavelengths.
Platescale is measured at the telescope by taking images of a starpair at
many different wavelengths. The actual separation in arcseconds between
the stars won't change, but the separation in pixels will vary with
wavelength. The platescale v. wavelength curve is fairly
steep for wavelengths less than two microns, but it levels out after two
microns. Here's an example from the oct99wiro observing
run:
If the platescales of your three images vary significantly with wavelength,
you will need to remagnify the images to the same platescale. I suggest
that you remagnify the continuum emission images, and leave the
line+continuum emission image at its original platescale. If you don't
know the platescales of your images (eg., if the boneheads at the
telescope only measured platescale at the line wavelength, even though it's
in the steep portion of the platescale v. wavelength curve), and if you
have at least two point sources in each image, you can determine the
relative platescales, which is good enough for determining the
magnification factors you'll need to remagnify the images. For example,
let's say you want to continuum-subtract data taken at 1644 nm, and your
continuum emission images were taken at wavelengths of 1550 and 1780 nm.
Let's also pretend that you only know the platescale at 1644 nm, and that
your data images look something like the following:
The remag procedure is used to actually perform the remagnification:
IDLprompt> remag, inthing, outthing, magfac |
IDLprompt> remag, inthing, outthing, xmagfac, ymagfac |
An important thing to know about remag is that it conserves flux. As the algorithm makes a new image from the original, it rescales the pixel values in such a way as to not affect the calibration. Regretably, the remag procedure runs rather slowly, because, like nsigma and dist_astro, it must remap the image one pixel at a time. This is an unfortunate side effect of the algorithm's flux-conserving nature.
After using remag, the image will have a new magnification. As a result, the new image will have dimensions different from that of the original image. Also, remagnified images characteristically have a faint gridwork structure to them--this is annoying, but not unusual. It's a natural consequence of this kind of algorithm, which blurs pixels when shifting them. Some pixels are moved by nearly integer amounts, and are less blurred---this is what creates the gridwork pattern.
After remagnifying, the images in your impacks are probably of different sizes. This is going to be trouble. Before we do the continuum subtraction, we need all three images to be the same size. We can use the resize procedure to do this:
IDLprompt> resize, imapackname, newxdim, newydim |
A word of caution: resize alters the image you give it. If the new dimensions are larger than the original dimensions (ie., an enlargement), resize just makes the image bigger, and the pixels in the extra space all have values of zero---no big deal. However, if you specify either new dimension to be smaller than the corresponding original dimension, everything past the original dimension is cropped out and discarded. For this reason, it's a good idea to see which of the three images (lower continuum, line+continuum, and upper continuum) is largest, and then use resize to enlarge the other two.
Now that the images have the same platescales and sizes, we need to see to the registration---we need to align the three images just as we aligned our original data images before tessellating. Do it the same way, but you should probably use the line+continuum emission image as the anchor image. Once you've figured out the shift parameters for the continuum emission images, you're almost ready to do the continuum subtraction. You need to make a three-element vector which has the wavelengths of the three images (referring to the example mentioned above, these three wavelengths would be 1550, 1644, and 1780 nm):
IDLprompt> lambda_arr = [1550., 1644., 1780.] |
IDLprompt> linecsimpack = contsub( shiftxy( lcimpack , lcdx , lcdy ) , $ IDLprompt> lineimpack , shiftxy( ucimpack , ucdx , ucdy ) , lambda_arr ) |
Another feature of contsub is that it can be used to perform the calibration, if that hasn't already happened. If the images aren't already calibrated, then you MUST calibrate during or before the continuum subtraction. If you know the calibration factors (see the chapter on flux calibration), and if the images aren't already calibrated (ie., if the pixels still have units of ADUs, rather than Janskys), then make a three-element array which has the three calibration factors (in order of increasing wavelength). Then include this array as the value of the keyword calib in the call to contsub:
IDLprompt> linecsimpack = contsub( shiftxy( lcimpack , lcdx , lcdy ) , $ IDLprompt> lineimpack , shiftxy( ucimpack , ucdx , ucdy ) , lambda_arr , $ IDLprompt> calib = calib_arr ) |
Incidentally, the second positional parameter of contsub can also be an image (rather than an impack). In this case the result is also an image.