Overview
How
The focus script is a Tcl script that runs under loisLOIS. In the case of LMI, it is available after LOIS has been started and initialized with the green UI button in the usual way. There should may be an inplacefocus button under the User Buttons tab on the LMI UI to run the script but the preferred way to run the focus is through the imager. It is necessary for the TCS and AOS to be running and the usual connections via JOE established to perform the focus changes that this script will make. There is also a setfocus script and User Button available to unconditionally set the focus value.
The focus value is technically called the focus offset with units of microns -- it is a direct piston of M2 applied in addition to the continuous update for temperature and elevation angle provided by the AOS. Changing the focus for LMI will also change the focus for the probe cameras and other instruments in the instrument cube.
The operation consists of 4 general steps:
- Taking a test image
- Setting up focus parameters & initiating the focus sweep
- The focus sweep
- Display of the focus sweep results
For reference, the command sent to LOIS is in the following form:
inplacefocus x y title bin exptime filter focstep focbase flags
The So the user first selects a star with coordinates x,y in pixels on a full takes a full frame left amplifier single image, usually binned 2:22x2. The user then sets up the focus parameters and initiates the focus sweep by selecting a star from the initial full frame image. The script then takes subframe images centered about these coordinatesthe star, with a succession of focus settings, to find the best image quality. And finally a dialog box comes up displaying the results and the associated parabolic fit where the user can decide on the appropriate focus offset sent to the AOS.
Method---
There is no slew to locate the star, or telescope motion to center it up, whence comes the term "inplace focus". The focus setting value used as the center of the sweep is called focbase; the script first sets the focus to that value. The routine then "acquires" the star by defining a standard sized (now 300x300 at 2:2 on LMI) subframe around the given position and taking a single image. Analysis is performed on this image- if the star is sufficiently bright, in terms of instrumental mag. and maximum pixel value, but not saturated, and the fwhm is reasonable, the subframe is redrawn to place the psf in the center of the image. If the image appears reasonable, but either too bright or faint, the exposure time will be adjusted within certain limits and the exposure retried. If this is still out of specification, the focus script ends with a failure status.
...
x | x coordinate in pxls of star on a full frame image at the selected binning; there is no default. | |
---|---|---|
y | y coordinate in pxls of star on a full frame image at the selected binning; there is no default. | |
title | this is used for a heading in the focus log; may be multiple tokens- default is empty string | |
bin | integer for binning factor- LMI default is 2. 1:1 has also been tested. Note x,y coordinates must be in the same scale. | |
exptime | exposure time in seconds for acquisition and focus sweep images. May be adjusted. | |
filter | name (like "R") of the filter setting to do the focus sweep. "Nominal" means use the filter as previously set. Leave this blank for LMI. | |
focstep | delta for focus setting per sweep position. (defaulted to 40 microns on LMI) | |
focbase | setting of focus for acquisition and sweep center. This has a reasonable default (800 microns on LMI). | |
flags | strings, all optional, defined in any order, as follows: | |
| save ( put images taken in focus sweeps in a subdirectory in the main image directory.) |
|
| conditioning ( focus run is a dry-run; the final focus setting is always focbase.) |
|
| noexptimeadjust ( suppress suppress autoadjust of exposure times for both acquisition and focus measures.) |
|
lowlight ( use lower thresholds for light level in acquisition & focus ) | ||
low ( same as lowlight) | ||
longexposure (allow up to 60 seconds exptime) | ||
long (same as longexposure) |
...