Wavefront sensing with WFCAM

Wavefront sensing with WFCAM

For more details on wavefront sensing itself, see the Wavefront sensing pages. This page walks you through taking, analyzing and implementing wavefront sensing data taken with WFCAM and much is taken from the relevant wiki page.


Taking the wavefront sensing data

  • Run up WFCAM and the OCS as normal.
  • Send a WFCAM observation, e.g. the array tests or wfcam darks, to the sequence console from the queue monitor but don’t run the sequence, instead hit the stop ASAP button. Do not hit the “finished” button – you want the sequence to remain in the window, so that the console remains connected to the telescope.
  • From the “File” menu select “Load…” and open WFS_QA_WFCAM.exec.
  • Run the sequence. This will slew the telescope to various HAs and Decs. The telescope will not track and the dome will not follow in HA / Dec coordinates. This is normal. When the telescope is sent to a CMC star the coordinate system will change and the telescope and dome will start tracking.
  • After the slew to each position find a nearby 7.5th mag A star and slew to this star. The cmc_a command will give only A type CMC stars which should be centred on the guider (do not search for the star while the telescope is slewing). You will need to choose “Tel” rather than “Next” otherwise the telescope will not slew. Hit continue to take data – the sequence will automatically offset the star onto the appropriate array (currently camera 1 or W).
  • Continue the sequence until all 60 positions have been observed (about 3 hours in total).
  • The final command in the sequence will set the focus back to zero. If this is not done you must do it manually before starting regular observing otherwise the WFCAM focus mechanism will hit the limits.

Important points to note:

  1. 7.5 mag stars are preferred. Brighter than 7.0 or fainter than 8.5 are no good.
  2. Please make sure the CMC star is centered on the guider before continuing the sequence. It doesn’t have to be perfect but it must be reasonably well centred.
  3. It is EXTREMELY IMPORTANT that a continuous series of frames are obtained, and that a PAIR of frames is observed at each position, even if one of the frames is bad for some reason. The scripts below are not clever enough to cope with extra frames; however, bad data point are weeded out when we examine the plots and fits, so these aren’t a problem. If you do take a bad frame (wrong star, whatever), DON’T REPEAT IT. Just take a second bad frame and move on to the next position.
  4. Please mention the start and end frame in shift comments.

Reducing the wavefront sensing data

  • Just run ORAC-DR as usual, the frames will be reduced using the SUBTRACT_DARK recipe.

Preparing the wavefront sensing data for analysis.

  • Log onto Kauwa as curve. You now need to create a directory with plenty of space, and although it doesn’t matter where the data go, recent wavefront sensing data have been going to /ukirtdata/temp_data/curve2/<utdate>. Go to the new directoy.
  • Type wfcam_wfs and answer the following prompts:
  1. Which camera’s data to reduce (i.e., w, x, y or z – will probably be w)
  2. The UT date
  3. The filter used for the WFS run (usually H but could be K)
  4. The first frame number to reduce
  5. The last frame number to reduce
  6. A name for the final output Zernikes file (e.g., mar05_cameraw.zer)
  7. Whether you need to copy the data to the current directory (this will be necessary unless you’ve already copied the data over)
    • The directory containing the data if the answer to the above is yes (please include the final “/”)
  8. Whether you need to select an out-of-focus star (currently, due to a bug, you should also answer “y” to this)
    • If the answer to the above is yes, a Gaia session will display the first frame. Use “pick object” to select the centre of the out-of-focus target and hit “save/append”. THE STAR SHOULD BE NEAR PIXEL 765,1300. Pick object will not centroid on the out-of-focus image, but this is not necessary; it will give the approximate x,y position of the centre of the target.
  9. Hit <return> to continue.
  10. Processing ends when it starts to display plots of the zernikes. Hit return whenever it prompts you.
  • The script will take a few minutes to process the data and it will create a few output .dat files which you need for the analysis. First, create a directory to work in in curve’s own area, e.g., mkdir /home/curve/results/18sep2008 and then cp *.dat /home/curve/results/18sep2008 and finally cd to that new directory.

Analyzing the data with T-point

See the Cassegrain Reducing the Wavefront Sensing Observations for more details on running T-point.

  • In the /home/curve/results/<date> directory, type t_prep and then tpoint
  • Type inpro ../procs.dat
  • Type call xw                              (this opens a display device)
  • Type indat astig.dat         (this loads the astigmatism data file)
  • Type mask 1                                  (this masks the first point which is not used in the analysis)
  • Type slist                                     (lists all the points and astigmatism parameters)
  • Type gmap                                        (plots the data and allows you to see the magnitude of the astigmatism across the sky)
  • Type call w9                                (plots the astigmatism errors with respect to HA and dec)

At this point you fit various parameters listed in the table below in an attempt to minimise the errors. Keep the parameters that make a significant different and lose those that dont. For instance:

* use ch
* fit

       coeff       change     value    sigma

  1     CH       -115.625   -115.62   63.993

Sky RMS = 483.14
Popn SD = 487.43

* use hxsh
* fit

       coeff       change     value    sigma

  1     CH         +0.593   -115.03   63.923
  2     HXSH      +47.940    +47.94  121.158

Sky RMS = 482.48
Popn SD = 491.17

* lose hxsh
* use hxch
* fit

       coeff       change     value    sigma

  1     CH      -1169.819  -1284.85  297.369
  2     HXCH    +1401.913  +1401.91  350.055

Sky RMS = 426.53
Popn SD = 434.22

