IMPORTANT NOTES:

Background

DEIMOS observers design custom slitmasks using the DSIMULATOR software package developed at UCO by Drew Phillips. The software runs within the IRAF environment. Given a list of possible targets, you will use DSIMULATOR interactively to select a set of science targets and distribute slits across your mask so that the spectra will not overlap. You will also identify two sets of stars to be used for mask alignment:

DSIMULATOR generates several kinds of output, including:

This document gives some basic information about the DSIMULATOR package. Full information is available on the UCO DEIMOS Slitmasks page.

Installation

Basic installation

Follow these steps to download and install the DSIMULATOR software:
  1. Download the tarball containing DSIMULATOR from this link or this link.
  2. Create a directory ("deimos") where the code should go. Change to that directory and unpack the tarball using the command:
    	tar -xvf tarfile 
  3. Edit your .cshrc to include the following line:
    	setenv deimos /path.../deimos/
    You may need to source the file in order to get the environment variable set.
  4. Edit your IRAF loginuser.cl file to add these lines:
    	set deimos = "/path.../deimos/"
    	task deimos = deimos$deimos.cl
    In some cases it may be necessary to add the previous lines to your login.cl instead of the loginuser.cl.

Install instructions for Linux computers with Pyraf

This install solution has been kindly provided by Anja von der Linden. This should work in Linux machines with an independent Pyraf install.

Link the file:

deimos$/bin.redhat/x_deimos.e
into
deimos$/src/

Once this is done, you should be able to run dsimulator from a Pyraf prompt.

Install instructions for Mac computers with Ureka 1.5.1

These install instructions have been kindly provided by Marusa Bradac and it has been tested with the IRAF/Pyraf distribution included in the Ureka astronomy software collection (v1.5.1) on Mac OSX El Capitan version 10.11.3.

  1. Delete (or rename) the file x_deimos.o from the directory path_to_dsimulator/src
  2. Delete (or rename) the file libcfitsio.a from the directory path_to_dsimulator/cfitsio
  3. In the directory path_to_dsimulator/cfitsio, create a soft link to the libcfitsio.a in the Ureka distribution:
    	  cd path_to_dsimulator/cfitsio
    	  ln -s path_to_Ureka/variants/common/iraf/fitsutil/bin.macosx/libcfitsio.a ./libcfitsio.a
    	
  4. Delete (or rename) the file libpkg.a from the directory path_to_dsimulator/src
  5. In the directory path_to_dsimulator/src, create a soft link to the libpkg.a in the Ureka distribution:
    	  cd path_to_dsimulator/src
    	  ln -s path_to_Ureka/iraf/pkg/cl/libpkg.a ./libpkg.a
    	
  6. Delete (or rename) the file zzsetenv.def from the directory path_to_dsimulator/lib
  7. In the directory path_to_dsimulator/lib, create a soft link to the zzsetenv.def in the Ureka distribution:
    	  cd path_to_dsimulator/lib
    	  ln -s path_to_Ureka/iraf/local/lib/zzsetenv.def ./zzsetenv.def
    	
  8. Make sure that the mkppg is from the Ureka distribution:
    	  which mkpkg
    	
    should show:
    	  path_to_Ureka/bin/mkpkg
    	
  9. Compile from the path_to_dsimulator/src directory using the mkppg is from Ureka:
    	  cd path_to_dsimulator/src
    	  mkpkg -p deimos
    	
  10. In the directory path_to_dsimulator/src:
    	  cp xx_deimos.e x_deimos.e
    	
  11. Before running the software, execute the Ureka setup script in the terminal where you are going to start IRAF/Pyraf:
    	  ur_setup
    	
Note: If you have problems to compile the package with mkpkg, try copying this version of x_deimos.e in your path_to_dsimulator/src, execute ur_setup and follow the instructions below to run the software.

Running the software

Launch either IRAF or Pyraf and type:
deimos
You should see several tasks, the first of which is:
dsimulator
Typing:
epar dsim
should show the list of parameters.

Target List

The key input for DSIMULATOR is the catalog of possible targets. You will supply this catalog in the form of an ASCII file with one line per target. There are 7 required fields followed by several optional fields, as shown in this sample intput catalog.

