Presentation is everything |
|
program names, file names
variable names
prompts, commands, program code
Let's say that you have reduced a set of images such that you have a
tessellated, flux-calibrated image that you want to show to the boss. It's
a good idea to include in the image some information regarding the physical
scale, the intensity scaling, orientation, etc. You may want to
crop out a portion of your image which just shows the object of the
observation -- this can be done using v. When displaying single images, I like to use
the inverted Stern Special colormap, as it has a good
dynamic range:
IDLprompt> loadct, 15 IDLprompt> revvid |
In this example, the box from running v is
somewhat small, with dimensions of 48x47, so I'll display
it with a magnification of 8 in order to make it large
enough to take up a fair chunk of the display window. The image is
flux-calibrated, and I'll display it to scale the intensity between
0 and 7.5 mJy. I'll set the o keyword to put the image in north-up, east-left
orientation (that's just the way it worked out for this particular
observing run -- setting o won't always put the
image in the proper orientation). And I'll set the sam keyword to smoothe out the image:
IDLprompt> v, imagebox, 8, min = 0, max = .0075, /sam, /c, /o |
IDLprompt> ne_arrows, 100, 400, 40, charsize = 20, linethickness = 3 |
IDLprompt> plots, 150 + [ 0 , 184 ], 440 + [ 0 , 0 ], thick = 3, /device |
The scalebar procedure is used to draw an
intensity scale bar. Its parameters determine the display coordinates of
the lower-lefthand corner of the scale bar, the length (in pixels) of the
bar, and what kind of (if any) labels are drawn at the ends of the bar (I
usually don't let scalebar write any labels -- I
do that myself: that's next):
IDLprompt> scalebar, 420, 150, /nolabels, scalelen = 200 |
Finally, we'd like to add some text annotation to give meaning to the
intensity and the spatial scalebars. First we should set the font to
something readable -- this is done by some magic:
IDLprompt> !p.font = 1 IDLprompt> device, set_character_size = [20,20] |
IDLprompt> xyouts, 150, 445, '5"', /device IDLprompt> xyouts, 427, 120, '0', /device IDLprompt> xyouts, 415, 370, '7.5', /device IDLprompt> xyouts, 380, 400, 'FD / mJy', /device |
The result of these efforts looks like the following, and is suitable for
saving via a screen capture (/applic/nir/bin/xv is good for this):
Incidentally, the coordinates used for the various components of the above
annotations were determined by trial and error. The only loose end is the
current state of the font in IDL -- we altered it to produce the large text
for the annotations. We can restore the environment to a default state
with a call to the envres procedure:
IDLprompt> envres |
Sometimes you want to be able to simultaneously look at two images of an
object, (eg., two images at two different wavelengths). For
example, the following two images of AFGL 2688 (at 2122 nm and at 3290 nm),
both of which have the same size, magnification, and registration, are very
different in appearance:
In this example, we're going to display the 2122 nm data as a grayscale
image (as in the above left image) with contours from the 3290 nm data
superposed. The first step is to display the 2122 nm image, which in this
case is a 101x101 array, so we'll display it with a
magnification factor of 5, and with an appropriate set of
display parameters:
IDLprompt> v, im2122, 5, min = 0.5, max = 3, /c, /sam |
IDLprompt> contour, im3290, ticklen=0, /device, xstyle=1, ystyle=1, $ IDLprompt> pos=[0,0,504,504], levels=[0.75,1.25,1.75], /noerase, color=0 |
At this point you could also run a series of commands from the previous section to annotate the image.
Making a three-color image is arguably the best (and perhaps the only
practical) way of simultaneously displaying three different images. For
example, let's say that we wanted to display the following three images of
the reflection nebula GY 221 (J-, H-, and K-broadband images, from left to
right below):
For this to work properly, the three images all need to have the same dimensions, the same magnification, and the same dimensions. We'll further assume that the three images are called K_red, H_green, J_blue. These are 2-D images, NOT impacks.
Next we need to determine viewing parameters for each individual image. This is done simply enough by using v to find the set of min and max keyword values that best display each image. Let's say that we find min=0 and max=3x10-5 to work well for K_red and H_green, and that min=-1x10-6 and max=5x10-5 work well for J_blue. We then edit the file ~/idlpro/twrc.txt to look like the following:
min, max values for red plane: 0 3e-5 min, max values for green plane: 0 3e-5 min, max values for blue plane: -1e-6 5e-6
To actually make the TIFF image, we run the tiffwriter procedure, giving it the three planes and
the name we want the created TIFF file to have:
IDLprompt> tiffwriter, '3color.tiff', red=K_red, green=H_green, blue=J_blue, /o |
You can also use tiffwriter to make two-color images (or even a one-color image) by supplying image planes to only two (one) of the red, green, and blue keywords. See tiffwriter's documentation for details.