Updated GNIRS reduction script

Home Forums Gemini Data Reduction Updated GNIRS reduction script

This topic contains 11 replies, has 6 voices, and was last updated by  lucyna 3 years, 8 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • #1104

    Here is the latest version of the XDGNIRS script for reducing GNIRS cross-dispersed data. The tar file contains a manual, but here’s a direct link to it in case you’d like to take a look and see if the code might be useful to you:


    XDGNIRS has been fairly well tested on a range of data but it’s the kind of code that astronomers write and I’m afraid I’m not going to be around to support it. Good luck!


    The links to dropbox in the pdf document are broken. Though they link to the same files that are attached to the original post.



    For reference, the original post is at http://drforum.gemini.edu/topic/gnirs-xd-reduction-script/



    Could not import aqutil, please see the online PyRAF FAQ

    Limited graphics available (aqutil not loaded)

    This problem occurs at Step 10, and it is related to the display. As stated in the XDGNIRS manual:

    “Most likely things to go wrong: This step is intended to help the Palomar XD group interpret the reduced data and may not work well on other data sets. If this step causes problems, simply run the code with “stop=9” and use your own routines to plot the .txt files output in the previous step. The total counts and FWHM recorded in the data sheet may not be correct for all data sets.”

    Therefore, Gemini recommend that you follow that advice and use your own plotting routines.

    Also, we would like to point out, also from that manual, Section 7:

    “XDGNIRS is not officially supported by Gemini. File a helpdesk request for general questions about GNIRS data and reduction. XDGNIRS-specific questions can be addressed to Rachel Mason, who will attempt to answer on a best-efforts basis, other commitments permitting.”

    This software is essentially a community-supported software, especially now that Rachel Mason has left Gemini, and the field. We recommend that you post your questions here on the DR Forum. Maybe someone in the community has solved this problem already and will be able to help.

    A colleague suggested that it might still be worth asking the question to help@stsci. While they are no longer supporting Ureka, they try to help with those things on a best effort basis. “aqutil” is a pyraf module, therefore belongs to STScI.

    I hope these clarifications help. If you do have a solution, please do post it here!

    Bryan Miller
    Bryan Miller

    I’ve had aqutil problems a couple of times. The last time a reboot of the machine fixed it.


    Simon Petrus


    A few years ago there were several useful examples. I think about
    (they are also given in the doc XDGNIRS_v226.pdf in the latest version of XDGNIRS)

    But these links are broken now. Do you know where may I find them?

    Many thanks


    Dear Simon,

    All these dropbox links (not owned by Gemini) died recently, unfortunately.

    You can access the data with the Gemini Observatory Archive:

    The tar ball example_reduction.tar.gz would only have the intermediate files that the script produce. You may recreate them from the example data and the script.

    Hope this works! Please, let us know.

    • This reply was modified 3 years, 8 months ago by achene achene.

    Simon Petrus

    Thanks a lot for your answer

    Yes that is correctly working, until the step 10
    I have to use AstroQuery, but it doesn’t find it (see bellow).
    I use Ureka 1.5.2. And yes AstroQuery is not usable with Ureka

    I can find AstroQuery in manual line from consol (with Anaconda) but not with the script of xdgnirs (with xdpiped.csh) which uses Ureka.

    I don’t know what I am suppose to do. Do I have to force the script to use Anaconda (but this doesn’t have Pyraf)? Do I have to install AstroQuery in Ureka? Other?

    Thank you so much for your help

    **      Flux Calibration           **
    ##### identifying the standard star and getting magnitudes ....
    Traceback (most recent call last):
      File "/Users/admin/Desktop/TOOLS/XDGNIRS_V2.2.6//mag2mass.py", line 11, in <module>
        from astroquery.simbad import Simbad
    ImportError: No module named astroquery.simbad
    >>>>>>>>>>>XDGNIRS has encountered a problem:
    >>>>>>>>>>>ImportError: No module named astroquery.simbad
    >>>>>>>>>>>Check LISTS/Status_inputfiles.txt
    >>>>>>>>>>>Stopping the script.


    Specifically regarding Anaconda and IRAF, I would like to make you aware that IRAF, and Gemini IRAF v1.13.1, have recently been added to the AstroConda channel. Maybe that will help. See the instructions at http://www.gemini.edu/node/12665



    Simon Petrus

    Thank you for your answer Kathleen.

    I finally fix my problem with a modification of the GNIRS script. I added a custom line to import modules in anaconda, in the script which needed (mag2mass.py and redshift.py)


    With that the script is available to find the astroauery module in the modules list of anaconda.




    I’m really happy to hear that you found a solution. Thank you for sharing it with the community.



    I managed to reduce the GNIRS data following the script until nsfransform. So I have wavelength calibrated 2-D spectra. I would like to get rid of hot pixels and cosmic rays now. Andre-Nicolas suggested a few methods. I like crmedian but I found that my output files are not MEF anymore. In result I cannot use nsextract to get 1-D spectra. Am I doing something wrong?
    The command I used is:
    crmedian tel_com[sci,1] output=ctel_com[sci,1]

    I would appreciate any tips for cosmic ray removal.

    Here is the error message:
    nsextract ctel_com[sci,1]
    NSEXTRACT — Fri Jun 30 17:29:56 AEST 2017

    FAIL: ctel_com[sci,1] – Extension not readable or absent
    ERROR – NSEXTRACT: Problem with input images (missing or not MEF).


Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.