DEIMOS Slitmasks

There is some useful general DEIMOS information on the DEIMOS REF page.

Contents of This Site:

  • DEIMOS Slitmask News
  • How to Retrieve/Install
  • Overview
  • Fabrication Considerations
  • Mask Designs Tools
  • Mask Design Submission
  • Tracking Your Masks
  • Observer Checklist
  • How to make Guider Images from DSS

    DEIMOS Slitmask News

    19 JAN 2007: NB: Priority_Codes must be non-zero for valid target objects! Some observers have had a problem with non-milled slits due to using Priority_Code=0 for program objects. DSimulator will incorrectly allow these objects to be selected, and, once selected, will design slits for them, but the slits will not be milled!

    Think of Priority_Code as the weight of the object for selection, so zero weight [should] mean no target. This "feature" in the code will be fixed, but observers should NOT use Priority_Code=0 unless they really inderstand what it is for.

    30 JAN 2004: A serious DSIMULATOR BUG has been reported by Gyula Szokoly (and confirmed). Contrary to the documentation, the normal mode of input will ignore variable slit width and always use the default instead. This will be fixed in the next release.

    18 Dec 2002: Instructions for relinking the deimos package are now available. Also, in porting the package to a MacOSX system, I have found several small bugs which may cause problems on Linux systems (but I haven't heard of any such problems); these will all be fixed in the next release.

    24 Sept 2002: Anyone who picked up Rev 0b between Sep 20 and Sep 23 should re-install it; there were two map files which were not updated, so the guider astrometry was old, not updated as advertised!

    20 Sept 2002: The next mini-release is now available (Rev 0b); it contains several small extensions. The only modification to results is that the guider astrometry offsets are now included. Also note that the Linux version was compiled under RedHat 7.x (7.2?). Main changes:

    Update (26Aug2002): NB! The TV astrometry in the mask-design code is NO LONGER CORRECT as the DEIMOS PXL camera was moved during repairs. Alison Coil reports that offsets of +2 X and +19 Y are needed.

    Update (21Aug2002): First modified release (Redhat Linux 6.1 included) is now available. Follow instructions below.

    How to Retrieve/Install

  • 1. Retrieve the Code
    ftp		# login anonymous
    cd pub/users/phillips
    get deimos_rev0b.tar
  • 2. Make directory ("deimos") where code should go; cd there and
    tar -xvf <tarfile> 
  • 3. Edit your .cshrc or whatever 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 file to include:
    set deimos = "/<path...>/deimos/"
    task deimos = deimos$
  • 5. Start up IRAF ("cl") and type
    cl>   deimos
    You should see several tasks, the first of which is dsimulator. Typing "dsim" should give you a prompt for input file name, and you should be able to "epar dsim". At this point all should be ready.

    DEIMOS slit masks will be milled at UCO/Lick for the duration of the shared-risk period, and possibly for a short time beyond. We are still experimenting with the optimal way to fabricate these masks. In addition, the mask-design and alignment tools are not yet finished at the level we would like them to be.

    Planning: The Lick shops ask that they be given no more than 6 masks per day for milling. Thus, please plan on 1 weeks + N/6 working days (M-F), where N=number of masks, at a minimum. The Shops have also requested a minimum of 2 weeks (if this is more than the previous equation) unless special arrangements have been made in advance. This allows the Shops time to schedule the mill, fabricate the masks, and Fedex the masks to Hawaii in time for the run.


    Slitmask design is well-documented in the Software PDR and CDR documents. Briefly, relevant features are:
  • The design is specified by a "mask design file" (MDF), in this case a FITS file containing 8 specific tables. Not all information in the tables needs to be supplied, but certain fields are required.
  • MDFs are ingested into the DEIMOS database, where the information can be retrieved for mask alignment.
  • Masks are identified by a unique bar-code, readable in DEIMOS; thus, retieval of the mask information is automated.
  • The mask design tool runs in IRAF. Instructions for installing it at your site will be available. This tool will produce the correct-format MDF.

    Fabrication Considerations

    There are several items to keep in mind regarding slitmask fabrication. First, it takes some time to mill each mask, and the Lick shops request no more than 6 masks per day. In addition, the shops request 1 week for mailing the finished masks to Hawaii in time for each run.

    Second, there is a minimum slit width that can be milled with a given endmill. Due to various limitations, the shops strongly prefer to use 0.015-inch-diam ("15 thou") endmills. As the plate scale is 0.728 mm/arcsec, this places an absolute minimum of 0.524 arcsec on the available slitwidth; however, if tilted slits are used, the minimum in the dispersion direction is inreased by 1./cos(theta), where theta is the PA difference of the slit wrt the mask PA.

    In addition, it is good to bear in mind that the slitlets are actually milled in a multi-pass manner at present, producing a relieved pocket around each slitlet, and allowing a clean-up cut to be made along the edge of each slitlet. The width of that clean-up cut must be factored into the effective endmill diameter if the user wishes it to be made (strongly advised); this width is currently set to 0.038 mm (each side), so the effective diameter of the endmill is 20% larger.

    Requests for endmills other than the preferred (15 thou) size requires code development and debugging and such requests will only be accepted by special arrangement.

    DEIMOS slitmask slitlet Magnified view of DEIMOS slitlet, showing actual slitlet and relieved pocket. The pocket is cut without an additional cleanup cut, and thus is significantly rougher than the actual slitlet cut. The slitlet in this case was cut (experimentally) with a 12-thou endmill, and is 0.6 arcsec wide.

    DEIMOS Slitmask milling Steve Allen watches a DEIMOS slitmask being milled at the UCO/Lick shops.

    DEIMOS Slitmask milling -- closeup Closeup of the high-speed mill cutting slitlets.

    Mask Design Tools: DSIMULATOR

  • Input Parameters
  • Input File Format
  • Guide Stars, Alignment Stars/Boxes
  • Current limitations of DSIMULATOR
  • Running DSIMULATOR
  • Known Bugs

    ** Input Parameters

    Here is a list of the IRAF input parameters (more detail later):
        objfile = "t1103.sim"     input file of targets
         output = "draco1.list"   output list selected/non-selected
            mdf = "draco1.fits    Mask Design File (FITS)
      (plotfile = "draco.mng")    (opt) plotfile [Mongo commands]
           (ra0 = 0.005)          Initial RA of field (hr)
          (dec0 = 0.)             Initial Dec of field (deg)
           (PA0 = 180.)           Initial PA of field (deg)
       (equinox = 2000.)          Equinox of coordinates
           (ha0 = -1.5)           Initial Hour Angle (hr)
      (min_slit = 8.)             Minimum slit length (arcsec)
      (sep_slit = 0.5)            Separation between slits (arcsec)
    (slit_width = 0.75)           Width of slit (arcsec)
        (box_sz = 4.)             Alignment box size (arcsec)
          (blue = 5000.)          Shortest wavelength of interest [NOT USED]
           (red = 9000.)          Longest wavelength of interest [NOT USED]
      (proj_len = no)             Project slit length to preserve in spatial directi
    (no_overlap = yes)            Adjust slit lengths to avoid overlap? (YES)
    (std_format = yes)            Is input standard text format?
    (lambda_cen = 7500.)          wavelength for refraction
          (temp = 0.)             Air temp (C)
      (pressure = 620.)           Air pressure (millibars==hPa)
        (author = "Drew Phillips <>") Designer of Mask (name <email>)
      (observer = "Sandy Faber <>")   Observer (name <email>)
       (project = "Astrometry--Commissioning")       Project name
        (maskid = "Draco_Astrometry_1")              Full Name of Mask
       (guiname = "DRACO1")       Name of Mask for GUI (6 char or less, no whitespace)
       (dateobs = "2002-07-03")   Date of intended use (YYYY-MM-DD)

    ra0, dec0, equinox and PA0 may be entered via the input file (see below).

    ** Input File Format

    Input files are whitespace-delimited TEXT, one line per target. There are 7 required fields followed by several optional fields. ( Example )

    Required Fields:

  • Object Name -- (char. string) currently limited to 16 characters. For obvious reasons, no whitespace in names.
  • RA -- (real) hh:mm:ss.sss
  • Dec -- (real)
  • Equinox -- (real) eg., 2000; currently there is no provision for precession, but this could be added on short notice if needed
  • Magnitude -- (real) eg., 21.99
  • PassBand -- (char) eg., V; currently truncated to one character
  • Priority_Code -- (int) as follows: (NB: Program objects should have PCODE > 0. There is a bug/feature 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. This will be fixed, but in the meantime users should avoid using PCODE=0, or should carefully check that the results are as expected.)

    Optional Fields (order is important):

  • Sample -- (int) 1, 2, 3, etc. Sample to which 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
  • Select Flag -- (int) 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 eg, a set of useful alignment stars. Default = 0
  • PA_slit -- (real) PA of slit in degrees; default = non-tilted. If PA should match that of the mask, you may force this by specifying INDEF
  • Len1 -- (real) requested length above object (in direction of PA) in arcsec; default set by parameters
  • Len2 -- (real) requested length below object (opposite PA) in arcsec; default set by parameters
  • ******** NB: THE FOLLOWING IS NOT FUNCTIONING! see news 31jan2004 above: ********
  • SlitWidth -- (real) slit width in arcsec; default set by parameters. Note that final minimum value is determined mechanically by the size of the tool-bit used in milling, so be reasonable in choosing this value. The shops are currently using 15-thou end mills (that's 0.015 inch diam) with an additional 2-3 thou milled off each edge in a clean-up pass. Thus, non-tilted slits will can be no smaller than 0.5 mm, or about 0.7 arcsec. The minimum tilted slit will be larger by secant (del-PA). [These values subject to change]

    There is currently no plan to calculate proper motion in the mask design tool.

    Optional field center line: RA, Dec, standard_equinox and PA for the overall mask may be entered as the first non-commented line of the input file, provided it is of the form:

    Name       RA    Dec    Equinox   PA=xxxx
    The "PA=" is required to identify this unique entry, and cannot be followed by whitespace. Notice that "Name" on this line is ignored. The coordinates refer to the mask center, defined at x=0 and y=4.5 arcmin from the telescope center.

    ** Guide Stars, Alignment Stars / Boxes

    We strongly encourage users to align their masks via alignment stars and boxes. Current thinking is that alignment boxes should be 4" square and stars should be 15 < R < 20 for good transparency and average seeing. We strongly recommend choosing at least 2 stars toward each end of the mask, ie., at least 4 stars.

    (In designing masks, we recommend identifying suitable alignment and guide stars and pre-selecting them in the input list.)

    Alignment software (xbox) for DEIMOS has been tested and is being installed at Keck. Note that we have seen somewhat slow convergence during alignments, which we believe has to do with telescope pointing errors during small offsets. This is currently under investigation. However, there is some anecdotal evidence that _brighter_ guide stars make this process more secure. If you can put a star with R=16 on the guider mirror, do it! Also, note that there is significant vignetting in the guide camera away from the center, and that the light reflected off the slitmask is significantly less than that reflected off the guider mirror.

    To aid the alignment process, the slit-mask design tool outputs the expected guider coordinates of any object labeled "guide_star". These should be noted and brought to the telescope. [Currently needs updated mapping; astrometric analysis in progress.]

    ** Current limitations of DSIMULATOR

    There are several shortcomings to the early release version. These include:
    • Included executables (as of 08aug) are for Solaris only; I will fix this tomorrow to add at least a redhat-linux version.
    • There is no "help page"; all the documentation is in these web pages.
    • There is no option for editing of target list within the program. Thus, any changes to PA, requested length, Pcode, etc must be done outside the program on the input file.
    • There is no option for editing of slits within the program. Thus, if you don't like the way a slit-conflict is resolved, you must go back to the input list and adjust the requested slit lengths there.
    • There is currently no "flagging" of conflicts -- the user needs to inspect the interactive display to see if requested slit-lengths have been badly truncated.
    • The hardcopy plot comes out in MONGO -- sorry about that, but it's what many of us use in Santa Cruz. I will later change this to igi, so anyone with IRAF/STSDAS can make hardcopies.

    ** Running DSIMULATOR

    I strongly recommend that DSIMULATOR be run on an xgterm, and that the window be expanded as large as feasible.

    When dsimulator is invoked, the target list is read in and the targets are displayed over a mask outline. Various colors are used to denote different target classes and states:

    click for PS

    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:

    click for PS

    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

    [09Aug: I will try to give more details on these keystroke commands shortly...]

    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:

    click for PS

    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.

    click for PS

    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, eg, 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.

    ** Known Bugs

    I'll attempt to keep this list current; please, please report bugs to me at -- thanks!
    • Rev 0:
      • 09aug: The RA and Dec in the optional plotfile are wrong (a conversion from radians is missing) fixed in rev0a
      • 19aug: The IRAF version at the deimos-package start-up is wrong -- it should be IRAF 2.11.3 (and the software is supported now ...) fixed in rev0a
    • Rev 0a:
      • It has been reported that the Linux binaries will not work on earlier versions of Redhat linux. fixed? rebuilt on RH_6.1 Aug 21
    • Rev 0b:
      • Slit widths are all set to the DEFAULT input parameter value in the "standard format" mode.
      • 19jan07: PCODE=0 is not being treated consistently by the software.

    Mask Design Submission

    Mask-Design-Files (MDFs) are currently submitted via a
    Web Form. Masks will be milled automatically after they are successfully ingested in the database. This path is currently under development; although it is working, there are a few rough corners.

    In brief, select the MDF to be submitted and hit "Send"; then hit "Sanity" and the file will be checked for any syntax errors -- there should be none, and you will see "ALL IS WELL" printed toward the bottom. Then hit "Ingest" to place the file's information into the database. You must go through all these steps; it's currently a bit painful but we are working on streamlining it.

    NB: All mask authors, observers and submitters must be recognized by the database -- you must go to the above link and "introduce" yourself (and relevant others) before attempting to submit MDFs. This is a one-time effort. Also, access to the mask submission pages is only granted to approved sites/networks. Even after you have registered as a mask user, you will not be able to access the mask submission pages from any random host -- only from hosts on approved networks. To request that your home institution be added to the list of approved networks (if it is not one already), send mail to

    Slitmask status and inventory can be monitored through the same URL.

    Tracking Your Masks

    As noted above, slitmask fabrication status can be monitored using the
    Web Form. Once barcodes are assigned, you can verify they have been shipped from UCO/Lick and received at Keck via the following site:

    Observer Checklist

    This is not a comprehensive checklist for designing slitmasks, but rather items that are of crucial importance for success at the telescope.
    • Starlists: Copy the 2nd line of each output file into a starlist file; then edit the file to replace the colons with spaces. One way to do this (in IRAF):
      de>  concat *<output_files> | match "PA=" > starlist
      de>  edit starlist
      or in UNIX:
      >  cat *<output_files> | grep "PA=" > starlist
      >  vi starlist
      Then copy this file to your Keck account. (Doing this operation precludes transcription errors in making the starlist.)

    • Guide Stars: Your mask designs should contain at least one known suitable guide star to aid in slitmask alignment. (It is possible to align without such a star, but it is much, much more time consuming. Also, it's good to know there's a suitable star for guiding in each field!)

    • Finding Charts: It is imperative that observers bring some kind of finding charts to the telescope. The optional plotfile from DSIMULATOR is useful as it contains the coordinates and a sketch of the TV field. This plot and a DSS finding chart of the guider field is perfectly adequate. You should be able to instantly verify the field and quickly position the telescope to within an arcsec of the correct alignment.

    Date: Wed, 7 Aug 2002 14:26:50 -0700
    From: Steve Allen 
    To: "Andrew C. Phillips" 
    Subject: DSIMULATOR
    every time I see DSIMULATOR I read  
    Fortunately I am somehow spared a contemplation of the other three
    ancient humors.

    Last modified: 19jan2007

    Andrew C. Phillips / Lick Observatory