Login

Page Last Updated : Apr 18 12:23
Front Page Help  |  Recent Changes  |  Orphans Make Dir  |  Edit This Page  |  Attach File Set Access

Introduction

MMIRS slit masks are laser cut into anodized aluminum sheets. "xfitmask" is the software used to generate the mask files used to prepare the final design file that gets cut into a mask. This software must be run by observers, by downloading a binary distribution to a compatible 64-bit linux box (details below). This download is a quick and simple process that does not require any building. If you do not have access to a compatible computer, please contact Brian McLeod about getting a short-term (*4-week*) CF guest account on the Center for Astrophysics (CfA) system.

The final cost is approximately $300/mask. Billing will not be to your institution. Instead, you will be billed for mask costs along with your room and board costs for the observing run (which can now be paid via credit card on site). Reimbursement of mask costs should be handled by individual observers and their host institutions.

Summary of New Features in xfitmask for 2013A

  1. Rotator limits adjusted for Magellan:

  2. Grism and Filter selection update:

  3. Overlapping projected spectra are now checked when both slits are alignment boxes.

  4. Version Compatibility:

Mask Preparation Procedure

================

Prepare Inputs

================

  1. Choose a rootname for each field

  2. Prepare an input catalog

    The input catalog needs to have relative astrometry good to at least 0.2" and absolute astrometry good to within 1-2", so the alignment stars end up in their holes the first time around. The format of this input catalog is a starbase table [2] with the following tab-delimited columns:

    ra (J2000) HH:MM:SS.sss
    dec (J2000) DD:MM:SS.ss
    object (name of the target)
    rank (1=must do; 2-5=high priority; 6-10=lower priority)
    type (TARGET, for a target, or BOX, for an alignment star)
    
    Here is an example file showing the correct format: short.targets. Additional columns (e.g. magnitude) are permitted and will be ignored. Alignment stars should have H mags between about 13 and 17. The name of the targets file must be <root>.targets.

    NOTE: If you are not familiar with starbase, there is lots of information here: [3]

    The input catalog must specify:

    Optionally, you may also specify the height and width of slits on a target-by-target basis by including columns called "height" and/or "width" in your targets file. If you include these columns, you must include their values for every TARGET line.

  3. Prepare a list of field centers

    a. Simplest case: a single field center. This center must be stored in a starbase table named <root>.center For example: short.center. The program will optimize over rotation angle using this center position.

    b. Multiple overlapping masks, each at a fixed center position. In this case you would create multiple center position files, named <root>.center<N> each with a single entry. In theory you can optimize over position angles on each slit simultaneously, but this will take 360(raised to N) optimizations, where N is the number of masks. In practice you can optimize only N=2.

    A more practical approach is as follows:

    If you have multiple overlapping masks, you might want to allow objects to be duplicated onto a second mask if no other object would taken that spot on the mask. This can be accomplished by putting duplicate entries in your targets catalog and reducing the priority of the duplicates.

    c. Optimize a single mask over a grid of positions. For this case, you will use a single centers file with multiple lines. Each position will be checked for all rotation angles.

    d. Optimize multiple masks over a grid of positions. As in b), you will have multiple files, but now each will have multiple lines. The optimizer will check all combinations of the center files. So if you have 4 positions in each file, a total of 16 position combinations will be checked, each at 360 different position angles.

  4. Optionally supply a FITS file of your field with a WCS that matches your catalog.

    If you don't supply a FITS file, then xfitmask will download an image from the DSS. The name of the fits must be rootname.fits. Sometimes the xfitmask program tries to load the dss image before it is completely flushed and you might get an error. Check to see that the fits file was loaded (and saved in your current directory) and re-try the "CreateMask" button.

  5. Verify that your input files are in valid starbase format using the "check" program:, where "rootname" is the name of your .targets and .center file.

    check -v < rootname.targets

    check -v < rootname.center

    This routine will print out any lines in the files that do not conform to proper starbase format. Since starbase is all about "tab" whitespace, this tool will help you find whitespace issues which are difficult to see. Blank lines at the end of these files are also not allowed.

    If all is well, check will just return silently.

=========================================

Install and try out the xfitmask package

=========================================

Currently we have only a binary distribution for Linux (Fedora or Ubuntu) 64-bit. If you do not have access to a compatible machine you will need to contact Brian McLeod to set up a short-term CF guest account on the CfA computer system for the purpose of mask design.

  1. Download the xfitmask tar file and unpack in <fitpath>: fitmaskexport2013A.tgz.

    Note: <fitpath> can be any directory you like.

    NOTES FOR UBUNTU USERS:

    You do not need a separate xfitmask distribution; you only need to use the provided bin.ubuntu directory as your ./bin.

    ./bin is linked by default to bin.redhat; to change this to use the correct Ubuntu ./bin, simply remove the "bin" link and recreate, it as follows:

    rm bin
    ln -s bin.ubuntu bin
    

    Ubuntu users will now also need to add the following link in the fitmask/bin directory (this will be fixed in the next release.)

    cd bin
    ln -s column check
    

    You only need to do these things once.

  2. Start a fresh shell: Your path will be altered by the configuration file. You can exit the shell when you are done and restore your normal environment.

    sh (or tcsh or csh or bash)
    

  3. Configure the runtime environment: Move to the <fitpath>/fitmask directory (cd <fitpath>/fitmask) and configure the runtime environment by typing (for bash/sh users)

    source .fitmaskrc
    
    or typing (for csh/tcsh users)

    source .fitmaskrc.cshrc
    

    The distribution includes the required starbase programs as well as a copy of ds9. This configuration alters your default path to ensure you are using the distributed versions rather than any local versions.

  4. Test the installation using the Example subdirectory

    cd Example
    ./doclean
    xfitmask exampl exampl.center
    

