Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71089

Saving a file as netCDF4 in Python

X-Received by 10.50.43.228 with SMTP id z4mr1924819igl.0.1399545213133; Thu, 08 May 2014 03:33:33 -0700 (PDT)
X-Received by 10.140.92.82 with SMTP id a76mr72387qge.1.1399545213063; Thu, 08 May 2014 03:33:33 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!c1no3023271igq.0!news-out.google.com!dz10ni35687qab.1!nntp.google.com!ih12no1471707qab.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Thu, 8 May 2014 03:33:32 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=151.170.240.10; posting-account=4ZFvUQoAAADRMMFTP4AD3zzRxG7Xhtl3
NNTP-Posting-Host 151.170.240.10
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <e42892df-c236-4eee-8508-af18385b97d5@googlegroups.com> (permalink)
Subject Saving a file as netCDF4 in Python
From Jamie Mitchell <jamiemitchell1604@gmail.com>
Injection-Date Thu, 08 May 2014 10:33:33 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:71089

Show key headers only | View raw


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 

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Saving a file as netCDF4 in Python Jamie Mitchell <jamiemitchell1604@gmail.com> - 2014-05-08 03:33 -0700

csiph-web