DSIMULATOR input file format
Column Field Description Datatype Units Example
Required Fields
1 Object Name Currently limited to 16 characters.
No whitespace allowed.
string   Cl0016+16_gal276
2 RA Right Ascension real sexagesimal hours 00:16:00.000
3 Dec Declination real sexagesimal degrees +16:00:00.00
4 Equinox Equinox of RA/Dec coordinates real year 2000.0
5 Magnitude Brightness of target real mag 21.50
6 Passband Filter in which the brightness was measured string   V
7 Pcode Priority code: indicates target type and relative weighting of science targets as indicated below. integer   1000
Optional Fields
8 Sample Sample to which the object belongs. When auto-selecting, objects in Sample 1 are selected first; remaining space is then filled with Sample 2, then Sample 3, etc. Default=1. integer   1
9 Select Flag indicating whether to pre-select the target. If non-zero, object is pre-selected. This is useful for objects that you definitely want to appear on the mask, eg, extremely high-priority objects, or e.g., a set of useful alignment stars. Default=0. integer   0
10 SlitPA Position angle of the slit real degrees 180.00
11 Len1 Requested length above object (in direction of PA) real arcsec 4.0
12 Len2 Requested length below object (opposite to PA) real arcsec 4.0
13 SlitWidth Desired slit width. Not implemented, so this value is ignored. Slit width is set globally by the input parameters. real arcsec 1.5

Priority codes

Program objects should have PCODE>0. There is a bug/ that currently allows slits to be put over PCODE=0 objects, if no others are available in the area for selection, but these slits will not be milled. Avoid using PCODE=0, or carefully check that the results are as expected.

Priority codes cannot be changed within dsimulator. For instance, stars initially flagged as guide stars cannot become alignment stars and vice versa.

Optional field center line

You can establish an initial mask center by including a field center line in at the top of your input file. Enter RA, Dec, standard_equinox and PA as the first non-commented line of the input file. The format is:
	Name       RA    Dec    Equinox   PA=xxxx

Notes

Mask design considerations

Selecting coarse alignment stars

Coarse (initial) alignment of the DEIMOS mask on-sky is accomplished by identifying one of your coarse alignment stars on the DEIMOS guider and placing it at the position indicated on the finder chart you'll generate at Keck using the deimos_guider_dss software.

DEIMOS observers must consider these characteristics when selecting guide stars:

The same stars used for coarse alignment will also be used for guiding, so if you can't locate any good stars for alignment you may not be able to observe the mask at all. If you need to find more stars, you can either change the mask center or rotate to a different PA (e.g., change by 180 to access the same set of targets).

Selecting fine alignment stars

Fine alignment of the DEIMOS mask with the science targets is accomplished by centering selected stars within square alignment boxes milled into the slitmask. By default, DSIMULATOR will create boxes of size 4×4 arcsec, and you should use this recommended size. Further recommendations:

Slit width constraints

Please note the following factors which constrain your choice of slit width and slit orientation:

DSIMULATOR Task Parameters

The DSIMULATOR task in IRAF task offers the following user parameters:
      objfile = "mask_ex1.txt"  input file of targets
       output = "mask_ex2.lst"  output list selected/non-selected
          mdf = "mask_ex2.fits" Mask Design File (FITS)
  zoom_factor = 0.0             [zoom_factor]
    (plotfile = "mask_ex2.mng") (opt) plotfile
         (ra0 = 14.2637033333)  Initial RA of field
        (dec0 = 25.0395388889)  Initial Dec of field
         (PA0 = 30.0)           Initial PA of field
     (equinox = 2000.0)         Equinox of coordinates
         (ha0 = -2.0)           Initial Hour Angle
    (min_slit = 10.0)           Minimum slit length (arcsec)
    (sep_slit = 0.35)           Separation between slits (arcsec)
  (slit_width = 1.0)            Width of slit (arcsec)
      (box_sz = 4.0)            Alignment box size (arcsec)
        (blue = 5000.0)         Shortest wavelength of interest
         (red = 9000.0)         Longest wavelength of interest
    (proj_len = no)             Project slit length to preserve in spatial direction?
  (no_overlap = yes)            Adjust slit lengths to avoid overlap? (YES)
  (std_format = yes)            Is input standard text format?
  (lambda_cen = 7500.0)         wavelength for refraction
        (temp = 0.0)            Air temp (C)
    (pressure = 615.0)          Air pressure (millibars==hPa)
      (maskid = "Example_Mask_2") Full Name of Mask
     (guiname = "ExMsk2")       Name of Mask for GUI (6 char or less)
     (dateobs = "2016-07-15")   Date of intended use (YYYY-MM-DD)
      (author = "Carlos Alvarez ") Designer of Mask (name )
    (observer = "Carlos Alvarez ") Observer (name )
     (project = "Test")         Project name

