Data Assembly

Data taken by irs are stored directly into the repository. Typically you will take one frame that way to get the full header information from the telescope. Then (or before), you will take a sequence, as described in the IRTC section. Depending on the stability of the night, it is worthwhile to collect 15-30 seconds worth of data to average out atmospheric distortions. A reasonable exposure time is 2 seconds in H to limit the background signal, so a sequence of exposures is required.

Data Preparation

EF is fairly picky about the data format and quality, so it is worth spending some time preparing the pupil images for ingest into EF. The following is for IRAF users. To create an average of the single image and the sequence, first you must edit an @file (with a name like 'intrafiles'). To strip off each image of the data cube, each line of the file has a format 'intra_0020_cube[*,*,8]', where the last number is the frame number in the sequence. Use imcombine in average mode, with input being irtc2_2008mmdd.hhmmss.fits, @intrafiles. Taking the images in that order assigns the full image header to the output file. Do the same for the extrafocal single + sequence, and for the sky exposures. Then subtract the average sky from each of the averaged pupil images. For a pupil of ~100 pixels in diameter, it is worth cutting a square around the pupil center (e.g., imcopy extrasub[33:233, 39:239] extrafinal) with an image size of 200x200 pixels (OK, 201) centered on the pupil. EF is particularly finicky about the background (as of this writing, the flares from bad seeing made EF crash on the background subtraction). To make the background as uniform and close to zero as possible, run imsurfit on the final square, with xorder and yorder=1 legendre polynomials. Make the residual output image, setting the upper and lower limits to 2. Use a border region with width 20 pixels.

EF uses the header parameter "FOCUS" to determine the size of the pupil in the two out-of-focus images. The IRTC does not have the hexapod focus information available, so the fits images it writes do not have this "FOCUS" parameter. You can either add this header parameter while processing the images with IRAF, or there is an IDL routine available to add a header parameter. To run this routine, follow the instructions for setting up and starting IDL listed below to rotate Zernikes and send them to the PSF. Once you have IDL running and have ran @wfsc_init give the following command:

IDL> fits_add_focus, '0.6', image, header
              This will pop-up a gui to choose an input and output file
You will only need to put the appropriate value of focus in place of the '0.6' above.

Run EF

On EFComputer (currently immediately to the right of Ptolemy, the big monitor), login as LBTO with the usual mountain password. At the Linux prompt, type ef, and you will get the EF working window with two display panes. To change a value in a text box, use left arrow to move the cursor to the left of the character to be changed, then the delete key, then type the new value. The default parameters seem to work. Click Displays, and choose 'Show Zernike Graph' and 'Show Zernike Table'.

You're now ready to ingest the pupil image files. Push the Open button in the bottom tool bar. In the Directory box, type /Repository/EF (for example). For Image 1, choose your intrafocal pupil by double clicking on the filename. Your image will appear in the left-hand pane, and the filename and image center coordinates will appear in the Image Parameters box. Push the button for Image 2, and double click on the extrafocal pupil image. The other image and filename will similarly appear. You can then dismiss this box. If you try to change the filter choice from G to R or try to push the '+' button at the lower right, you will crash the program and need to start over.

Push the Go button under the images. It will automatically calculate and iterate on the Zernike solutions. If you want additional iterations, then click on Reduce, and choose 'Run Reduction Manually'. Push the Iterate button to execute the two iterations that you chose. If the solution looks stable after a couple of pairs of iterations, it has been successful. To save the Zernike coefficients, click File and Save Zernikes. The popup box gives you a chance to type the directory (/Repository/EF), an output file name, the Zernike coefficients you wish to save (4 to 11), then push Save.

Rotate the Coordinate System and Send the Zernikes to PSF

After creating the text file in EF format with the Zernike coefficients, it must be converted to a PSF-readable format, and (probably) rotated to match the native coordinate system on the primary. For that purpose, there is a series of IDL routines created by Doug Miller that can be run on lbtmu03 or lbtmu05. To setup the account, type at a prompt

=> login to lbtmu03 or 05 as LBTO
        These computers are needed because they have the IIF libraries installed that are need to send zernikes to PSF

% cd
      You need to be in the LBTO home directory
% source idl_setup
      This will print out some information on how to start IDL, and sets up pointers to the appropriate user routines.

To operate on some real data:

% cd /Repository/EF
% idl
IDL> @wfsc_init
               This will compile the routines and print out comments with templates that can be cut and pasted onto the command lines.
IDL> ef_apply_zernikes, zernikes, zernikes_rotated, filename  
              This will pop-up several question boxes for reading files, displaying images and rotating zernikes.
              Note: You will be prompted at the command line to input rotation in degrees.  Finally you will be asked
                     if you want to send the Rotated Zernikes.

-- JohnHill - 15 Apr 2008
Topic revision: r7 - 16 Apr 2008, DougMiller
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback