I'm having trouble retrieving a transmission function for a new site I configured. Here's exactly what I've done, following along with the documentation:
>>> from pwv_kpno.package_settings import ConfigBuilder, settings
>>> from pwv_kpno import pwv_atm
>>> from datetime import datetime
>>> import pytz
>>>
>>> new_config = ConfigBuilder(
site_name = "apache_point",
primary_rec="P027",
sup_rec = []
)
>>> new_config.save_to_ecsv('./apache_point.ecsv')
>>> settings.import_site_config('./apache_point.ecsv')
>>>
>>> settings.set_site('apache_point')
>>>
>>> pwv_atm.update_models(years=[2018])
>>>
>>> obsv_date = datetime(year=2018, month=5, day=15)
>>> # this works fine and returns a table as expected:
>>> pwv_atm.measured_pwv(year=2018, month=5, day=15)
>>> # here's where it breaks:
>>> pwv_atm.trans_for_date(date=obsv_date, airmass=1.5)
FileNotFoundError Traceback (most recent call last)
<ipython-input-21-3ee644195537> in <module>()
4 obsv_date = datetime(year=2018, month=5, day=15)
5 # pwv_atm.measured_pwv(year=2018, month=5, day=15)
----> 6 pwv_atm.trans_for_date(date=obsv_date, airmass=1.5)
//anaconda/lib/python3.5/site-packages/pwv_kpno/pwv_atm.py in trans_for_date(date, airmass, bins)
525 """
526
--> 527 return _trans_for_date(date, airmass, bins)
528
529
//anaconda/lib/python3.5/site-packages/pwv_kpno/pwv_atm.py in _trans_for_date(date, airmass, bins, test_model)
503 """
504
--> 505 pwv, pwv_err = _pwv_date(date, airmass, test_model)
506 return trans_for_pwv(pwv, pwv_err, bins)
507
//anaconda/lib/python3.5/site-packages/pwv_kpno/pwv_atm.py in _pwv_date(date, airmass, test_model)
186
187 if test_model is None:
--> 188 pwv_model = Table.read(settings._pwv_modeled_path)
189
190 else:
//anaconda/lib/python3.5/site-packages/astropy/table/table.py in read(cls, *args, **kwargs)
2548 # RST table and inserts at the end of the docstring. DO NOT REMOVE.
2549
-> 2550 out = io_registry.read(cls, *args, **kwargs)
2551 # For some readers (e.g., ascii.ecsv), the returned `out` class is not
2552 # guaranteed to be the same as the desired output `cls`. If so,
//anaconda/lib/python3.5/site-packages/astropy/io/registry.py in read(cls, format, *args, **kwargs)
500 try:
501 ctx = get_readable_fileobj(args[0], encoding='binary')
--> 502 fileobj = ctx.__enter__()
503 except OSError:
504 raise
//anaconda/lib/python3.5/contextlib.py in __enter__(self)
57 def __enter__(self):
58 try:
---> 59 return next(self.gen)
60 except StopIteration:
61 raise RuntimeError("generator didn't yield") from None
//anaconda/lib/python3.5/site-packages/astropy/utils/data.py in get_readable_fileobj(name_or_obj, encoding, cache, show_progress, remote_timeout)
191 name_or_obj, cache=cache, show_progress=show_progress,
192 timeout=remote_timeout)
--> 193 fileobj = io.FileIO(name_or_obj, 'r')
194 if is_url and not cache:
195 delete_fds.append(fileobj)
FileNotFoundError: [Errno 2] No such file or directory: '/anaconda/lib/python3.5/site-packages/pwv_kpno/site_data/apache_point/modeled_pwv.csv'