Introduction

The DEIMOS internal focus can change significantly on a daily basis. Hence, it is advisable to refocus the spectrograph each afternoon. Since the offsets between various filters appear to be stable over time, the standard procedure is to focus the instrument in direct imaging mode using the R filter and dome illumination. The focus sequence can also be run using the internal lamps, when the telescope cannot be pointed at the dome flat position, e.g. during adverse weather at the summit. Once the focus in this fiducial filter is measured and set, the instrument's automated filter focus discipline software will adjust the internal focus as needed to account for the changes in the filter.

The focus sequence consists of the following two steps:

  1. To acquire images with a pinhole mask (GOH_X) at different values of the dewar focusing stage.
  2. To analyze the images in order to find the optimal focus map.

Prior to January 2020, the focus analysis was done using an IDL-based script running on an old Solaris machine. On January 2020, we developed a new Python-based focus analysis script on a Linux system. The new script is ~15 times faster than the old one. This helps optimizing the DEIMOS afternoon checkout procedure.

This page shows the results of a comparison between the focus maps obtained with the new Python-based and the old IDL-based scripts.

Analysis

The following figure (click on the figure to expand it) shows the pinhole centoids for the GOH_X mask in detector pixel coordinates. The focus images were taken on January 21, 2020. The centroids calculated using the Python-based script are represented by red plus symbols and the centroids from the IDL-based script are represented by blue circles.

DEIMOS focus map comparison

The following plot shows the best-focus stage value for all GOH_X mask pinholes as a function of detector row position. This graph was created using the focus sequence obtained on January 21, 2020. The plus symbols represent the best focus from the Python-based script and the blue circles represent the values from the IDL-based script. The best-focus stage value is, on average, slightly smaller when obtained with the new Python script than with the old IDL script.

DEIMOS best focus map comparison

The next figure shows the best-focus stage value as a function of X and Y position on the detector. Red plus symbols correspond to the Python script and blue circles represent the values obtained with the IDL script.

DEIMOS best focus map comparison surface plot

The following plot shows a comparison between the measured focus curve (FWHM in pixels vs. focusing stage value) on one of the pinholes and the corresponding parabolic fit. Note that a change in +/-100 counts on the focusing stage about the minimum of the parabola changes the FWHM of the PSF by only 0.003 pixels, i.e 0.064%.

DEIMOS spot focus parabola

The following plot shows the focusing stage best-focus value using the old IDL script (circles) and the new Python script (triangles) in the period between June 2019 and January 2020. Different colors represent different CCDs on the detector mosaic. The dashed black line represents the average of all four CCDs using the IDL method. The solid black line represents the average of all four CCDs using the Python method. The dataset is a mixture of focus values obtained with the dome flat lamps and the internal lamps.

DEIMOS best focus value comparison between June 2019 and January 2020
The Python script produces smaller values for the average best-focus stage value than the IDL script.

The following plot shows the difference on the best-focus value using the old IDL and the new Python script in the period between June 2019 and January 2020. Different colors represent different CCDs on the detector mosaic. The dashed black line represents the average difference including all four CCDs.

DEIMOS best focus difference between June 2019 and January 2020
The average difference between the new and the old method is about -100 counts on the dewar focusing stage. This difference represents less than 0.1% in the FWHM of the best-focus PSF.

One of the advantages of the new Python-based script, in addition to being ~15 times faster than the IDL-based script, is that it is more robust. The following figure shows a focus map obtained on November 22, 2019 using the IDL-based script.

DEIMOS focus map on January 21, 2020 using IDL-based script
In this case, the IDL-based algorithm failed to generate a usable map for the two central CCDs, ie. CCD2 and CCD3.

In contrast, the same data set as on the previous figure analyzed using the new Python script produces a nominal focus map (see next figure). We found several instances between June 2019 and January 2020 when the old IDL script failed to generate a correct focus map, while the new Python script generated a nominal focus map.

DEIMOS focus map on January 21, 2020 using Python-based script
In some of the cases when the new focus script produced a normal focus map, but the old focus script produced a bad map, the difference in the average value for best-focus stage position could be as large as 1000 counts.

Focus sequence with internal or dome flat lamps?

In this section, we analyze the difference between using the internal calibration lamps and dome flat lamps to determine the best DEIMOS instrument focus. In order to do the analysis, we run focus sequences with both, dome flat lamps and internal lamps, on 9 different nights in June 2020.

The following plot show the comparison between best-focus value obtained with the internal lamps and with the dome lamps as a function of date. Different colors represent different CCDs on the detector mosaic. The black solid line represents the average best focus for data taken with the internal calibration lamps. The dashed solid line represents the best focus for data taken with the dome flat lamps.

DEIMOS best focus comparison using internal and dome flat
       lamps

The following plot shows the difference between the best-focus value obtained with the internal lamps and with the dome lamps as a function of date. Different colors represent different CCDs on the detector mosaic. The dashed black line represents the average difference including all four CCDs.

DEIMOS best focus difference between using internal lamps
       and dome flat lamps

The main take aways from the previous two plots are:

Therefore, there is no reason to favor a source of illumination against the other to take the instrument focus sequence images. However, for operational convenience, the we recommend to take the focus data using the internal calibration lamps (DEIMOS utilities → Run focusloop (R+internal) on the VNC background menu), because taking these images does not require to wait until the K2 telescope is released.