Re: Create NetCDF string variable?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 29 2012 - 14:19:04 MDT

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

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Mon Oct 29 14:19:11 2012

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