ING Banner
Home > Astronomy > NAOMI > Mirror Flattening

NAOMI Mirror-Flattening

The recipes below described how to 'flatten' the NAOMI segmented deformable mirror for observing with a natural guide star. For troubleshooting and diagnostic procedures, see the troubleshooting guide.
The procedure is (slightly) different for LGS observing, see notes in the GLAS setup/observing recipe.

Contents:

Please send corrections to Chris Benn (crb@ing.iac.es) NAOMI corrects errors in the incoming wavefront by moving in piston, tip and tilt the individual segments of the deformable mirror (DM). The mirror must be flattened before observing begins, by configuring the individual elements so that the DM produces on the science detector an image of a focal-plane pinhole which is as near diffraction-limited as possible. This configuration is stored and can be recalled as a starting position whenever required. The configuration is not quite physically flat, because it also corrects for any wavefront errors not common to the wfs and science-detector light paths (non-common-path errors). The flattening procedure is described below, and a recipe is given in the following sections.

When NAOMI is first set up, this full procedure (spot alignment, white-light flat and simplex) is required. A simplex through broad-band H filter usually serves well for both J and K bands. From one afternoon to another, the mirror is fairly stable, and it probably suffices to re-simplex each afternoon from the previous day's simplex. The degradation of mirror shape during the night seems to be largely in tilt, and can be recovered by floating the Nasmyth bench and laser-flattening with z gain set to zero.

Several bizarre mirror-flattening problems have been traced to lack of spectral diversity. E.g. if the white-light flattening is carried out using light passed by a coloured dichroic (rather than a transparent plate), it usually fails. If a simplex is carried out through a narrow-band (rather than broad-band) filter, it can yield a 'split' mirror (some areas raised with respect to others, when compared to the broad-band simplex) and multiple images on the science camera. It's not yet clear whether mirror shape degrades faster when the mirror is in constant use (good weather) than when it's idle (dome closed).

Starting point
The starting point for the mirror-flattening process will usually be the previous night's best simplex, or a mid-ranged DM. The segments will have random tip, tilt and piston errors, as indicated schematically below (graphics by Paul Behrens):

Spot alignment on WFS
Type spotAlign to bring up the gui (careful with the case of the letters). This procedure (developed by Jure) centres the illumination spots on the cells in the WFS display, and leaves the individual mirror segments parallel, but with unknown piston position:

The procdedure usually takes less than one minute.

The spotAlign procedure supercedes the old laser-flattening procedure, in which: The DM is viewed in monochromatic light by the double-pass FISBA interferometer (light exits and returns through same lens, and is compared with the reference beam via a beam-splitter). The FISBA PC analyses the image, and adjusts the elements in tip-tilt and piston to minimise the number of fringes across each element. This leaves the mirror flat except for an n/2-wavelength ambiguity in piston positions. The manual tweaking takes ~ 10 minutes, the software procedure ~ 5 minutes.

White-light flattening
The white-light flat resolves the ambiguity in piston positions (z direction) left by the laser flat. The mirror is illuminated by white light emerging from the focal-plane pinhole. The system is first configured (using a lenslet array with a half-cell shift) such that each spot includes light from 2 DM elements adjacent in the Y direction, and alternate rows of the DM are stepped in piston (the intervening rows remain stationary) to allow the relative piston shifts between elements adjacent in Y to be determined. This step is then repeated in the orthogonal direction, with alternate columns of the DM then being stepped in piston.

This procedure yields a mirror which is close to being physically flat. The image of the pinhole on the science camera should now be nearly diffraction-limited, with some distortions due to defects in the alignment. The white light may not differ very much from the laser flat, particularly if the laser flattening was started from a previous white-light flat. In this case, most of the DAC values will be identical to those in the laser flat. The end product is a mirror which is physically flat (apart from some staircasing, see below):

This procedure takes about 15 minutes. Occasionally it's necessary to laser-flatten again to remove tip-tilt introduced by the white-light flattening.

