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


Groups > comp.lang.python > #47175

Re: python netcdf

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <sjo.india@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'attribute': 0.07; 'conventions': 0.07; 'suppose': 0.07; 'variables': 0.07; 'string': 0.09; 'attributes': 0.09; 'bindings': 0.09; 'variable,': 0.09; 'api': 0.11; 'cc:addr:python-list': 0.11; 'python': 0.11; 'stored': 0.12; 'attribute,': 0.16; 'cc:name:python list': 0.16; 'newer,': 0.16; 'numpy': 0.16; 'slicing:': 0.16; 'subject:python': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'appears': 0.22; 'example': 0.22; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'package.': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'options': 0.25; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(which': 0.31; 'dimensions': 0.31; 'mini': 0.31; 'origin': 0.31; 'file': 0.32; 'class': 0.32; 'option': 0.32; 'skip:d 20': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'accessible': 0.36; 'similar': 0.36; 'skip:& 10': 0.38; 'thank': 0.38; 'jason': 0.38; 'pm,': 0.38; 'use.': 0.39; 'skip:n 30': 0.60; 'course': 0.61; "you're": 0.61; 'skip:n 10': 0.64; 'more': 0.64; 'dear': 0.65; 'to:addr:gmail.com': 0.65; '2013,': 0.91; 'ipad': 0.95; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=e9SucvJ/c4ITxlUdvMpiKuypVOwWFlu4rUEsZKGhxS8=; b=gahJ2GY/0JNs9cSJR24LLUQuyu7qCiGbGfsQz/pMHD6P8Leqn10asbAFkrlWdTs8av Pz39WDzxJdEzDejzO0dBRGiDjjyAKtwhaU+J+9wUbpvqDlVokTXXg149SysuzdTboWy+ GJcbH84gScF+4mNnLc53HY2p1NUdTtRIZBTb8HQSfH9KvfYFX7bryx6b5PZhI2a6/xAt pYfsZacSylhZApKP7Pq604JF1ldo/ULwmd3PJ/4Hy6wJr+j0RXeQ5qNi4NO9rduEroKe b1j20towzS0HQkdfYUVLdytdX7e/GEbZE3WRRcIu3LEHbHGA1+hEbaG7YI7jDsGe6VAh C8tQ==
MIME-Version 1.0
X-Received by 10.67.4.129 with SMTP id ce1mr36585032pad.107.1370483534339; Wed, 05 Jun 2013 18:52:14 -0700 (PDT)
In-Reply-To <CAEk9e3qhVhY2nt=2QdNot3dWdfs8BCLcdoXyXObws0DjW6u3Yg@mail.gmail.com>
References <f39648d9-3d21-4186-8e79-c7aba935beb2@googlegroups.com> <CAEk9e3qhVhY2nt=2QdNot3dWdfs8BCLcdoXyXObws0DjW6u3Yg@mail.gmail.com>
Date Thu, 6 Jun 2013 07:22:14 +0530
Subject Re: python netcdf
From Sudheer Joseph <sjo.india@gmail.com>
To Jason Swails <jason.swails@gmail.com>
Content-Type multipart/alternative; boundary=047d7b16018b3c23b304de72904b
Cc python list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2781.1370483543.3114.python-list@python.org> (permalink)
Lines 131
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1370483543 news.xs4all.nl 15896 [2001:888:2000:d::a6]:60318
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:47175

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Thank you very much Jason
With best regards
Sudheer

On Thursday, June 6, 2013, Jason Swails wrote:

>
>
>
> On Wed, Jun 5, 2013 at 9:07 PM, Sudheer Joseph <sjo.india@gmail.com<javascript:_e({}, 'cvml', 'sjo.india@gmail.com');>
> > wrote:
>
>> Dear Members,
>>                   Is there a way to get the time:origin attribute from a
>> netcdf file as string using the Python netcdf?
>>
>
> Attributes of the NetCDF file and attributes of each of the variables can
> be accessed via the dot-operator, as per standard Python.
>
> For instance, suppose that your NetCDF file has a Conventions attribute,
> you can access it via:
>
> ncfile.Conventions
>
> Suppose that your variable, time, has an attribute "origin", you can get
> it via:
>
> ncfile.variables['time'].origin
>
> Of course there's the question of what NetCDF bindings you're going to
> use.  The options that I'm familiar with are the ScientificPython's
> NetCDFFile class (Scientific.IO.NetCDF.NetCDFFile), pynetcdf (which is just
> the ScientificPython's class in a standalone format), and the netCDF4
> package.  Each option has a similar API with attributes accessed the same
> way.
>
> An example with netCDF4 (which is newer, has NetCDF 4 capabilities, and
> appears to be more supported):
>
> from netCDF4 import Dataset
>
> ncfile = Dataset('my_netcdf_file.nc', 'r')
>
> origin = ncfile.variables['time'].origin
>
> etc. etc.
>
> The variables and dimensions of a NetCDF file are stored in dictionaries,
> and the data from variables are accessible via slicing:
>
> time_data = ncfile.variables['time'][:]
>
> The slice returns a numpy ndarray.
>
> HTH,
> Jason
>


-- 
Sent from my iPad Mini

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


Thread

python netcdf Sudheer Joseph <sjo.india@gmail.com> - 2013-06-05 18:07 -0700
  Re: python netcdf Jason Swails <jason.swails@gmail.com> - 2013-06-05 21:33 -0400
  Re: python netcdf Sudheer Joseph <sjo.india@gmail.com> - 2013-06-06 07:22 +0530

csiph-web