Automated Arc Solutions

If you trust the software, it does a pretty decent job of generating automated wavelength solutions for NeAr or NeNeAr arcs. 

The philosophy is to trace an aperture down the order center, and then cross correlate this trace against an archived solution to identify lines and make a rough fit.  Then the lines are re-centroided and and arc solution is written to disk.

Manual Arc Solutions: The X_IDENTIFY GUI

If you wish to inspect the solutions - and you should, at least for the first several tries - you can select "User Reidentify" from the preferences menu.  If this mode is called, a GUI will launch to allow the user to check the line centroids and evaluate the fit manually.

The initial screen of the line ID GUI (based on x_identify from xidl) is shown below:

This screen shows a view of the order-center arc trace, with the x-axis as pixel number.  The first-round line identifications are indicated in red based on the cross-correlation procedure.

The x_identify GUI is fairly complicated (and occasionally buggy) but only a few commands are relevant for our purposes.  At any time, you can type a capital 'H' to get a summary of key commands.  Here are the most important ones for this screen:

  • Zooming in / out: To zoom in and out in the spectrum, center the cursor over the region of interest and type 'i' for in or 'o' for out.  Alternatively, you can redefine the top/bottom/right/left of the view port by positioning the cursor and typing 't', 'b', 'r', or 'l', respectively.  To zoom restore the original zoom parameters type capital 'W'.
  • Adding a line: First, make sure the correct line list is highlighted.  This should be NeAr_fire2.lst and must be included in your $XIDL_DIR/Spec/Arcs/Lists directory to work properly (if you don't have this file the GUI wil probably crash at startup...).  Then, center the mouse over an emission feature in the spectrum and left-click.  This will launch a pop-up window that allows you to specify which wavelength should be associated with this line.
  • Line ID key: A postscript plot showing the line IDs we feel give a good solution can be found here.  Note that many more lines exist in the spectrum, but in some cases these do not help the quality of fit because of blending, etc.
  • Deleting a line: Hold the cursor near the "x" that marks the offending line, and press lowercase "d".  A capital 'D' deletes ALL lines so use with care.

Once you are satisfied with your line IDs, it is time to move on to for the wavelength solution.  To launch the fit program, put the cursor or the graphics area and type capital 'F'.  This launches the interactive 1D fitting GUI, shown below:

Wavelength FIT Sub-GUI

The screen below shows an example of a first-pass wavelength fit, with pixel number on the x-axis and wavelength in y.  Note that the fitting function is highly non-linear.  This is a consequence of the wavelength dependent dispersion of the prisms, which is much stronger at the blue end of the spectrum.

In this fit, the included points are shown in green crosses, and points thrown out because of iterated deviations from the fit are shown in triangles.  The fit is shown in red.

The default fitting function is a standard polynomial; using teh bac at left this may be changed to a Legendre or Chebyshev polynomial, or a bspline.  Typically we do not use bsplines; these sometimes produce smaller residuals but can exhibit unphysical fluctuations from being insufficiently stiff.

The order of the fit may be changed using the "up" and "down" buttons, or pressing the lowercase "u" or "d" keys. 

To delete an errant point from the fit by hand, either right click or use the 'D' key (beware of confusing 'D' and 'd' in this GUI!).  A second right-click or 'D' undoes the rejection. 

You may also change the sigma thresholds for automatic rejection in the text boxes at top.  You need to press return in these windows to re-fit with new thresholds.

As in the x_identify GUI, you may zoom in to specific regions using 't', 'b', 'l', and 'r', or alternatively 's' and 's' to define a window.

Sometimes it is more instructive to view a plot of the fit residuals when judging whether to reject a point by hand.  To view a residuals plot, type capital 'R' in the 1D fitting window.  Zooming and rejection work as before.  To change back from residuals mode to the actual fit values, type capital 'V' in the residuals plot window.  A view of a residual plot is shown below.

In this fit, the included points are shown in green crosses, and points thrown out because of iterated deviations from the fit are shown in triangles.  The fit is shown in red.

The default fitting function is a standard polynomial; using teh bac at left this may be changed to a Legendre or Chebyshev polynomial, or a bspline.  Typically we do not use bsplines; these sometimes produce smaller residuals but can exhibit unphysical fluctuations from being insufficiently stiff.

The order of the fit may be changed using the "up" and "down" buttons, or pressing the lowercase "u" or "d" keys. 

To delete an errant point from the fit by hand, either right click or use the 'D' key (beware of confusing 'D' and 'd' in this GUI!).  A second right-click or 'D' undoes the rejection. 

You may also change the sigma thresholds for automatic rejection in the text boxes at top.  You need to press return in these windows to re-fit with new thresholds.

As in the x_identify GUI, you may zoom in to specific regions using 't', 'b', 'l', and 'r', or alternatively 's' and 's' to define a window.

Sometimes it is more instructive to view a plot of the fit residuals when judging whether to reject a point by hand.  To view a residuals plot, type capital 'R' in the 1D fitting window.  Zooming and rejection work as before.  To change back from residuals mode to the actual fit values, type capital 'V' in the residuals plot window.  A view of a residual plot is shown below.

When you are happy with the fit, type 'q' or click 'Done' to return to x_identify.  Now, you will see a refreshed plot of the arc trace, but now the x-axis shows wavelengths derived from your fit:

At this point, you may go back and identify more lines by hand and iterate on the 1D fit.  With your working model of the wavelength map it is also possible to have the code attempt an auto-id of all lines from the line list, although in our experience this has been spotty.  If you are satisfied with the final product type 'q' or click 'Done' to complete the wavelength fit.  For completeness, we show below a zoomed-in version of the wavelength plot to illustrate the appearance of positively identified lines.

From 1D wavelength fit to 2D wavelength Map

After you complete the 1D wavelength fit, the code projects this onto a 2D wavelength map, using information about the curvature of the slit image in detector coordinates.  As a check, the code plots up an image of the slitillustrating the quality of the slit curvature fit:

The fit is shown as black lines tracing the profile of each arc line used in the solution.  If these do not trace the curves properly there is a problem.  In this event you should try another arc exposure, and if this doesn't work, contact the instrument team for help.

You are now finished with the arc solution.  A file named Arcs/ArcImg****.fits.gz is generated in the reductions directory.  This contains the 2D wavelength map, along with additional extensions encoding information about the fits to wavelength and spatial curvature.  Time to move on to generating the flat field.

  • No labels