I'm having trouble trying to plot METAR data from the THREDDS data server, which comes in .nc format, onto a map. I'm using Siphon to grab the data and Xarray to open the dataset with remote_access
, but the problem comes with attempting to convert the data to .csv or .txt. When using NetCDF Dataset
and attempting to read the NetCDF4 file, I get a file does not exist error. I'm not really sure where to start as there doesn't seem to be much on the internet about this. Any help would be appreciated as I'm also really new to this.
Asked
Active
Viewed 216 times
0
-
it sounds like you're having a remote access to the nc files' content (opened via `xarray`), so why do you want to open the file again with `Dataset` from the `netCDF4` package? Or do you create local copies of the files which you *then* want to access? – FObersteiner Oct 02 '19 at 18:41
-
I'm wanting to access the METAR files to plot, not download to then plot, similarly to how I would just grab satellite or gridded data via ```remote_access```. However, I'm not entirely sure how to go about changing the data from NetCDF4 to a CSV or text file to then plot using MetPy or if I can just plot the point data in the regular .nc format. – Victor Alejandro Álvarez Vega Oct 02 '19 at 22:06
-
ok that clarifies a bit. MetPy seems to accept data coming from netcdf format, accessed using xarray (suggested [here](https://unidata.github.io/MetPy/latest/startingguide.html), `metpy.parse_cf()`). So I'd assume you won't have to take the detour of saving intermediate data in csv/text format. Can you show some code of what you tried, that did not work? – FObersteiner Oct 03 '19 at 09:46
-
You directed me in the right direction. Thanks! Haven't made the plot yet but i'm getting there. – Victor Alejandro Álvarez Vega Oct 03 '19 at 19:59