On Wed, Nov 11, 2009 at 9:26 AM, John <washa...@gmail.com> wrote:
> No problem.. just wanted to make sure it would work and is 'pythonic'.
>
> I guess the biggest concern is that for others using the netcdf file, say
> from matlab or somewhere else, will be able to access the attributes.
>
> It seemed so easy to do it this way, I was curious why the tutorials suggest
> using setattr(), and I wonder if perhaps what I'm setting is not 'global' or
> perhaps wouldn't match some ISO or otherwise NetCDF standard??

It's actually just a nice part of the python language, setattr(a,
'foo', 'bar') is the same code as a.foo = bar.  When working with
NetCDF, the only time I've needed to use setarr (or getattr) is when
the name of the attribute I want isn't a valid python identifier (like
if an attribute has a - in it, e.g. 'unit-type').

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to