{"action":"created","issue":{"url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/36","repository_url":"https://api.github.com/repos/spacetelescope/pysynphot","labels_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/36/comments","events_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/36/events","html_url":"https://github.com/spacetelescope/pysynphot/issues/36","id":219708313,"number":36,"title":"Questions on simulating photometry","user":{"login":"mdastro","id":10452764,"avatar_url":"https://avatars3.githubusercontent.com/u/10452764?v=3","gravatar_id":"","url":"https://api.github.com/users/mdastro","html_url":"https://github.com/mdastro","followers_url":"https://api.github.com/users/mdastro/followers","following_url":"https://api.github.com/users/mdastro/following{/other_user}","gists_url":"https://api.github.com/users/mdastro/gists{/gist_id}","starred_url":"https://api.github.com/users/mdastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdastro/subscriptions","organizations_url":"https://api.github.com/users/mdastro/orgs","repos_url":"https://api.github.com/users/mdastro/repos","events_url":"https://api.github.com/users/mdastro/events{/privacy}","received_events_url":"https://api.github.com/users/mdastro/received_events","type":"User","site_admin":false},"labels":[{"id":330794380,"url":"https://api.github.com/repos/spacetelescope/pysynphot/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2017-04-05T20:40:55Z","updated_at":"2017-04-18T17:44:56Z","closed_at":null,"body":"Hi @pllim,\r\n\r\nAs I explained before, I am using pysynphot for the first time and I was given an example script in order to simulate photometry from SDSS spectra.\r\n\r\nThe idea is to read the spectra, the response filters, and finally simulate the photometry. The script can be found [here](https://github.com/mdastro/Challenge/blob/master/Coding/sanity_check.ipynb) with the respective error. So that this issue is complete, the code error appears when I use pysynphot for the first time with the `FileBandpass`  command:\r\n\r\n```\r\njpas_filter_bandpass = np.array(np.loadtxt(os.path.join(jpas_filters_path, jpas_filters)))\r\njpas_filter_bandpass = s.FileBandpass(jpas_filter_bandpass)\r\n```\r\n\r\nBy the way, the `jpas_filter_bandpass` file is a two-column file with wavelength and flux respectively.\r\n\r\nThe error:\r\n\r\n> AttributeError                            Traceback (most recent call last)\r\n> <ipython-input-5-deec18d20a2e> in <module>()\r\n>       7         jpas_filter_bandpass = np.array(np.loadtxt(os.path.join(jpas_filters_path, jpas_filters)))\r\n>       8         sdss_spectrum        = np.loadtxt(os.path.join(test_specs, each_spectrum), usecols=(0,1))\r\n> ----> 9         jpas_filter_bandpass = s.FileBandpass(jpas_filter_bandpass)\r\n>      10 #         print sdss_spectrum\r\n>      11 #         exit()\r\n> \r\n> /home/mldantas/miniconda2/lib/python2.7/site-packages/pysynphot/spectrum.pyc in __init__(self, filename, thrucol)\r\n>    2942     \"\"\"\r\n>    2943     def __init__(self, filename, thrucol=None):\r\n> -> 2944         self.name = locations.irafconvert(filename)\r\n>    2945         self._readThroughputFile(self.name, thrucol)\r\n>    2946 \r\n> \r\n> /home/mldantas/miniconda2/lib/python2.7/site-packages/pysynphot/locations.pyc in irafconvert(iraffilename)\r\n>     256 \r\n>     257     # remove duplicate separators and extraneous relative paths\r\n> --> 258     iraffilename = os.path.normpath(iraffilename)\r\n>     259 \r\n>     260     #BUG: supports environment variables only as the leading element in the\r\n> \r\n> /home/mldantas/miniconda2/lib/python2.7/posixpath.pyc in normpath(path)\r\n>     333     if path == '':\r\n>     334         return dot\r\n> --> 335     initial_slashes = path.startswith('/')\r\n>     336     # POSIX allows one or two initial slashes, but treats three or more\r\n>     337     # as single slash.\r\n> \r\n> AttributeError: 'numpy.ndarray' object has no attribute 'startswith'\r\n\r\nCould you please enlighten me on this error?\r\n\r\nThe nexts steps are the ones commented in the Jupyter Notebook I linked above. The scprit of course is not ready, but I guess you can understand my point.\r\n\r\nThank you!\r\n\r\nMaria Luiza"},"comment":{"url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/comments/294924880","html_url":"https://github.com/spacetelescope/pysynphot/issues/36#issuecomment-294924880","issue_url":"https://api.github.com/repos/spacetelescope/pysynphot/issues/36","id":294924880,"user":{"login":"pllim","id":2090236,"avatar_url":"https://avatars1.githubusercontent.com/u/2090236?v=3","gravatar_id":"","url":"https://api.github.com/users/pllim","html_url":"https://github.com/pllim","followers_url":"https://api.github.com/users/pllim/followers","following_url":"https://api.github.com/users/pllim/following{/other_user}","gists_url":"https://api.github.com/users/pllim/gists{/gist_id}","starred_url":"https://api.github.com/users/pllim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pllim/subscriptions","organizations_url":"https://api.github.com/users/pllim/orgs","repos_url":"https://api.github.com/users/pllim/repos","events_url":"https://api.github.com/users/pllim/events{/privacy}","received_events_url":"https://api.github.com/users/pllim/received_events","type":"User","site_admin":false},"created_at":"2017-04-18T17:44:56Z","updated_at":"2017-04-18T17:44:56Z","body":"Thanks, that is much more helpful for me. It appears you were close but you stopped right after creating the `Observation` instance. All you needed to do was to actually use the appropriate *methods* of the class instance for your calculations. Please see https://gist.github.com/pllim/9bd61155661768aa4f35a920d652f308"}}
{"actor":{"display_login":"pllim"}}