{"action":"created","issue":{"url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/23","repository_url":"https://api.github.com/repos/spacetelescope/pysynphot","labels_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/23/comments","events_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/23/events","html_url":"https://github.com/spacetelescope/pysynphot/issues/23","id":180481675,"number":23,"title":"issue with certain WFC3 spectral elements ","user":{"login":"tumlinson","id":13485628,"avatar_url":"https://avatars.githubusercontent.com/u/13485628?v=3","gravatar_id":"","url":"https://api.github.com/users/tumlinson","html_url":"https://github.com/tumlinson","followers_url":"https://api.github.com/users/tumlinson/followers","following_url":"https://api.github.com/users/tumlinson/following{/other_user}","gists_url":"https://api.github.com/users/tumlinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tumlinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tumlinson/subscriptions","organizations_url":"https://api.github.com/users/tumlinson/orgs","repos_url":"https://api.github.com/users/tumlinson/repos","events_url":"https://api.github.com/users/tumlinson/events{/privacy}","received_events_url":"https://api.github.com/users/tumlinson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spacetelescope/pysynphot/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-01T21:36:01Z","updated_at":"2016-10-03T15:03:02Z","closed_at":null,"body":"This fails: \r\n> import pysynphot as S \r\n> bp = S.ObsBandpass('wfc3,uvis1,f225w')\r\n\r\n[traceback below]\r\n\r\nthis happens even when the file in question is present in reference_files/comp/wfc3 and PYSYN_CDBS is set properly. \r\n\r\nI've tracked this as far back as _getFileNames in observationmode.py, where it appears that some elements are not having the path from $PYSYN_CDBS prepended to their filenames. As here: \r\n\r\n    def _getFileNames(self, comptable, compnames):\r\n        files = []\r\n        for compname in compnames:\r\n            if compname not in [None, '', CLEAR]:\r\n                index = N.where(comptable.compnames == compname)\r\n                try:\r\n                    iraffilename = comptable.filenames[index[0][0]]\r\n                    print(\"INTHELOOP iraffilename\",compname,iraffilename)\r\n                    filename = irafconvert(iraffilename)\r\n                    print(\"INTHELOOP     filename\",compname,filename)\r\n                    files.append(filename.lstrip())\r\n                except IndexError:\r\n                    raise IndexError(\"Can't find %s in comptable %s\"%(compname,comptable.name))\r\n            else:\r\n                files.append(CLEAR)\r\n        return files\r\n\r\nThe \"INTHELOOP\" lines show up at runtime like this: \r\nand note that wfc3uvis1_f225w_006_syn.fits does not have the path prepended. \r\nI suspect this is bug in locations.py but I'm not sure and thought I should report. \r\n\r\nINTHELOOP iraffilename hst_ota crotacomp$hst_ota_007_syn.fits\r\nINTHELOOP     filename hst_ota /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/ota/hst_ota_007_syn.fits\r\nINTHELOOP iraffilename wfc3_pom crwfc3comp$wfc3_pom_001_syn.fits\r\nINTHELOOP     filename wfc3_pom /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/wfc3/wfc3_pom_001_syn.fits\r\nINTHELOOP iraffilename wfc3_uvis_mir1 crwfc3comp$wfc3_uvis_mir1_002_syn.fits\r\nINTHELOOP     filename wfc3_uvis_mir1 /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/wfc3/wfc3_uvis_mir1_002_syn.fits\r\nINTHELOOP iraffilename wfc3_uvis_mir2 crwfc3comp$wfc3_uvis_mir2_002_syn.fits\r\nINTHELOOP     filename wfc3_uvis_mir2 /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/wfc3/wfc3_uvis_mir2_002_syn.fits\r\nINTHELOOP iraffilename wfc3uvis1_f225w wfc3uvis1_f225w_006_syn.fits\r\nINTHELOOP     filename wfc3uvis1_f225w wfc3uvis1_f225w_006_syn.fits\r\nINTHELOOP iraffilename wfc3_uvis_owin crwfc3comp$wfc3_uvis_owin_002_syn.fits\r\nINTHELOOP     filename wfc3_uvis_owin /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/wfc3/wfc3_uvis_owin_002_syn.fits\r\nINTHELOOP iraffilename wfc3_uvis_iwin crwfc3comp$wfc3_uvis_iwin_002_syn.fits\r\nINTHELOOP     filename wfc3_uvis_iwin /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/wfc3/wfc3_uvis_iwin_002_syn.fits\r\nINTHELOOP iraffilename wfc3_uvis_ccd1 crwfc3comp$wfc3_uvis_ccd1_003_syn.fits\r\nINTHELOOP     filename wfc3_uvis_ccd1 /Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/reference_files/comp/wfc3/wfc3_uvis_ccd1_003_syn.fits\r\nINTHELOOP iraffilename wfc3uvis1_cor wfc3uvis1_cor_004_syn.fits\r\nINTHELOOP     filename wfc3uvis1_cor wfc3uvis1_cor_004_syn.fits\r\n\r\n\r\n\r\n\r\n\r\n\r\nTRACEBACK: \r\n\r\n----> 1 bp = S.ObsBandpass('wfc3,uvis1,f225w')\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/obsbandpass.pyc in ObsBandpass(obstring, graphtable, comptable, component_dict)\r\n     42     ##ObsModeBandpass or a TabularSpectralElement will be returned.\r\n     43     ob=ObservationMode(obstring,graphtable=graphtable,\r\n---> 44                        comptable=comptable,component_dict=component_dict)\r\n     45     if len(ob) > 1:\r\n     46         return ObsModeBandpass(ob)\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/observationmode.py in __init__(self, obsmode, method, graphtable, comptable, component_dict)\r\n    326 \r\n    327         self.components = self._getOpticalComponents(self._throughput_filenames,\r\n--> 328                                                       component_dict)\r\n    329 \r\n    330 \r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/observationmode.py in _getOpticalComponents(self, throughput_filenames, component_dict)\r\n    342             else:\r\n    343               component = _Component(throughput_name,\r\n--> 344                                      interpval=self.pardict.get(parkey))\r\n    345               component_dict[(throughput_name, self.pardict.get(parkey))] = component\r\n    346 \r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/observationmode.py in __init__(self, throughput_name, interpval)\r\n    617         self._empty = True\r\n    618 \r\n--> 619         self.throughput = self._buildThroughput(throughput_name, interpval)\r\n    620         if self.throughput is not None:\r\n    621             self.waveunits = self.throughput.waveunits\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/observationmode.py in _buildThroughput(self, name, interpval)\r\n    628             if interpval is None:\r\n    629                 self._empty = False\r\n--> 630                 return spectrum.TabularSpectralElement(name)\r\n    631             else:\r\n    632                 self._empty = False\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/spectrum.pyc in __init__(self, fileName, thrucol)\r\n   2737             if fileName.endswith('.fits') or fileName.endswith('.fit'):\r\n   2738                 print(\"  \")\r\n-> 2739                 self._readFITS(fileName, thrucol)\r\n   2740             else:\r\n   2741                 self._readASCII(fileName)\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/pysynphot/spectrum.pyc in _readFITS(self, filename, thrucol)\r\n   2775 \r\n   2776     def _readFITS(self,filename,thrucol='throughput'):\r\n-> 2777         fs = pyfits.open(filename)\r\n   2778 \r\n   2779         # pyfits cannot close the file on .close() if there are still\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.pyc in fitsopen(name, mode, memmap, save_backup, cache, **kwargs)\r\n    137         raise ValueError('Empty filename: %s' % repr(name))\r\n    138 \r\n--> 139     return HDUList.fromfile(name, mode, memmap, save_backup, cache, **kwargs)\r\n    140 \r\n    141 \r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.pyc in fromfile(cls, fileobj, mode, memmap, save_backup, cache, **kwargs)\r\n    279 \r\n    280         return cls._readfrom(fileobj=fileobj, mode=mode, memmap=memmap,\r\n--> 281                              save_backup=save_backup, cache=cache, **kwargs)\r\n    282 \r\n    283     @classmethod\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.pyc in _readfrom(cls, fileobj, data, mode, memmap, save_backup, cache, **kwargs)\r\n    800             if not isinstance(fileobj, _File):\r\n    801                 # instantiate a FITS file object (ffo)\r\n--> 802                 ffo = _File(fileobj, mode=mode, memmap=memmap, cache=cache)\r\n    803             else:\r\n    804                 ffo = fileobj\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/astropy/io/fits/file.pyc in __init__(self, fileobj, mode, memmap, clobber, cache)\r\n    148             self._open_fileobj(fileobj, mode, clobber)\r\n    149         elif isinstance(fileobj, string_types):\r\n--> 150             self._open_filename(fileobj, mode, clobber)\r\n    151         else:\r\n    152             self._open_filelike(fileobj, mode, clobber)\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/astropy/io/fits/file.pyc in _open_filename(self, filename, mode, clobber)\r\n    500             self._file = bz2.BZ2File(self.name, bzip2_mode)\r\n    501         else:\r\n--> 502             self._file = fileobj_open(self.name, PYFITS_MODES[mode])\r\n    503 \r\n    504         # Make certain we're back at the beginning of the file\r\n\r\n/Users/tumlinson/yt-conda/lib/python2.7/site-packages/astropy/io/fits/util.pyc in fileobj_open(filename, mode)\r\n    401         \"\"\"\r\n    402 \r\n--> 403         return open(filename, mode)\r\n    404 \r\n    405 \r\n\r\nIOError: [Errno 2] No such file or directory: 'wfc3uvis1_f225w_006_syn.fits'\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/comments/251131016","html_url":"https://github.com/spacetelescope/pysynphot/issues/23#issuecomment-251131016","issue_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/23","id":251131016,"user":{"login":"tumlinson","id":13485628,"avatar_url":"https://avatars.githubusercontent.com/u/13485628?v=3","gravatar_id":"","url":"https://api.github.com/users/tumlinson","html_url":"https://github.com/tumlinson","followers_url":"https://api.github.com/users/tumlinson/followers","following_url":"https://api.github.com/users/tumlinson/following{/other_user}","gists_url":"https://api.github.com/users/tumlinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tumlinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tumlinson/subscriptions","organizations_url":"https://api.github.com/users/tumlinson/orgs","repos_url":"https://api.github.com/users/tumlinson/repos","events_url":"https://api.github.com/users/tumlinson/events{/privacy}","received_events_url":"https://api.github.com/users/tumlinson/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T15:03:02Z","updated_at":"2016-10-03T15:03:02Z","body":"Hi Pey-Lian, \r\nI did indeed have old TMG/TMC/TMT files, from April. I didn't think to do this since I had just installed a fresh pysynphot. But it works now. Thanks. "}}
{"actor":{"display_login":"tumlinson"}}