Re: Create NetCDF string variable?

From: Daniel Gilmore <daniel.gilmore_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 30 2012 - 10:40:54 MDT

Thanks, that definitely helps.

Am I right in assuming that the same general idea also works with 2
dimensional arrays?

Also, we're still using PyNio 1.3.1. This method will work with that
version?

Dan

On Mon, Oct 29, 2012 at 4:19 PM, David Brown <dbrown@ucar.edu> wrote:

> Hi Dan,
> Currently PyNIO only supports the classic interface to NetCDF. Classic
> NetCDF only has a character type, not a string type. Therefore you must
> figure out in advance the longest string you have, and create the rightmost
> dimension with a size appropriate for the longest string. There is an
> example in the test directory that show how to write strings to a NetCDF
> file. It is not very long so I am attaching it here.
> -dave
>
>
>
> On Oct 29, 2012, at 6:24 AM, Daniel Gilmore wrote:
>
> Could someone post an example of using PyNio to create a NetCDF string
> variable? I've tried:
>
> fh = Nio.open_file('foobar.nc','w')
> fh.create_dimension('x',10)
> fh.create_dimension('y',10)
> fh.create_dimension('z',20)
> dims = ('x','y','z')
> fh.create_variable('hellostring','s',dims)
>
> And that is giving me an error. What am I doing wrong and what is the
> right way I should be doing it?
>
> Dan
>
> --
> --
> Daniel Gilmore (AceInfo Solutions)
> PGB/MDL/OST/NWS/NOAA
> Office #: SSMC2-10357
> Phone: 301.713.0224 x101
> Cell: 703.232.9603
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
>
>
>

-- 
-- 
Daniel Gilmore (AceInfo Solutions)
PGB/MDL/OST/NWS/NOAA
Office #: SSMC2-10357
Phone: 301.713.0224 x101
Cell: 703.232.9603

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Oct 30 10:41:04 2012

This archive was generated by hypermail 2.1.8 : Thu Nov 01 2012 - 09:04:53 MDT