eurec4a / flight-phase-separation

Collection of manually edited flight segments for all platforms participating in EUREC4A.
1 stars 6 forks source link

Minor correction to report.py #10

Closed leosaffin closed 4 years ago

leosaffin commented 4 years ago

I had to make this small change to get report.py to work with twinotter yaml files where the dropsonde attribute is absent. Thought I should get it in before I add more things in for the twinotter data so people don't end up making the same fix.

I can't run the HALO data through it so just check this is what was originally intended.

d70-t commented 4 years ago

Thanks for fixing it.

d70-t commented 4 years ago

@LSaffin I am wondering why you can't run the HALO examples. My idea was that the scripts are now configured such that the'll fetch all external data automatically, so they should in principle run everywhere.

leosaffin commented 4 years ago

@LSaffin I am wondering why you can't run the HALO examples. My idea was that the scripts are now configured such that the'll fetch all external data automatically, so they should in principle run everywhere.

@d70-t Good question. I got to a point where I didn't understand the error message too well. Something to do with opendap. I had assumed I didn't have permission to get the dataset but it's probably an issue with my setup then.

Traceback (most recent call last): File "report.py", line 281, in _main() File "report.py", line 217, in _main navdata = get_navdata(platform, flight_id).load() File "/home/lsaffin/Documents/meteorology/programming/flight-phase-separation/scripts/navdata.py", line 38, in get_navdata return NAVDATA_GETTERS[platform](flight) File "/home/lsaffin/Documents/meteorology/programming/flight-phase-separation/scripts/navdata.py", line 17, in get_navdata_HALO bahamas = catalog.halo.bahamas.ql.by_flight_id[flight].to_dask() File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/intake_xarray/base.py", line 69, in to_dask return self.read_chunked() File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/intake_xarray/base.py", line 44, in read_chunked self._load_metadata() File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/intake/source/base.py", line 126, in _load_metadata self._schema = self._get_schema() File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/intake_xarray/base.py", line 18, in _get_schema self._open_dataset() File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/intake_xarray/opendap.py", line 40, in _open_dataset session = self._get_session() File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/intake_xarray/opendap.py", line 33, in _get_session return setup_session( File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/pydap/cas/esgf.py", line 14, in setup_session session = get_cookies.setup_session(_uri(openid), File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/pydap/cas/get_cookies.py", line 45, in setup_session url = uri(check_url) File "/home/lsaffin/programs/miniconda3/envs/work/lib/python3.8/site-packages/pydap/cas/esgf.py", line 40, in generate_url raise UserWarning('OPENID was not set. ' UserWarning: OPENID was not set. ESGF connection cannot succeed.

d70-t commented 4 years ago

Something to do with opendap.

Yes, that is a bit of a pitty. The latest release of intake-xarray is pretty old and does not allow to access opendap resources without ESGF authentication. If you uninstall your intake-xarray and install the current master version e.g.:

pip install git+https://github.com/intake/intake-xarray@master#egg=intake-xarray

it should work. Have a look at https://github.com/eurec4a/flight-phase-separation/blob/master/scripts/requirements.txt for reference.