KeyError: 'Indir'

47 views
Skip to first unread message

khru...@gmail.com

unread,
Mar 25, 2014, 5:48:40 AM3/25/14
to mosfi...@googlegroups.com
Hi Nick,

I am encountering an issue in the latest release (via mercurial update today) of the DRP. I am not sure if it is user error or not yet, but when I run mospy on the example data I get the following back:

sudo mospy MOSFIRE_DRP_MASK_H.py
['m120910_0410.fits', 'm120910_0411.fits', 'm120910_0412.fits', 'm120910_0413.fits', 'm120910_0414.fits', 'm120910_0415.fits']
Traceback (most recent call last):
File "MOSFIRE_DRP_MASK_H.py", line 30, in <module>
Flats.handle_flats(flatnames, maskname, band, flatops)
File "/Users/jasonchu/MOSFIRE/drp_code/mosfire/MOSFIRE/Flats.py", line 64, in handle_flats
hdr, dat, bs = IO.readmosfits(fname, options, extension=extension)
File "/Users/jasonchu/MOSFIRE/drp_code/mosfire/MOSFIRE/IO.py", line 353, in readmosfits
else: path = os.path.join(fname_to_path(fname, options), fname)
File "/Users/jasonchu/MOSFIRE/drp_code/mosfire/MOSFIRE/IO.py", line 283, in fname_to_path
path = os.path.join(options["indir"], yr + month + "%2.2i" % dy)
KeyError: 'indir'

The problem seems to be with the indir which I've tried including in both Options.py and MOSFIRE_DRP_MASK_H.py with no avail. In my Options.py file I have the following 3 lines defining indir, outdir, and path_bpm:

indir = "/Users/jasonchu/MOSFIRE/raw_data"
outdir = "/Users/jasonchu/MOSFIRE/reduced_data/".format(getpass.getuser())
path_bpm = "/Users/jasonchu/MOSFIRE/badpixel/badpix_10sep2012.fits"

Note that I commented out the following line in Options.py:

#setenv MOSPATH $HOME/mosfire/DRP

And in my .cshrc I define MOSPATH to be:

setenv MOSPATH /Users/jasonchu/MOSFIRE/drp_code/mosfire


Do you have any suggestions?? Thanks in advance.

Nick Konidaris

unread,
Mar 25, 2014, 9:37:48 AM3/25/14
to mosfi...@googlegroups.com
Unfortunately it looks as if you're not using the modern version of the pipeline. You should download it from:


Which, unfortunately, is down right now because of a power failure. It should be up soon.

That said, since you downloaded the most current version using hg, you should be able to just follow the instructions. I'll send them to you.

~n



--
You received this message because you are subscribed to the Google Groups "MOSFIRE Data Reduction PIpeline" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mosfire-drp...@googlegroups.com.
To post to this group, send email to mosfi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mosfire-drp/356f2abb-97c6-442c-bdf3-ac63009ba05b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
   +1 831 704 6425

khru...@gmail.com

unread,
Mar 25, 2014, 6:02:01 PM3/25/14
to mosfi...@googlegroups.com
Great, thanks so much I will follow the new instructions! I tried downloading the latest version last night from your website but I didn't realize the webserver was down (it gave me an Error 403: Forbidden).

Nick Konidaris

unread,
Mar 25, 2014, 6:02:47 PM3/25/14
to mosfi...@googlegroups.com
The website seems to be back up now. I just downloaded the new version of the DRP. ~n



For more options, visit https://groups.google.com/d/optout.

khru...@gmail.com

unread,
Mar 26, 2014, 10:43:54 AM3/26/14
to mosfi...@googlegroups.com
Thanks Nick for the latest version of the pipeline. I've been able to run through all of the steps until the very last one, where I am getting the same issue with KeyError: 'indir'.

In my driver file I am running the following task:

Rectify.handle_rectification(maskname, ['eps_Offset_1.5.txt.fits', 'eps_Offset_-1.5.txt.fits'],
'merged_lambda_solution_wave_stack_K_m140209_0367-0393_and_wave_stack_K_m140209_0186-0188.fits',
band,
'm140209_0367.fits',
waveops)

As suggested I include the merged wavelength solution fits, and the first file in my Offset_1.5.txt file. The pipeline returns the following errors:

Traceback (most recent call last):

File "COSMOS_3_K.py", line 55, in <module>
waveops)
File "/Users/jasonchu/MOSFIRE/mosdrp/MOSFIRE/Rectify.py", line 146, in handle_rectification
x, x, bs = IO.readmosfits(barset_file, options)
File "/Users/jasonchu/MOSFIRE/mosdrp/MOSFIRE/IO.py", line 344, in readmosfits


else: path = os.path.join(fname_to_path(fname, options), fname)

File "/Users/jasonchu/MOSFIRE/mosdrp/MOSFIRE/IO.py", line 274, in fname_to_path


path = os.path.join(options["indir"], yr + month + "%2.2i" % dy)
KeyError: 'indir'

=============================================================================
A second, unrelated problem has to do with the first step of the driver file for another mask. The DRP doesn't seem to like the flat files, and I've tried all 7 flat images to no avail. Note that I've been able to successfully run the pipeline on another mask with no problems.

I've included one of the flat fields here if you want to take a look:
http://ifa.hawaii.edu/~jasonchu/m140209_0132.fits

Loading: Flat.txt
['/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0132.fits', '/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0133.fits', '/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0134.fits', '/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0135.fits', '/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0136.fits', '/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0137.fits', '/Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0138.fits']


Traceback (most recent call last):

File "COSMOS_1_K.py", line 20, in <module>
Flats.handle_flats('Flat.txt', maskname, band, flatops)
File "/Users/jasonchu/MOSFIRE/mosdrp/MOSFIRE/Flats.py", line 64, in handle_flats


hdr, dat, bs = IO.readmosfits(fname, options, extension=extension)

File "/Users/jasonchu/MOSFIRE/mosdrp/MOSFIRE/IO.py", line 363, in readmosfits
raise Exception("Improper MOSFIRE FITS File: %s" % path)
Exception: Improper MOSFIRE FITS File: /Users/jasonchu/MOSFIRE/raw_data/2014feb09/m140209_0132.fits

Thanks in advance!

khru...@gmail.com

unread,
Apr 11, 2014, 11:33:35 PM4/11/14
to mosfi...@googlegroups.com, khru...@gmail.com
Just FYI for anyone else reading, the KeyError was solved on the last command in the driver file, by writing out the full path to the file. I didn't realize this because I used the K-band driver first, and noticed later in the regular driver file that the full path was required.

The second question still has not been solved and I posted it as a separate issue on the forum:

https://groups.google.com/forum/#!topic/mosfire-drp/DydKrbmNmf0

Reply all
Reply to author
Forward
0 new messages