Saving a file as netCDF4 in Python

J

Jamie Mitchell

Dear all,

Apologies as this sounds like a very simple question but I can't find an answer anywhere.

I have loaded a netCDF4 file into python as follows:

swh=netCDF4.Dataset('path/to/netCDFfile,'r')

I then isolate the variables I wish to plot:

hs=swh.variables['hs']
year=swh.variables['year']

I would then like to save these hs and year variables so that I don't have to isolate them every time I want to plot them.

Any help would be much appreciated.

Cheers,

Jamie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,068
Latest member
MakersCBDIngredients

Latest Threads

Top