Simplex optimisation
Non-common-path errors are fixed differences in the wavefront distortion between the WFS and science arms. They are removed by configuring the mirror to optimise the image of the pinhole on the science detector. In practice, this step also removes residual misalignments in NAOMI.

For each of 228 random configurations of the DM, the procedure measures the square of the intensity I^2 falling within a fixed aperture on the detector. These 228 configurations can be represented by 228 points in a 228-dimensional space (228 = 76 * 3). The point with the worst I^2 is selected, and its parameters reflected through the origin of this space. The I^2 for this is measured, i.e. one configuration is deleted, one added. This step is repeated several thousand times. This simplex algorithm (developed at CERN) is model-free, and assumes only that there is a minimum to be found.

After optimisation, the spots will no longer be on a regular grid on the WFS, but will still fall within the sub-apertures. These are now the positions to which the spots should be driven to achieve an optimum image with NAOMI, and the offsets from the centres of the cells on the WFS are recorded.

The non-common-path errors were formerly (ELECTRA) removed by adding zernike terms to the DM manually to optimse the PSF, but the simplex optimisation gives better results (the Zernike terms may need to be of very high order). The white-light flat is needed before simplex optimisation to avoid the latter getting stuck in a local minimum.
The compensation for non-common-path errors introduces small deviations from physical flatness:

Simplex optimisation takes a minimum of 20 minutes.

De-staircasing
There remains a staircase effect on the DM: the segments are all parallel, but there can be a smooth gradient in piston position across the mirror. This is invisible to the laser. It manifests itself on the science images as spots along a cross centred on the pinhole image, at the same positions as spots from the DM interference pattern, but *asymmetrically* distributed (e.g. all left or all up). The intensity of the spots is typically < 1% of peak intensity. The staircase is removed by tweaking the gradient of the DM in software while viewing the pinhole image on the science camera.
De-staircasing takes a few minutes.

Back to top of page

Below is a brief summary (not comprehensive) of the steps involved in carrying out the daytime checks and mirror-flattening. The procedures are described in detail below.

  • Power on fisba monitor, float bench, turn WHT oil pumps off (may not be necessary), check that all segments are present, tweak in any stray DM segments.
  • Laser-flatten: bring up gui, iterate. Record filename in logbook.
  • White-light flatten: make sure WFS spots are bright, AutoCentre, check WFS focus, AutoWhite, check solution is acceptable. Record filename in logbook.
  • Start simplex application with simplex, click on 'continuous display', make sure OASIS and simplex flats are in, set exposure time 0.015 sec, set lamp brightness, adjust window.
  • Check that filter focus value is optimised, usually around 3 mm (see the OASIS observing recipe for latest values)
  • Click on simplex, watch for improvements in MF and peak counts. Repeat simplex until acceptable MF achieved. Record filename in logbook.
  • Check the PSF on AG7 and on OASIS (remember to change the filter focus).
  • Laser-flatten again.
  • Remove staircase with stairx 20, stairy 20 etc. Record filename in logbook.
  1. Power on the fisba monitor above aodisplay, select button A on the monitor. You should now have a view of the DM segments. If the ADC is present, there will be vignetting upper right by the ADC. In addition, there is a near-circular patch of vignetting caused by damage when the NAOMI fold flat was cleaned 11/08. If the optical bench is down, the interference fringes on the individual segments will probably be washed out, and moving about a lot.
    The concentric rings arise in the interferometer itself, and are nothing to do with the DM.
    If the image is static, the fisba PC in GRACE probably needs rebooting.
  2. From the light-path gui, float the optical bench. It takes a few minutes to come up. When the bench is floating, interference fringes should be clear on at least some segments.
  3. If the telescope is not moving, and nobody is walking on the observing or Nasmyth platforms, the fringes should be fairly stable. If they are moving about a lot due to air currents within GRACE, e.g. more than ~ 1 fringe per sec on many segments, turn the the air-conditioning down to 20%, from the GRACE control panel on the left end of the control desk. Use the rightmost button ('escape') to get back to the top-level menu, select optics (second button from left selects), select knobs, select optics fan speed, set to 20% (use the double down arrow), select. Don't forget the final press of the `select' button. It takes about 1 min for air currents to settle in GRACE.
  4. From the topgui light-path gui page, load the last good mirror flat recorded in the NAOMI logbook (when you hit the LOAD button, it lists the recent files), OR, mid-range the DM from the (bottom of the) topgui mirror control page, whichever looks better (visible fringes on the most segments on the fisba monitor).
  5. If there are fringes visible on all segments, go to laser-flattening. If not, then:
    1. Open the SG loop from the topgui C40s page
    2. Go to the topgui mirror-control page, click on hysteresis (you should see on the fisba display the DM segments jiggle for a few sec), wait for the procedure to finish. Repeat this twice.
    3. Close the SG loop on the C40s page (NB *not* the AO loop, which is controlled using the open/close button on the left-hand page of topgui).
    4. Mid-range the DM from the topgui mirror-control page
  6. Finally, tweak the individual mirror segments individually in tip-tilt until fringes are visible on each one (on the fisba display):
    • Check that spots are visible on the WFS, i.e. that light from the pinhole is reaching the WFS CCD (see above). Each spot corresponds to one DM segment. Spots which are not centred in their boxes correspond to DM segments with large tip-tilt, i.e. fringes washed out. [Tip for experts: if a segment is a long way off and hard to find, use INGRID in movie mode, or AG7 unclipped, to locate it.]
    • On the topgui mirror-control page, click on the x-y-piston button. Then for each stray spot:
      1. Click on the corresponding segment on the DM map to select it (click on 'labels' under the WFS display to see the segment numbering).
      2. Centre the stray spot in its box, using the x and y arrow buttons on the topgui mirror-control page. Each spot should be well-enough centred that fringes are visible on the corresponding DM segment.
  7. Save the current configuration of the DM by clicking on the DM 'save' button on the topgui light-path gui page, record it in the logbook.
