Tutorial: how to examine HDI images on emerald

Michael Richmond
Jan 15, 2017

The images created by HDI have a somewhat complex structure, so that some software packages may not open them properly, or show only a fraction of the entire image. This short guide shows one way to display and interact with HDI images on the computer emerald in the WIYN 0.9-m control room. There are many other ways, of course.

So, let's begin. After logging into the computer, you'll see a desktop like this (click on the image below, and other images in this tutorial, for a full-sized version):

  1. Double-click on the Terminal icon at lower left. A 'Terminal' window will pop up.
  2. In this Terminal window, type
    
            xgterm & 
    
        
    to create second terminal-like window. This one has the special ability to generate its own graphics when needed.


    Click on the image above for a full-size version

  3. In the xgterm window, type
    
            cl 
    
        
    to start running IRAF.
  4. After IRAF has started in the xgterm window, move to the directory containing all your data, using the cd command. In my case, I typed
    
            cd /data/data1/rit/20170144  
    
        
  5. We'll need a special image-display window to show the images. Double-click on the 'ds9' icon at the lower-left corner of desktop to start ds9 (version 6.2 -- there may be some issues with more recent versions)


    Click on the image above for a full-size version

  6. Now comes the tricky part. Suppose that we want to examine an HDI image called c7768t0025f00.fits. One way to do this involves two steps: first, we'll convert this raw image into a format that IRAF understands better, and then we'll display and interact with that simpler version.

    It's possible to use a unique name for the simplified version of every image, but I find it convenient to keep re-using one short name; I just delete the simplified version when I'm done with it. Again, this is just one way to work with data -- there are many others.

    In the xgterm window which is running IRAF, issue the rfits command to create a simplified image file called foo.

    
            rfits c7768t0025f00.fits 1 foo
    
        

    (The second argument, '1', tells IRAF to look in header-data unit number 1 in the HDI file to find the data. If you are operating HDI in 1-amplifier mode, that contains all the pixel data. If you are operating in 4-amplifier mode, this would only read pixel data for the first amplifier)

  7. Next, display this simplified version in the ds9 window by typing the IRAF command
    
            display foo 1 
    
        

    (The second argument, '1', in this case means that ds9 should place the data into its memory buffer number 1. It is possible to read images into different buffers and then blink them or show them side-by-side)


    Click on the image above for a full-size version

  8. If you wish to measure the properties of the image -- for example, computing the mean within some small region, or measuring the FWHM of a feature -- you can issue the IRAF command
    
            imexam
    
        

    The cursor will turn into a blinking black donut in the ds9 window. At this point, you have many options. I often want to examine the properties of a star, so I'll move the cursor to the star and press the r key, which pops up a new graphics window, inside of which is a radial profile:


    Click on the image above for a full-size version

  9. When you have finished examining the image, you can quit the 'imexam' command by typing
    
            q
    
        

    The cursor should return to its normal size and shape.

  10. Now, if you want to display and play with another image, and you're following my method, you'll need to delete the simplified version of the image you created with rfits a few moments ago. Don't worry -- the original HDI image will not disappear! Inside the xgterm window running IRAF, type
    
            imdel foo
    
        
  11. To examine other images, go to step 6 and repeat.