An Annotated Guide to ‘ult_sysalign,/guide’¶

The /guide option to ult_sysalign makes it ask you questions to guide you through the alignment process.

This page assumes you are already familiar with GPI System Alignment, and describes in more detail what’s happening in each step of the interactive process. Each subsection heading below corresponds to a step in ult_sysalign, either a prompt that is presented to the user, or a step that the script does on its own without human interaction. Some steps are optional and not all prompts to the user will appear every time.

IDL> ult_sysalign, /guide
Defaults are marked with []

Set the AO I Magnitude¶

Set the AO I Magnitude (default=4):


The guide star magnitude is used to set the AOWFS frame rate, based on lookup tables on the AOC that specify the appropriate rate given stellar magnitude. This is equivalent to the target I magnitude provided as part of the target definition in the Observing Tool. This setting also selects the AO WFS filter and sets the closed size of the spatial filter, although currently (as of 11/2014) all magnitudes are mapped to the 700 nm low cutoff filter and the spatial filter is always set to 4 mm. The configuration is stored on the tlc in \$TLC_ROOT/config/CONFIG.InstSeqAll in uncommented entries starting with STAR_MAG (the comment symbol in these files is #).

Note

All TLC configuration files are under version control and should NOT be changed by the user at the summit.

The default of I=4 is suitable for the default brightness of the ASU supercontinuum laser (see below). You should almost always just press enter here to use that default.

Set the CAL H Magnitude¶

Set the CAL H Magnitude (default=0):


This sets the CAL LOWFS frame rate, same as the target H band set in the Observing Tool. Again the default of 0 is appropriate for the default setting of the ASU supercontinuum source (see below).

Select your source ([ASU] or TELSIM):


This is obsolete and vestigial from GPI I&T at UCSC. We are no longer using the Telsim, so you should always press enter here to use the ASU.

This option will probably be removed in a future revision of this script.

Select your attenuation (default=25.5):


This sets the attenuation of the super continuum source (in decibels). Allowable values are from 2.5 to 60; higher values of attenuation correspond to less light.

For complex reasons having to do with the properties of the nonlinear optics, it is generally best to run the laser at 100% power and use the attenuator to provide a reasonable amount of light, rather than running the laser at some lower power fraction. Note that changing both the power and attenuation will change the specific wavelength response of the laser. Decreasing power or increasing the attenuation both tend to make the light redder.

At this point the AO system will be configured according to the above settings. You can watch the TLC GUIs to see this take effect.

Autoselect LQG¶

The system will automatically set the LQG controller to auto mode, unless you explicitly tell it not to.

LQG will be set to auto.  If you want to change this, run with ttlqg and foclqg flags set.
Source is: ASU


(Optional) Power on the supercontinuum source, if off¶

The supercontinuum source does not appear to be on.
Should I turn it on for you? ([Yes]/No/Quit)


If the laser is not on, you must turn it on. While the script appears to give you the choice of not turning it on, this choice is a lie. If you choose No, there is no way for ult_sysalign to succeed. Choose Yes or just press enter to turn on the laser.

If the laser is already on, this question won’t appear.

If the laser needs to be turned on, the script will do so, and will wait for it to warm up. This will add about a minute or so to the execution time.

Once the SC source is on, the script will make sure the ASU is inserted into the beam.

% TLC_MOVE_SOURCE: Already at requested state.
Shutter is closed and ASU is deployed. Assuming you are using the ASU.


(Optional) Power on AO devices, if off.¶

Some of the AO control devices appear to be off.
Should I turn them on now? ([Yes]/No/Quit)?


If the tip/tilt stage, woofer, or tweeter are not powered on, you must power them on. Again, the option to not turn them on is a lie.

If these devices are already powered on, this question won’t appear.

(Optional) You do not seem to have run start_us_up yet. Should I do so now?¶

The start_us_up script is needed to initialize communication with the AOC and initialize the AO system. Again, if this question appears then you must select yes or ult_sysalign will fail.

If the AO system is already initialized, this question won’t appear.

-------------->>   About to read /gemsoft/opt/gpi/aoc/gpi_root/aoc/config/parms.txt
-------------->>   Warning: not in gpilib root.  Temporarily changing directory.

-------------->>   Setting mode of operation for the primary purpose instrument:

If you will be taking images with the IFS, you have the option of setting some default keyword values.
You can do so by setting common block variables:
gpi_gds_observer
gpi_gds_obstype
gpi_gds_obscalss
gpi_gds_object
gpi_gds_inport
gpi_gds_crpa
gpi_gds_iaa
gpi_gds_pos_ang
To remove any keyword, set it to !NULL or [].

Enter observer name, or return for none:


You can enter an observer name here, which is just used to populate a FITS header keyword.

-------------->>   IFS

AOC commanding has been locked by user software on host cpogpi01.cl.gemini.edu
on Wed Nov 12 18:36:07 2014
-------------->>   Checking AOC heartbeat.
-------------->>   Making sure communication files are in the right location after
-------------->>   potential direct interaction with aoc...
all OK


Configuring the AO system¶

Now all of the above settings will be applied to the system. This is done using a combination of low level AOC commands (to dial in the LQG settings) and the Instrument Sequencer AO Config command, which is the same as what the Seqexec uses.

CENT_THRESH      50.0000
Key LEAK_GAIN_TT is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key LEAK_GAIN_TT with value: 0.999900
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Key TT_SPLIT_SWITCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_SPLIT_SWITCH with value: 0
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Key TT_LQG_SWITCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_LQG_SWITCH with value: 2
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Just issued reaconfig. Waiting...

--------- TT loop settings ---------
TT_LQG_SWITCH       =       2.00000   Normal integral controller
TT_SPLIT_SWITCH     =       0.00000   TT on Wfr surface and TT stage
LEAK_GAIN_TT        =      0.999900
TT_GAIN_STAGE       =      0.100000
TT_GAIN_WFR_SURFACE =      0.200000

--------- Done ---------
Key TT_LQG_SWITCH is listed as might change.

You most likely should not be doing this, but you can for now.
Updated key TT_LQG_SWITCH with value: 0
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Just issued reaconfig. Waiting...

--------- FOCUS loop settings ---------
TT_LQG_SWITCH       =       0.00000   Focus integral controller
LEAK_GAIN_TT        =      0.999900
Integ               =       0.99900000 From config/ttRotFocVectors.fits
Gain                =       0.20000000 From config/ttRotFocVectors.fits

--------- Done ---------
Using single input for both axes
rtc_command_set_cent_gains: leaving CENT_THRESH at present value:       50.0000
setCentThresh  50  1.00000  1.00000
Issuing the following commands:
setCamRate 1000

-------------->>   You wanted a frame rate of:       1000.00
-------------->>   AOC set the frame rate to:     1000
back to default opt_init_gains!
setTT      0.559004     0.0398082 1

RTC Standard settings to get us going -
Refs
Dark, flat
Infl filter on
MIrrors at flat

% ULT_SET_TT_MODE: Autoselecting LQG!
Key LEAK_GAIN_TT is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key LEAK_GAIN_TT with value: 1.00000
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Key TT_SPLIT_SWITCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_SPLIT_SWITCH with value: 0
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Key TT_LQG_SWITCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_LQG_SWITCH with value: 1
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Key TT_SEEING is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_SEEING with value: -1
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Just issued reaconfig. Waiting...

--------- TT loop settings ---------
TT_LQG_SWITCH       =       1.00000   LQG in use!
TT_SEEING           =      -1.00000
TT_WIND_POWER       =      -1.00000
TT_STAR_BRIGHTNESS  =       2.50000
WARNING! - we are using a hard-coded default.
This is supposed to match what is in the AOC code itself.
If thar is changed you must change this code in ultimate/ult_make_lqg.pro

Case:  5 --> using set3 like a gain of 0.2,  Correcting 60,120,180
ATM integ:     0.999000
Noise level:      1000.00
CP Vib (hz):      60.0000      120.000      180.000
CP Vib |a|:     0.999500     0.999500     0.999500
Vib powers:     0.500000      4.00000      32.0000
NCP Vib (hz):      0.00000      0.00000      0.00000
Vib powers:      0.00000      0.00000      0.00000

TT_SPLIT_SWITCH     =       0.00000   TT on Wfr surface and TT stage
LEAK_GAIN_TT        =       1.00000
TT_GAIN_STAGE       =       1.00000
TT_GAIN_WFR_SURFACE =       2.00000

--------- Done ---------
% ULT_SET_FOCUS_MODE: Autoselecting LQG!
Key TT_LQG_SWITCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_LQG_SWITCH with value: 3
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Key TT_WIND_POWER is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key TT_WIND_POWER with value: -1
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

-1
Just issued reaconfig. Waiting...

--------- FOCUS loop settings ---------
TT_LQG_SWITCH       =       3.00000   FOcus LQG in use!
TT_SEEING           =      -1.00000
TT_WIND_POWER       =      -1.00000
TT_STAR_BRIGHTNESS  =       2.50000
WARNING! - we are using a hard-coded default.
This is supposed to match what is in the AOC code itself.
If thar is changed you must change this code in ultimate/ult_make_lqg.pro

Case:  21 --> using set3 like a gain of 0.27, Sims indicate 60 Hz rms reduced by * 7.6
ATM integ:     0.999000
Noise level:      317.000
CP Vib (hz):      60.0000      0.00000      0.00000
CP Vib |a|:     0.999800     0.999800     0.999800
Vib powers:     0.500000      0.00000      0.00000

LEAK_GAIN_TT        =       1.00000
Integ               =       1.00000 From config/ttRotFocVectors.fits
Gain                =       1.00000 From config/ttRotFocVectors.fits

--------- Done ---------

TLC Standard settings to get us going -
Inputfold to AO default
PNC to AO default
SF to open

-------------->>   Disk usage on AOC is at 83%

-------------->>   Done with setup!
-------------->>    Changing back to original directory: /export/home/software/


Activate open loop models¶

Without querying the user, ult_sysalign will check that all the open loop models are running. If they are, you’ll see:

All Open Loop Models Running.


If any are not running, it will stop, display an error message, and let the user fix this:

The following open loop models are not running or could not be read:
tlc.trkAss.aoWfs.applyOpenLoopModel
Stopping so you can fix this.
Type .cont when done, or to proceed with models off (not recommended).


You should turn on the open loop models using the TLC GUI, and then type .cont to continue with ult_sysalign.

Spatial filter, Apodizer, and DAR setup¶

The spatial filter is closed to 4 mm, and the apodizer is moved to the CLEARGP (Gemini pupil) position.

Zenith angle is:    -0.0502680
Closing spatial filter down to 4.0 mm
Moving Apodizer to CLEARGP


Because atmospheric differential refraction isn’t relevant with an internal source, software DAR correction is turned off.

Turning DAR Residuals OFF (in event of crash, remember to re-enable
Datuming AO PnCs, Input Fold and flattening Tip/Tilt.

setTT      0.559004     0.0398082 1
setTT      0.487336     0.0850933 1
Final error:       3.60395
setTT      0.487336     0.0850933 1


AO PnCs to previous last best centering¶

The AO PnCs are configured to the best centering, as determined from the settings whenever ult_sysalign was last executed. It will then take a LOWFS image, and display this on screen.

Applying last best centering to AO PnCs and starting tracking.
Configuring system: OPEN FPM, CAL Entrance Open, Exit Closed.
Taking CAL frame to check flux.
Output will be written to /gemsoft/opt/gpi/cal/data/LOWFS/141112/lowfs0001.fits
Output will be written to /gemsoft/opt/gpi/cal/data/LOWFS/141112/lowfs0001.fits
Waiting for image to be written. Done.
Min/max pixel values =       1.29999      2113.20
Total flux =      244021.
Min/Max/Average subap flux =       6102.30      7487.30      6854.74
Approx. mag for   5.00 ms frame =   1.431
Approx. mag for  10.00 ms frame =   2.183
Approx. mag for  16.70 ms frame =   2.740
Approx. mag for  33.30 ms frame =   3.490
Approx. mag for 100.00 ms frame =   4.683


At this point you should look at the LOWFS image and double check that you are getting photons as expected (max pixel values < 100 imply something is wrong).

Do you want to get new AO WFS darks?¶

Do you want to get new AO WFS darks? ([Yes]/No)?


The AOWFS dark levels vary on short timescales, and should be calibrated about once per hour. You should always say Yes here, unless you’ve already taken a set of AOWFS darks in the last fifteen or twenty minutes. This is a fast calibration to take.

To take AOWFS darks, the SC source is briefly turned off.

Look at the AOC dispstat display. The average intensity will change - you can watch it turn off for the dark then back on. The expected value of mean counts in an AOWFS dark is about 17 counts. After the darks are measured, the light is turned back on.

Turning off the lights for new darks.

This uses the AOC function: takePixelDarks
Measure and store new pixel darks for WFS, for each frame rate.

This command can be issued only when all control loops are open.

This calibration command collects and processes raw
WFS data in order to determine pixel dark values.
This command should only be issued when the WFS is
completely in the dark.

IMPORTANT: This command will close and open AO loops
and change camera frame rates as it executes.
The status attribute is set to BUSY upon receipt of the command
and reset to IDLE when backgrounds have been successfully
determined or ERR if an error occurs.

Light source should be off.
Waiting 20 seconds
Turning light back on.


MEMS rotation check¶

Turns light back on, checks rotation between the AOWFS and lenslets. Should be small. If above 0.1, will raise an error.

Checking rotation between AO lenselets and CCD.
This has been super-ceded by ult_get_rotfoc.pro
You should probably be using that instead.
Rotation = -0.0606285
Aligning System to CAL (closing TT & Woofer loops and applying CAL corrections to  AO PnCs).

0   aoc.aocRpc.wooferLoop         1.00000       1
1   aoc.aocRpc.tipTiltLoop         1.00000       1
Aligned to CAL.  Stopping AO PnC tracking and saving new default PnC setting.
Opening all loops.


Closed Loop Focus Offset¶

Typically, you want -50 nm focus offset for coronagraphic images and -150 for direct images. Defaults to -50, but can be set to 0 or any reasonable value.

Select a focus offset: [-50]/-150/0 nm RMS.


Do you want to align the MEMS to the AOWFS?¶

Centering of MEMS to shack hartmann. Crucial step, do not skip.

Do you want to align the MEMS to the AOWFS? ([Yes]/No)?
Aligning MEMS to AOWFS


Do you want to use the IS alignment (if No use IDL) ([Yes]/No)?¶

Do you want to use the IS alignment (if No use IDL) ([Yes]/No)?


Two options here - IDL vs Instrument Sequencer (IS). The IS one is faster, the IDL one has larger capture range. You can safely use the IS version if this alignment has been performed recently, but use the IDL version after long breaks in use (days), when GPI is first mounted on the telescope, or if the IS alignment fails.

The IS path will display:

Running Instrument Sequencer MEMS to AOWFS alignment.
Running Measure Twt Lens
Done
Updating TT to zero pointing for new AO PnC centering.
setTT      0.542794    -0.0215951 1
setTT      0.567386    -0.0352518 1
Final error:       1.68361
setTT      0.567386    -0.0352518 1


Do you want to check the spatial filter alignment? ([Yes]/No)?¶

Do you want to check the spatial filter alignment? ([Yes]/No)?


The alignment of the AO spatial filter to the AOWFS is another crucial step. Do not skip this or you risk destabilizing the AO system.

This alignment process creates a pinhole by cranking closed the SF. This yields a perfect spherical wavefront, no tilt, so measuring its center just measures the pinhole not any WFE.

Dark corner subtraction is toggled off and then back on after the pinhole is removed.

Checking SF alignment.
Turning off dark corner correction.
Key DARK_CORNER_CRCT_SWTCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key DARK_CORNER_CRCT_SWTCH with value: 0
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Dark corner correction = 0.00000
0.00000
setTT      0.567386    -0.0352518 1
setTT      0.567386    -0.0352518 1
setTT      0.564236    -0.0294180 1
Final error:      0.479940
setTT      0.564236    -0.0294180 1
Closing SF to 0.0100000 mm pinhole and setting attenuation to 7 dB.
Average Intensity Max, Min, Sigma:       4214.27      1546.07      701.896
Commencing tip/tilt minimization.
Note: error may initially diverge.
Done.
Reverting to original setup.
Turning dark corner correction back on.
Key DARK_CORNER_CRCT_SWTCH is listed as might change.
You most likely should not be doing this, but you can for now.
Updated key DARK_CORNER_CRCT_SWTCH with value: 1
For this to take effect you must issue a readConfig right now.
Any other AOC command will overwrite parms.

Dark corner correction = 1.00000


Do you want to get new DM flats? ([No]/Yes)?¶

Gets new DM flats. This should be done at least once per run.

There is a lab flat and a system flat associated with both the tweeter and woofer. One is applied when you load a reference shape, e.g. flat all. The other is a static reference shape carried through in the loops We know we have a big focus term, so we tell that to the system. Measure the pure focus mode and write it to the pure woofer shape - now we reclose and let the tweeter work (less hard)

There is now a dedicated focus loop as well as well as the tip-tilt loops. Explicitly taken out of the Fourier modal basis (since it’s not a Fourier mode).

Do you want to get new DM flats? ([No]/Yes)?


Tip-Tilt Vibration measurement¶

Displays vibration as seen by the AOWFS. The TT stddev errors line shows the RMS error (in mas) for tip and tilt. The second axis always shows more vibration than the first. Values should be below 10 mas. If they are above 15 mas, you may have trouble keeping the loops stable. The las line shows the tip and tilt vibration at 60 Hz, 120 Hz, 180 Hz and 240 Hz.

Measuring tip/tilt motion and logging
Stage voltage   1.58527e-06  0.000104806
TT error centroids       9.69145      103.383
TT command mas      0.00000      0.00000
TT error mas pre lqg       5.22985     -6.57662
Note that these are not all meaningful depending on loop open or closed status
TT stddev errors =       1.94579      6.94136
1
logging to /gemsoft/opt/gpi/IDL/gpilib/private//tt_vibration_log.txt
#Date                  avgtiptilt      rmstiptilt   intensity loop      60     120     180   240
2014-11-12 18:44:32   5.23  -6.58      1.95   6.94       2199.  op  0.16   0.15    1.50   5.54    0.11   3.35    0.15   0.60


You are now aligned up through the CAL. Do you want to stop here?¶

You are now aligned up through the CAL.
Do you want to stop here? ([No]/Yes)?


Aligned up through the CAL - the AO system is fully aligned. If you are only using the AO, you can stop here. If using IFS, then continue.

Select an Observation Mode¶

Select an observation mode (default = H_coron):


Select obsmode. Can watch gpidiagram or Gemini GPI diagram and watch the components move. Note: obsmode sets just the 3 coronagraph components (PPM, FPM, Lyot) and the IFS filter. It does NOT select the prism for spectral or Wollaston mode.

Do you want to take new CAL darks?¶

Do you want to take new CAL darks? ([No]/Yes)?


Cal darks - Required cadence for new darks has not been adequately studied but should be done at least once per run. This process takes more than 5 minutes and will not print any status information to the screen until it is complete.

Check apodizer and Lyot alignments¶

Do you want to check the apodizer and lyot alignment? ([Yes]/No)?


Checks alignments of apodizer and Lyot with respect to the MEMS DM. Puts pokes onto the MEMS which can be seen on the pupil viewer as it is slightly defocused.

The offset numbers ideally should be < 0.5. This is not always the case right now but if ≥2 pixels, stop and repeat the measurement to confirm, and if that is the case, then you need to diagnose and fix the alignment.

Opening CAL Exit and getting pupil viewer dark.
% ASSEMBLE_IFS_PATH: Output directory does not exist: /gemsoft/var/data/gpidata/ifs/Pupil/141113
Output will be written to /gemsoft/var/data/gpidata/ifs/Pupil/141113/S20141113pupil0001.fits
Waiting for image to be written.
Image has been written to disk
Configuring system: PupiViewer=deploy, Lyot=open, FPM=science
% TLC_MOVE_IFS: Already at requested state.
Getting pupil images.
Output will be written to /gemsoft/var/data/gpidata/ifs/Pupil/141113/S20141113pupil0004.fits
Waiting for image to be written.
Image has been written to disk
Output will be written to /gemsoft/var/data/gpidata/ifs/Pupil/141113/S20141113pupil0005.fits
Waiting for image to be written.
Image has been written to disk
Found ellipse centered at       163.500      117.000
Found pokes with center at        162.16418       119.62066
Offset of       -1.3358192       2.6206646
Average poke rotation of        83.202710


Center the pinhole?¶

Do you want to center the pinhole? (Yes/[No])?


Center the pinhole? Do not need to do this if not using the HOWFS.

After the above questions have been answered, the FPM alignment will proceed:

Closing CAL exit
Zeroing CAL TT bias
Opening CAL loop and closing AO loops
0   aoc.aocRpc.tweeterLoop         1.00000       1
1   aoc.aocRpc.wooferLoop         1.00000       1
2   aoc.aocRpc.tipTiltLoop         1.00000       1
Putting AO PnCs in Track with CAL Correction applied


Align_FPM tries to equalize the flux after dithers up, down, left and right applied to the AO WFS PnCs while loops are closed. This has the effect of moving the beam around on the focal plane mask. The dithers are sized to move to the edge of he pinhole.

Running Align FPM
Successfully finished ALIGN FPM.


The FPM alignment progress can be monitored in the calshow window. The algorithm has a tolerance of 5 mas, and tries to get this three times in a row. The alignment fails if not converged in < 20 iterations. After the alignment, the CAL LOWFS tip/tilt are recorded and applied as the CAL TT Bias values (displayed in gpidiagram).

Turning off Cal Corrections, but TRACKING IS STILL ON.
Getting CAL tip/tilt
CAL tilt/tip for FPM center:      11.3404     -9.86399
Applying to CAL TT bias and reapplying CAL Correct.
Done. AO & CAL loops are closed, AO PnC tracking on, CAL TT baises set.


Take IFS Image¶

If you configured a coronagraphic mode (i.e., H_coron), after the FPM alignment you will be given the option to take an IFS image to check how the alignment went.

Would you like to take an IFS frame to verify alignment? ([Yes]/No)?


If you select yes, the spatial filter will be closed to 2.8, and if the loops remain closed a 60 s IFS image will be taken. The CAL exit will then be closed and the spatial filter left at 2.8.

System alignment complete¶

If you select all of the defaults, you will end on this message:

System alignment complete.'
Note that the spatial filter is at 2.8 mm.'
Note that PNC tracking is OFF.'
Note that CAL exit is CLOSED.'
Note that AO & Cal loops are * OPEN *'
Note that MEMS and TWT are flat.'
Note that DAR residuals are OFF'

If you are done testing alignment, run ult_setup_onsky'
to configure GPI for nightly observations.'
IDL>


Congratulations! You have successfully aligned GPI.

Next Steps¶

If you are not going to take IFS images, you should make sure that the cal exit shutter is closed and that the AO loops are open (this should be the case already, but commands are below in case).

Then you should set the mirror surfaces to zero. This sets all command voltages to 0V, so it is safer than leaving the mirrors in flat.

tlc_move_cal,/exit,/close
openall,/cal
zeroall


Before going on sky, you should turn on DAR residuals, turn on