* use hxsd
* fit

       coeff       change     value    sigma

  1     CH       +228.501  -1056.35  310.879
  2     HXCH     -204.145  +1197.77  354.970
  3     HXSD     -244.198   -244.20  123.209

Sky RMS = 412.54
Popn SD = 423.84

* use hxcd
* fit

       coeff       change     value    sigma

  1     CH        -95.480  -1151.83  546.876
  2     HXCH       +9.964  +1207.73  358.995
  3     HXSD      +23.549   -220.65  165.461
  4     HXCD      +97.544    +97.54  452.609

Sky RMS = 412.37
Popn SD = 427.64

* lose hxcd
* fit

       coeff       change     value    sigma

  1     CH        +96.630  -1055.20  310.967
  2     HXCH      -11.234  +1196.50  355.053
  3     HXSD      -23.726   -244.37  123.198

Sky RMS = 412.54
Popn SD = 423.84

In other words, parameters with a value that are about the same or smaller than the sigma should not be used in the fit. All the parametsr for astigmatism should be tried and at any time you can plot the data with gmap or call w9 to visualise the fits.

AberrationIn Telescope look-up tableIn T-PointIn Telescope look-up tableIn T-Point
AstigmatismIZ5CHIZ6ID
 HZ5SHHXSHHZ6SHHDSH
 HZ5CHHXCHHZ6CHHDCH
 HZ5SDHXSDHZ6SDHDSD
 HZ5CDHXCDHZ6CDHDCD
Coma*Z7CHZ8ID
TrefoilIZ9CHIZ10ID
 HZ9SHHXSHHZ10SHHDSH
 HZ9CHHXCHHZ10CHHDCH
 HZ9SDHXSDHZ10SDHDSD
 HZ9CDHXCDHZ10CDHDCD
Spherical**Z11CHZ22 (not in look-up table)ID

When satisfied with the fit save the final fit values to a file. At this point in Cassegrain operation you would now repeat the process with the trafoil data (tref.dat) but this does not appear to be necessary with WFCAM. The only other aberration you need to fir for WFCAM operations is spherical (spher.dat) and in this case only one zernike is used, CH, so this is easy. Save the output for the spherical aberration fit as well and exit from T-point.


Making the changes

The results of the fits to the astigmatism and spherical aberration now should be applied to the telescope look-up table. You also need to refer to the table above again.

  • cd /jac_sw/itsroot/install/configs/
  • edit the primary_wfcam.cfg file
  • change the values of the parameters in this file by the “value” number from the T-point fits. For example, if IZ5 (CH) is currently set to +1000 in the look-up table, the example shown up means that you have to subtract 1055 from this number, so the new value would be -55. Note that the spherical aberration (Z11, CH)  must not be greater than +300.
  • Save the file and to upload the new setting, type pvload primary_wfcam.cfg
  • Finally, the file must be committed to CVS by typing cvs commit -m “add a comment here” primary_wfcam.cfg

Dealing with coma

Unlike Cassegrain operations coma is not corrected for by using T-point but by looking at the data output from the wfcam_wfs script.

E-W coma (Z7)

  • Go back to the directory where the WFS data were originally reduced using the wfcam_wfs script (e.g., /ukirtdata/temp_data/curve2/<tudate>.
  • Check that the file coma _z7.sdf is there
  • Type figaro followed by ascout coma_z7 coma_z7.dat
  • Edit coma_z7.dat and delete the first few lines of text leaving only the two columns of numbers.
  • Now the tedious part. The first column in the coma_z7.dat file needs to be changed to HA rather than frame number. This doesn’t need to be exact though. Change the first five numbers to -4. Change the next six to -3. Change the next seven to -2. Change the next eight to -1. Change the next eight to 0. Change the next eight to 1. Change the next seven to 2. Change the next six to 3 and finally the last five to 4.
  • Open the file using Excel, plot the data as a scatter graph and fit a straight line to the data and display the equation of the fit (y = mx + c, obviously).
  • Determine the gradient (m) and using the equation delta_Z7 = 0.198 –  (m + 0.004) / 0.0202 to calculate the change needed to the current Z7 value.
  • cd /jac_sw/itsroot/install/configs/
  • Edit the secondary_wfcam.cfg file and change the mcu:hex:x0_tran:k1 parameter by adding or subtracting the calculated delta Z7 number. Save the file and pvload it. Commit to CVS if you are not progressing to the next step, the N-S coma (Z8).

N-S coma (Z8)

  • Go back to the directory where the WFS data were originally reduced using the wfcam_wfs script (e.g., /ukirtdata/temp_data/curve2/<tudate>.
  • Check that the file coma _z8.sdf is there
  • Type figaro followed by ascout coma_z8 coma_z8.dat
  • Edit coma_z8.dat and delete the first few lines of text leaving only the two columns of numbers.
  • Delete the first 26 lines of numbers, retain the next 8 and then delete the last 26 lines.
  • Replace the frame numbers in the first column with -40, -30, -15, 0, 15, 30, 45, and finally 60.
  • Open the file using Excel, plot the data as a scatter graph and fit a straight line to the data and display the equation of the fit (y = mx + c, obviously).
  • Determine the gradient (m) and using the equation delta_Z8 = 1.061 – (m – 0.0035) / -0.0033 to calculate the change needed to the current Z8 value.
  • cd /jac_sw/itsroot/install/configs/
  • Edit the secondary_wfcam.cfg file and change the mcu:hex:y1_tran:k1 parameter by adding or subtracting the calculated delta Z8 number. Save the file and pvload it. Commit to CVS.