Back to top of page
  1. Bring up the fisba control and display guis (one control window, one display window) by clicking on the left-most icon at the top of top gui:


    In the above xv-captured copy of the fisba display, the image itself is not well reproduced, due to the 8-bit display used by the NAOMI applications. After work ~ end 2005 to install the dichroic changer, it was necessary to fold the fisba light path. The housing protecting the new fold mirror slightly vignettes the outer segments, and the boundary of the vignetted area is not quite circular - it has a scalloped appearance (why?).
  2. After work in GRACE which may have affected the optical path to the fisba, it's worth checking that the image is where the software expects it. Click on 'continuous display', check that the red crosses lie at the top left corners of each segment. If not, use the positioning buttons on the gui to adjust the crosses.
  3. The Z gain will be set to zero. Don't change it, otherwise the flattening procedure will move the segments in piston as well as tip-tilt.
  4. On the same gui, click on the 'iterate' button. The fisba analysis software now iterates (4 cycles of 4 phases) to minimise the number of fringes on each segment. If no iteration takes place, you probably need to reboot the fisba pc:
    • Go to the GRACE electronics room. On one of the shelves behind the door is the fisba PC display.
    • Restart the FISBA PC from the button bottom left of screen. It takes ~ 5 minutes. If it won't reoot satisfactorily, delete all windows, remove sessions on bar at the bottom of the display, double click on microshape icon. If it won't shut down, close from file button. If still no response, power-cycle the cpu.
    • Zoom display *3 when it comes up (menu button top-left of display).
    When the countdown reaches cycle = 0, phase = 0, the procedure has completed. The DM should now look flat on the fisba display, i.e. less than one fringe across each segment. If not, either tweak in bad segments by hand (see above), or repeat the laser-flattening.
  5. Save the current configuration of the DM (the 'laser flat') by clicking on the DM 'save' button on the topgui light-path gui page.
  6. Reset the GRACE air-conditioning to 100%, on the GRACE control panel at the left end of the control desk.
