Multidrizzle: Keyerror “bunit”
khl wrote on Jun 22, 2010
I am running the pyraf task Multidrizzle on WFPC2 data. I am setting the units (of the image) to counts and constructing each individual chip at a time (i.e. wf2, wf3, and wf4 separatly). under these settings i get the below error message. However, when I construct the mosaic image in units of counts, the multidrizzle works fine. I can also run multidrizzle successfully when i construct the mosaic and individual chip when I set the units to cps (counts per second). So i have no idea why multidrizzle won't construct the individual chips when the units are set to counts. (the units of the image should be in counts) Anything would be helpful.
----------
-Generating simple FITS output: hcg7u_336nosky_ctegr3_gr3_combgr3_sepkersquare_finkernpoint_count_wf2_drz_sci.fits
PyDrizzle drizzling completed at 13:34:12 (22/06/2010)
Traceback (innermost last):
File "<CL script CL1>", line 1, in <module>
File "/usr/common/iraf/extern/stsdas/pkg/analysis/dither/multidrizzle_iraf.py", line 250, in mdrizzle_iraf
md.run()
File "/usr/astro/lib/python2.5/site-packages/multidrizzle/__init__.py", line 715, in run
self.image_manager.doFinalDriz(self.driz_final_pars, self.runfile)
File "/usr/astro/lib/python2.5/site-packages/multidrizzle/manager.py", line 1099, in doFinalDriz
fhdu[sci_ext].header['bunit'] = fhdu[sci_ext].header['bunit'].upper().replace("ELECTRONS","COUNTS")
File "/usr/astro/lib/python2.5/site-packages/pyfits/NP_pyfits.py", line 1544, in __getitem__
card = self.ascard[key]
File "/usr/astro/lib/python2.5/site-packages/pyfits/NP_pyfits.py", line 2110, in __getitem__
_key = self.index_of(key)
File "/usr/astro/lib/python2.5/site-packages/pyfits/NP_pyfits.py", line 2309, in index_of
raise KeyError, 'Keyword %s not found.' % `key`
KeyError: "Keyword 'bunit' not found."
----------
Thanks.
Ki
----------
-Generating simple FITS output: hcg7u_336nosky_ctegr3_gr3_combgr3_sepkersquare_finkernpoint_count_wf2_drz_sci.fits
PyDrizzle drizzling completed at 13:34:12 (22/06/2010)
Traceback (innermost last):
File "<CL script CL1>", line 1, in <module>
File "/usr/common/iraf/extern/stsdas/pkg/analysis/dither/multidrizzle_iraf.py", line 250, in mdrizzle_iraf
md.run()
File "/usr/astro/lib/python2.5/site-packages/multidrizzle/__init__.py", line 715, in run
self.image_manager.doFinalDriz(self.driz_final_pars, self.runfile)
File "/usr/astro/lib/python2.5/site-packages/multidrizzle/manager.py", line 1099, in doFinalDriz
fhdu[sci_ext].header['bunit'] = fhdu[sci_ext].header['bunit'].upper().replace("ELECTRONS","COUNTS")
File "/usr/astro/lib/python2.5/site-packages/pyfits/NP_pyfits.py", line 1544, in __getitem__
card = self.ascard[key]
File "/usr/astro/lib/python2.5/site-packages/pyfits/NP_pyfits.py", line 2110, in __getitem__
_key = self.index_of(key)
File "/usr/astro/lib/python2.5/site-packages/pyfits/NP_pyfits.py", line 2309, in index_of
raise KeyError, 'Keyword %s not found.' % `key`
KeyError: "Keyword 'bunit' not found."
----------
Thanks.
Ki
Mike Fitzpatrick wrote on Jun 22, 2010
If you don't get an answer here you might also try the STScI Help Desk (help@stsci.edu). Clearly the task is expecting a BUNIT keyword in the image and not finding it, I couldn't say though whether this is a requirement of MULTIDRIZZLE or the PyFITS library it uses.
khl wrote on Jun 22, 2010
Courtesy of Matt McMaster,
Senior Research and Instrument Analyst - ACS/WFPC2 Team
"When you requested the data from the archive, did the datafiles have the
form: u9q7320?m_c0m.fits? Did you use strfit to convert them to c0h/c0d files?
If so, you shouldn't have. The c0m files you get from MAST are in Multi
Extension Fits (MEF) format and can be used with Multidrizzle as is. If a
piece of documentation or information somewhere said that you should use
c0h/c0d files, please disregard it and see below."
This solved the problem.
Senior Research and Instrument Analyst - ACS/WFPC2 Team
"When you requested the data from the archive, did the datafiles have the
form: u9q7320?m_c0m.fits? Did you use strfit to convert them to c0h/c0d files?
If so, you shouldn't have. The c0m files you get from MAST are in Multi
Extension Fits (MEF) format and can be used with Multidrizzle as is. If a
piece of documentation or information somewhere said that you should use
c0h/c0d files, please disregard it and see below."
This solved the problem.
Last post on Jun 22, 2010