How to store a dataset retrieved with Siphon and the ncss service

58 Views Asked by At

I use the Siphon library to retrieve a subset (using the ncss service) of a remote NetCDF dataset. Is there a convenient way of storing the result in a local .nc file or do I have to create a new Dataset for writing and then clone everything in there?

1

There are 1 best solutions below

0
On BEST ANSWER

If you have a query (query) and client (ncss) set up, then you can do something like this:

with open('mydata.nc', 'wb') as outfile:
    outfile.write(ncss.get_data_raw(query))