Back to top of page The white-light-flattening procedure removes piston shifts between the segments, and leaves the mirror close to physically flat.
  1. On the OBSTOOL gui, select observing mode = white light flat, and click on the configure button.
  2. The optical bench should be floated (it's OK if it's 'fixed', but you might need to raise it again if another laser-flattening is needed).
  3. The 2-micron pinhole should be in the simplex aperture in the NCU.
  4. On the light-path gui, switch on the simplex lamps, set the NAOMI simplex iris to -150.
  5. Load the last laser flat on the DM.
  6. Either the 50:50 (default) or IR dichroic can be used. The wavelength range (spectral diversity) of the other dichroics isn't sufficient for white-light interferometry [Tip for experts: dichroic 4 is probably OK].
  7. On the topgui light-path gui page, set the WFS exposure time to 50 msec. Spots should now be visible on the WFS display. With the WFS display max set to 2000, the spots should appear bright. The peak intensity should not exceed ~ 30000 (you can judge by ramping up the 'max' level set in the box bottom right of the display) to avoid saturation during the procedure.
  8. Check the focus at the WFS:
    • Autocentre (button on the scripts menu)
    • Click on the WFS icon on the top bar of topgui, to bring up the WFS page.
    • Click on the alignment button to bring up the alignment tool.
    • Calculate the mean separation D of the spots in X and Y by taking the mean of 'Sep X' and 'Sep Y'.
    • Calculate dD = 8.0 - D. If |dD| is more than 0.03 pixels, change the WFS fore-optics focus by DF = -10 * dD:
      • Click on mechanisms icon at the top of topgui, left click, WFS, click with right button on WFS components and select Pickoff mechanisms.
      • Change the foreoptics position (demand position = left-most box) to the calculated new value, hit return, click on move, click on start. If it says 'focussed', this means the position is 0.0.
      • Check the separation, repeat the procedure if needed.
  9. At the lpss42 prompt, type AutoWhite which automatically:
    • Requests integration time (select option 0 to use current integration time.
    • Puts in the y-shift lenslet. Each WFS spot now includes light from halves of two DM segments.
    • Steps alternate rows of the DM in 2 sequences of 120 steps, and records the brightness of each spot at each step. The step size is 50 DAC, and ranges from 1000 to 7000 DAC.
    • Puts in the x-shift and does the same. If using AutoWhiteRoy (*not* currently needed), you need to adjust slightly the rotation of the lenslet wheel after it reaches the nominal x-shift position:
      • Click on the Eng Guis button at the top of top gui, select Mechanisms DM.
      • Right click on 'NAOMI Systems' on the window that just appeared.
      • Right click on 'WFS components' on the window that just appeared.
      • Reset the camera stage value in the first column to be similar to the value in the last column, click on move, click on start.
      • Reset the lenslet-wheel value in the first column to 3.25, click on move, click on start.
      • Continue the AutoWhiteRoy procedure, by typing 'yes'.
    • Identifies the peak position in the 120-step white-light interferogram for each DM-segment pair, and solves for the relative piston positions of all segments.
    • Moves the DM segments in piston so that the mirror is physically flat.
    • Saves the flat with a name similar to that of the laser flat but ending in `.white'.
    • Loads this flat on the mirror.
    • Outputs to the screen several useful diagnostics, including the gradients and the number of successful measurements. Records these results in e.g. /home/naomi/WhiteLight/20051220/20051220-101010.result (type cdpeak to reach this directory).
  10. The number of measurements is typically 130. If it's less than the number of unknowns (typically ~ 70, the number of segment piston values to find), the white-light flat is useless, probably because of one of the following:
    1. The spots weren't bright enough.
    2. The wrong dichroic was used (not enough wavelength range).

    [Tip for experts: Type cdpeak to go to the current directory for the white-light results (NB the cdpeak alias is set up on opening a window, so the date used for the sub-directory is sometimes wrong). Type out the .peakH and .peakV files. If more than a few lines start with #, the interferometry has failed.]
  11. If the gradients measured by the wlflat procedure are > 200, the fisba flat mirror probably needs adjusting (contact an expert).
    [Tip for experts: alternatively, add tip or tilt using e.g. AddZernike tip -1 at the prompt, save flat, cdflat, plotflathist to view it, and iterate until the DM looks ~ flat. If the gradients are +100, +100, you need to add tip -1, tilt -1.]
    [Caveat 9/09 - if you subsequently adjust the laser fold flat to minimise the number of fringes, and re-flatten the DM, the tilt added by AddZernike will prove to be a factor of 2 too large??]
    If the white-light flattening fails, reload the laser flat and start again.
  12. Plot out the piston values of the segments:
    naomi@lpss42> plotflathist 20050512-122625.white
    ----------------------------------------------------------------------------
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                #                     #                # ####       #      ## # # 
                #                 ### #       ###  ##  ######## #######  # ## ### 
                #  ##  #    ##    #####    #  #### ## ######### ############# ####
    --          ####################### ############# ############################
       #   ## ####################################### ############################
      ############################################################################
      ############################################################################
      ############################################################################
      ############################################################################
      ############################################################################
      ############################################################################
      ############################################################################
      ############################################################################
      0         1         2         3         4         5         6         7
      1234567890123456789012345678901234567890123456789012345678901234567890123456
    
    

    Check for large slopes (more than a few rows) in x or y.
  13. If there are two or more fringes on several segments, repeat the laser-flattening (with Z gain = 0).
Back to top of page For simplexing using the new (2010) Andor camera, see Jure's guide.

The instructions below refer to simplexing with the old AG7 camera, but some of this will also be relevant to use of the new Andor camera.

  1. On the OBSTOOL gui, select observing mode = simplex (AG), and click on the configure button, which puts in the OASIS and simplex flats, checks the 50/50 dichroic is in.
  2. Load the last white-light flat (e.g. as created above).
  3. If the simplex lamp isn't already on, switch it on from the light-path gui.
  4. Bring up the simplex gui and display, either by (1) clicking on the simplex button on top gui left-hand page, and clicking again to select ag7, or (2) by typing at the lpss42 prompt (but not on the 16-bit right-hand screen), simplex (short for mirroralign.py --camera AG7 &)
    The control gui looks like this:


    NB in the above xv-captured copy of the simplex display, the image itself is not well reproduced, due to the 8-bit display used by the NAOMI applications.
  5. On the simplex gui, click on continuous, with clip images on. An image of the pinhole should be visible in the display. If not, the move the box by tweaking x and y, until the image of the pinhole appears. If it's difficult to find, unclip the image (not working 13/5/05 for AG7), to display the whole CCD. The top-left two pixels in the window are always 'bright', ~ 1500 counts. In practice, this probably doesn't affect the simplexing. When simplexing on INGRID, beware that only one INGRID quadrant can be displayed, you have to select (on the simplex gui) which quadrant you want displayed, and note that the gui window may need expanding to ensure that the whole quadrant is displayed. The quadrant numbers do *not* map as displayed on the simplex gui. The simplex quadrant numbers corresponding to the quadrants of an ingrid image, as conventionally displayed by iraf, are shown below:
         ---------
         |   |   |
         | 2 | 3 |
         |   |   |
         ---------
         |   |   |
         | ? | ? |
         |   |   |
         ---------
    
    In addition, the quadrants are displayed with the y direction flipped (because in the simplex display, y *decreases* as you go down the screen). As of 4/08, the simplex pinhole image appears at the right edge of quadrant 2.
  6. From the simplex gui, adjust the window to be ~ 30 x 30 pixels in size, centred on the image of the star.
  7. Adjust the simplex lamp iris setting (typically ~ -290) on the light-path gui, and the simplex exposure time (typically 0.02 sec) on the simplex gui so that the maximum counts (as displayed on the simplex control gui) are ~ 10000 - 25000, ideally ~ 18000. NB it's not possible to delete all the characters in the exposure-time window before entering a new value. You have to position the cursor somewhere in the string of digits, and insert new digits.
  8. On the simplex display gui, set zoom = 6, colour = rainbow, and display maximum to ~ the maximum value displayed by the simplex gui.
  9. [Tip for experts: any of INGRID, TEK1, MAR2, EEV13, AG5 or AG7 can be used with mirroralign.]
  10. Find best-focus value of OASIS filter focus (changed on light-path gui), usually around 2.2 (see OASIS observing recipe for latest values), by maximising peak counts reported on simplex gui (and roundness of displayed image - typically it's elongated if the focus is off by more than 0.5 mm).
  11. Hit the simplex button, to start the procedure, which automatically:
    • Samples 228 random configurations of the DM, measuring the merit function (MF, a measure of the quality of the PSF, for each).
    • Iterates to improve the configuration. It should start to improve after ~ 800 cycles. There's not usually much improvement after 2000 cycles. Watch for improvements in the MF and the peak count.
  12. Aim for MF = -0.015 in the optical (30 * 30 window), -0.03 in H. The merit function MF = sum(intensity2) / (sum intensity)2, and the acceptable value depends on wavelength, background level and window size. A good simplex in H band (INGRID) has PSF FWHM <~ 2 pixels, and the blobs in the PSF (typically out to radius ~ 12 pixels) should not exceed ~ 2%.
  13. If necessary, stop and resimplex to avoid getting stuck in a local minimum. Before restarting the simplex, check that there isn't a risk of saturation (as the PSF improves, the intensity of the central peak rises).
    If the MF remains poor, and repeated simplexing doesn't help, then:
    • If a long time (many hours) has elapsed since laser-flattening, a new laser-flattening may be needed before continuing with the simplex.
    • If the image is not single-peaked, it may be that the white-light flattening failed. Repeat it.
    • If neither of the above apply, and you're working with AG7, try halving the tip-tilt and piston gains (from the simplex control gui). The default values (96, 354) were designed for simplexing in the IR, on INGRID, and several users have noticed that reducing them sometimes helps when simplexing in the optical.
  14. When satisfied, hit the stop button.
  15. Save the flat, using the button on the top gui light-path gui page.
  16. Check the PSF:
    • Type run ag7 0.1 at the taurus prompt
    • If an iraf window isn't open:
      • Type xgterm & at any unix prompt (including lpss42).
      • Type cl to start iraf
      • cd to the data directory
    • Issue the following at the iraf prompt:
      • !ds9 & to start the display tool, if not already open
      • display s1[1] 1; imexa to display the image
      • move the cursor over the image of the pinhole and hit r for a radial profile, e for a contour plot, s for a surface plot, z for a 10*10 pixel dump.
      • Check the image is not saturated (i.e. < 40000 counts).
      The FWHM (the last number on the line below the image, after hitting r) should be ~ 2 pixels, the contour plot should look clean (all contours circular), and the the profile plotted with the imexam 'r' option should be a close approximation to that fitted to the core. If the PSF is very good, it will look like this:

      In particular, there should be very little extra flux in the wings of the profile, compared to that fitted,, i.e. the dots should follow the fitted curve. This is more important than the value of the FWHM itself. If many points lie well above the curve, the PSF is not diffraction-limited, i.e. the DM is not well-flattened [*** be more quantitative here ***].

    • If the image is not saturated, and looks OK, record the FWHM in the NAOMI logbook.
  17. If desired, the strehl of the PSF can be measured with Roy's Strehlometer.
  18. Repeat the laser-flattening with z gain = 0, save the flat using the button on the top-gui light-path gui page.
  19. Re-simplex for each dichroic being used at night.
  20. If there is no AO observing scheduled for this night, go to the 'End of night' section for advice on closing down the system.
Back to top of page There may be significant flux in spots at regular intervals along horizontal or vertical axes passing through the peak, due to a staircasing of the DM. To remove it:
  1. At the lpss42 prompt, type e.g. stairx 40, or stairy -40. Positive stairx removes a spot left of the main image. Positive stairy removes a spot below the main image.
  2. Inspect the image, and repeat as appropriate, varying the sign and magnitude. NB the values are additive, not absolute i.e. stairx 20 then stairx -20 has no net effect.
  3. Save the flat.


Top | Back

Contact:  (NAOMI Instrument Specialist)
Last modified: 02 August 2011