=======================================

Run the Mask Fitting Software xfitmask

=======================================

  1. Start a fresh shell (if you haven't above) Your path will be altered by the configuration file. You can exit the shell when you are done and restore your normal environment.

    sh (or tcsh or csh or bash)
    

  2. Configure the runtime environment (if you haven't above) Move to the fitmask directory (cd <fitpath>/fitmask) and typing
    source .fitmaskrc
    

  3. Bring up the "xfitmask" GUI

  4. Configure the GUI Parameters

    Fill in the date of your observation in the Date field, in the form Mon DD HH:MM:SS YYYY, e.g. Jun 18 12:00:00 2013. The default date shown is the start of the upcoming MMIRS run, or the last date used if you have already run this mask. NOTE: ALL 4 DATE ELEMENTS ARE REQUIRED, or you will get a syntax error. xfitmask will also warn you if you enter a date that is before the current year or after the end of the upcoming MMIRS run, but you can continue if you do want to do this.

    Wait a moment and the program will fill in the time when your target becomes observable (*Rise*), the time it transits (*Transit*), and the time it ceases to be observable (*Set*). A target is observable when it is above 30 deg. elevation and the sun is more than 12 degrees below the horizon. The Airmass is also shown for Rise, Transit, and Set.

    A default Start time and a maximum duration (*Minutes*) will also be filled in every time that you enter a new "Date". xfitmask will ensure that the rotator remains within range for the duration of your observation. If you want to ensure that your mask is usable the entire time that the target is observable, use the Rise time for the Start time and (*Set* - Rise) time for the duration. Alternatively, if you intend to limit yourself to a shorter observation period, you can specify a more restrictive start and duration by altering the Start field (Mon DD HH:MM YYYY) and Minutes duration of your observation. This could potentially give you better target matching as more position angles will be tried. We recommend starting with the longest possible observation window.

    Additional parameters:

    Filters and Grisms:

  5. Press "Fit" to start the fit process:

  6. Display the results and create the complete mask:

    Click on "CreateMask" to display the results from the selected row of the configuration list and create the complete mask for the selected fit. Again, the mask will be overlaid on a ds9 window and the resulting mask file will be displayed in a new window. As before, if you click on a particular line in the mask file, the corresponding target will be highlighted in the ds9 window.

    The targets are color coded in the ds9 display as follows:

  7. Guide and WaveFrontSensor(WFS) geometry

    The ds9 overlay file shows the geometry of the instrument. The 4'x7' IR array is drawn in the center - with the requested slits and alignment boxes shown.

    Outside this box are two nested "wfs camera" regions, 1 and 2, on either side of the center array. To ensure accurate and stable alignment there must be a valid star in each of the 2 cameras. One camera/star will be used for simple guiding and the other camera/star will be used for guiding+wave-front sensing (WFS) during the observation.

    The criteria for the WFS star are stricter than for the guide star. The WFS star must be 12<R<14.5, whereas the guide star can be fainter with 12<R<16). Also the WFS star must be in the inner region of the wfs camera outline. The Guide star can be in either the inner or outer region of the wfs camera.

    It has been determined that the optics from camera1 are not as good as from camera2, so it is preferred to have the WFS star on camera2 if at all possible. The fitting software should ensure the availability of appropriate stars - but it does _not_ ensure that the WFS star is in camera 1.

  8. Verify the alignment boxes

    The alignment boxes must have unambiguous stars in them.

    Also, verify that there are at least 4 alignment boxes and that they are not all clustered together in one part of the mask; they should be spread out over the mask as much as possible.

    Finally, verify that none of the alignment boxes are also targets (they should only have purple circles around them. Even if a box is also a target, it will still be cut as a box.

  9. Verify the slits for the selected targets

    Confirm that the target is in the slit (you may need to overlay a catalog in DS9).

  10. Verify the alignment, guide and WFS stars

  11. Iterate as needed

  12. The parameters of the last fit run are saved, so if you return to the same directory and restart xfitmask with the same targets, it will remember the parameter selections from the last run. To start from scratch, delete all the files except the .targets, .centerN, and .fits files. If you don't want to delete the files, simply copy the .targets, .centerN, and .fits files to another directory and run xfitmask there.

    NOTE: it's a good idea to do this (start fresh) if you are having difficulty getting the results you want.

  13. WARNING

    ALWAYS, ALWAYS, ALWAYS press CreateMask as the last action at the end of each mask design and then exit the software. xfitmask will warn you if you try to exit without doing this. This will ensure that the a complete set of mask files is saved for the fit you really want. If you fail to do this then the final msk file may _not_ match the design file that is manufactured, presenting problems at the telescope. The results of the most recent CreateMask are saved in the ./CompleteMask subdirectory of the current directory.

  14. Summary of mask vetting criteria:

  15. Exit the current shell when done with xfitmask

This will restore your normal path and environment.

exit

===========================

Deliver Final Mask Designs

===========================

  1. Please email your final .msk file(s) to Dave Osip at LCO: dosip at lco.cl. The .dxf file will be emailed back to you.

  2. We recommend that you save the rest of the files associated with your mask by copying ./CompleteMask to somewhere safe and memorable for you. If there are any problems with your mask during observation that might be related to xfitmask, these files can be extremely helpful to CfA for debugging.

============================

Feedback

=================================

Troubleshooting

==========================================================

If You Have Problems Making Masks: Sending Files to CfA

==========================================================

  1. Collect all the files used to create the final masks

    If you have problems making your mask(s), it will help Anne debug the problem if you send her all the files as follows:

    xfittar root [ ... rootN ]
    

  2. Submit the files to the CfA

    The above tar files should be deposited on the CfA's incoming anonymous ftp account:

    ftp cfa-ftp.harvard.edu
    Name: anonymous
    Passwd: 
    ftp> cd incoming
    ftp> mkdir yourname
    ftp> cd yourname
    ftp> put yourfiles
    ftp> quit
    

    If you resubmit a file you will need to rename it, as files cannot be overwritten on the ftp server.

  3. Notify us of the files via email

    Send an email with the ftp directory and filenames to:

    along with a contact email address in case we need further information concerning the mask designs.

============================================================================

Troubleshooting

============================================================================

Creating specialty slit shapes

===============================

NOT CURRENTLY SUPPORTED. THIS SECTION NEEDS TO BE UPDATED.

Fitmask can handle slit shaped defined by arbitrary polygons. The simplest way to create a slit to mask a unique astronomical feature that you would like to target is to draw a region around an image of the target in ds9.

  1. Obtain an image of the target area with has suitably accurate WCS.
  2. Display your input catalog on ds9 as a region. Check that your alignment box stars are correctly overlaid on the image.
  3. Delete all the regions.
  4. Create a single circle region at the "center" of the target feature. This circle will be used as the zero point of a relative polygon definition.
  5. Create a single polygon region that outlines the slit feature.
  6. Run "reg2fitpoly". This program reads the two regions defined above and outputs a fitmask input catalog with one custom slit target.

    	$ reg2fitpoly ds9 xxx Arc
    

Custom slit target example:


Arc	-1.9800000001168883	0.32291999999909393	-0.5039999999553402	4.7019599999995165	1.9079999998893982	7.579440000000126	12.1679999999742	14.943960000000267	13.17599999988488	14.943960000000267	2.9519999999138236	7.579440000000126	0.5399999998644489	4.7019599999995165	-1.0080000001153167	0.32291999999909393	-0.46800000004623143	-4.754880000000838	1.1879999998654966	-7.842240000000089	6.228000000032807	-15.115680000000609	5.291999999940344	-15.115680000000609	0.1799999999548163	-7.842240000000089	-1.4040000001386943	-4.754880000000838

ra         	dec        	type
--         	---        	----
22:47:11.701	-02:05:38.18	Arc

Using an editor merge your alignment star catalog with the custom slit catalog. You can also create duplicate target rows of type "Arc" (or whatever) to place your custom slit at different positions on the mask.


Attachment Author Date Size Actions
fitmaskexport.tgz mo [c/o] 08-24-2010 12M Delete
fitmaskexport.ubuntu.2010-08-07.tgz mo [c/o] 08-07-2010 15M Delete
fitmaskexport.ubuntu.2010-08-16.tgz mo 08-16-2010 13M Delete
fitmaskexport.ubuntu.2010-08-19.tgz mo 08-19-2010 13M Delete
fitmaskexport.ubuntu.2010-08-24.tgz mo 08-24-2010 13M Delete
fitmaskexport2011A.tgz amatthew 04-07-2011 26M Delete
fitmaskexport2011B.tgz amatthew 08-29-2011 26M Delete
fitmaskexport2012A.tgz amatthew [c/o] 01-11-2012 26M Delete
fitmaskexport2012B.tgz amatthew 08-22-2012 26M Delete
fitmaskexport2013A.tgz amatthew 03-29-2013 26M Delete
merit.ps bmcleod 02-17-2010 111K Delete
rootnames.txt amatthew 05-23-2011 912 Delete
short.center amatthew 04-18-2013 38 Delete
short.targets amatthew 04-18-2013 702 Delete
xfitmask2012B.png amatthew 08-22-2012 80K Delete
xfitmask2013A.png amatthew 03-29-2013 92K Delete
xfitmask_2012B_blanc_H_HK.png amatthew 08-22-2012 667K Delete
xfitmask_2012B_blanc_H_H_slit_stacking.png amatthew 08-22-2012 21K Delete
xfitmask_2012B_blanc_zJ_J_H_H.png amatthew 08-22-2012 21K Delete