SWxTREC / enlilviz

A Python toolkit for Enlil solar wind visualizations.
MIT License
3 stars 2 forks source link

Error when reading NCEP file #13

Closed rweigel closed 1 year ago

rweigel commented 1 year ago

I tried downloading and reading a file from https://nomads.ncep.noaa.gov/pub/data/nccf/com/wsa_enlil/prod/ via

import enlilviz as ev
run = ev.read_enlil2d('wsa_enlil.t22z.suball.nc')

And got the error

Traceback (most recent call last):
  File "/miniconda3/lib/python3.9/site-packages/xarray/core/dataset.py", line 1339, in _construct_dataarray
    variable = self._variables[name]
KeyError: 'cc12_3d'
greglucas commented 1 year ago

Unfortunately, I haven't been able to find any documentation for the expected formats of the output suball files, so I've been having to guess/check at the variables that are available. Older versions have the cc_12 parameter in the netcdf files, but newer ones don't apparently. It was tested primarily on the Met Office's output files (which do have that variable), but now that the Enlil data files are easy to obtain from SWPC we should verify we stay up-to-date with their files as well. I've had this fix in for a while, so apologies for not pushing it out to main until now!

Try installing from the source repo if you can, and I'll try and push out a new release to PyPI in the next day or so with this update and a few others for updating the build system and dependencies.

rweigel commented 1 year ago

Works. Thanks.