Note

Running DSIMULATOR

User interface

When you run DSIMUALTOR, the program will read the specified target list and display the targets over a mask outline. It uses various colors to denote different target classes and states:

It is important to note that the upper part of the mask has a semi-circular vignetted region that is not shown in DSIMULATOR.

Mask blueprint available in the Slimask Database after mask submission. Note the semi-circular vignetted region in the central-upper part of the mask, depicted with a dotted blue line. Slits should not be placed in the vignetted area during the design phase.

Also, note the information box. In addition to the standard DEIMOS axes and a compass rose, there is a section of slit (with default slit-width) shown along with a "dispersed" image, at min, central and max wavelengths. For convenience, the seeing disk plotted is the same as the slit-width. This information is useful for deciding acceptable mask PAs to avoid large slit-losses from atmospheric dispersion:

Keystroke commands

Keystrokes are used for positioning the mask; adding, deleting and auto-selecting targets; and generating slits. To see available options, type ?:
DSIMULATOR Command Summary:
 
     hjkl     translate mask (1" x speed) in the usual vi ways
     p/n      rotate mask (1 deg x speed) in a Pos/Neg sense
      .       cycle through speeds (10, 1, 0.1) for pnhjkl keys
      z       zoom (by abs factor; also 0 reset, -1,...,-5 for CCD1-4,TV fields)
      a       Add a target
      d       Delete a target
      r       Redraw
      i       Clear (initialize) the list of ALL selected objects
      s       Select workable set of objects
      g       generate slits to go over selected targets.
   <space>    print input line of nearest object
      ?       print this list
      q       quit
      I       interrupt task immediately

Procedure

Quick summary of basic mask design

  1. edit the parameter file for dsim: epar dsimulator
  2. Press s to select a starting set of targets
  3. us the key board commands above to fine tune target selection.
  4. Press g to generate slits
  5. Press q to quit

Details

In normal operation, the user first positions the mask on the sky using the translation commands (h j k l, in the usual vi sense, to move the mask on the sky) and rotation commands (p n, for position and negative rotations). The size of these moves is controlled by '.', which cycles through fast/medium/slow speeds (ie, large, medium, small steps).

Next, an "auto-select" ('s') is usually done, as this will try to maximize the sum of the object priorities without creating any overlap conflicts. The user may add ('a') or delete ('d') targets. "Space bar" will print information about the target nearest the cursor. Also useful here is the 'z' command, which replots the data centered on the cursor with the absolute zoom factor specified. There are also some special values defined: zoom_factor = 0 replots at normal scale; -1, -2, -3, -4 and -5 zoom in on the sections for CCDs 1, 2, 3, 4 and the TV field, respectively. The standard plot buffer commands, such as Z, P, E, etc are also useful.

Make sure that alignment stars and at least one suitable guide star are selected!

When the target selection is made, type 'g' to generate the slits, which will be overplotted in cyan:

By default, slits are lengthened to where they nearly touch each other (the slit separation is a parameter, for which 0.5 arcsec is currently recommended). In cases where overlap would occur, by default the slits are shortened to avoid overlap. In the plots, both the object (drawn to show the requested slit length) and the slit appear, so it is immediately apparent whether slits have been lengthened or truncated.

You can add and delete objects after slits have been generated; just do another 'g' after the desired modifications. Note that all selected objects will be given a slit, but slits may be badly truncated for objects very close to one another. Also, avoid allowing slits to be lengthened too much (say over 100 arcsec) -- really long slits may weaken the mask and cause a jam upon insertion. In these cases, it is best to create some new targets in empty regions and add them to the input list; these can be randomly-placed sky slits.

The final step is 'q' to quit, at which point the MDF FITS file is generated, as well as the output text file and the optional plot file. Note that the output text file has four sections:

  1. Mask center (with Guide Field center)
  2. Selected targets
  3. TV guide objects, including guider coordinates*
  4. Non-selected targets

These are all (* the TV section is commented out) in the same format required for input, so it is easy for the user to, e.g., contruct new input lists with only objects that have not been selected. The first object is recognized as the field center if it has a field "PA=nnn" in place of magnitude. Note that this line is also properly formated for the Keck starlist, provided the colons are replaced with spaces.

Mask submission

After designing your slitmasks, you can submit them for milling.