"Sloanr" filter unrecognition
Closed this issue · 4 comments
I am running this piece of code (inside another code named "repipy") over a list of single-layer .fit files and I get the following error.
for im_name in image_list:
im = fits.open(im_name, 'update')
filter_name = astroim.Astroim(im_name).filter.__str__()
im[0].header[filterk] = filter_name
im.flush()
im.close()
---------------------------------------------------------------------------
NonRecognizedPassband Traceback (most recent call last)
<ipython-input-13-488d4fdb91fe> in <module>()
1 for im_name in image_list:
2 im = fits.open(im_name, 'update')
----> 3 filter_name = astroim.Astroim(im_name).filter.__str__()
4 im[0].header[filterk] = filter_name
5 im.flush()
/mnt/DATA/work/routines/repipy/filter.pyc in __str__(self)
30 filtersys = self.header.hdr[ self.header.filtersysk ]
31 filtername = self.filter_name
---> 32 filter_alias = passband.Passband( filtersys + filtername).__str__()
33 return re.sub('[\s\']', "", filter_alias)
34
/mnt/DATA/work/routines/lemon/passband.pyc in __init__(self, filter_name)
410 letter = name.strip().upper()
411 if letter not in self.ALL_LETTERS:
--> 412 raise NonRecognizedPassband(filter_name)
413
414 elif system == HALPHA:
NonRecognizedPassband: cannot identify the photometric system of filter 'Sloanr'.
If this is a legitimate filter name, and you think LEMON should be able to recognize it,
please let us know at [http://github.com/vterron/lemon/issues]. In the meantime, you
can define your own filters in the /home/prm/.lemonrc file, as options of the
[custom_filters] section
The aim of the code is basically to identify the filter in the headers. In this kind of images (INT telescope), the filter is split in two keywords:
WFFBAND = 'r ' / Waveband of filter
WFFPSYS = 'Sloan ' / Photometric system of filter
and according to the error, it seems it merges them into "Sloanr" and it is not recognized by the program. Just in case, I have checked the word "Sloanr" does not exist anywhere in the header so it does not seem to be mixing things up with any other keyword.
Would it be possible to add the weird combination of "Sloanr" as a new filter?
Since INT telescope is a quite used telescope, I would suggest to add also "Sloang", "Sloanu", "Sloani" as combinations for g, u and i bands.
Thank you!
Solved in 3117d6a. The problem was that LEMON was prepared to recognize "SDSS" as indicative of the Sloan photometric system. Now it accepts also "Sloan".
Most brilliant. Thank you for the fix, my good sir.
Thanks, Javier. We should probably add / update the unit tests for these changes.