anjaroesel / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Unable to append to an existing netcdf file #218

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write sounding data to a netcdf file.
2. Open netcdf file to in append mode and attempt to append additional sounding 
data to create a yearly database for a particular station
3. Time is defined as unlimited but only initialized with one time step. 
Wondering if this is my issue...

What is the expected output? What do you see instead?
I expect to see a nx89 array of pres, t, td, w_spd, w_dir where n is time and 
89 is the number of vertical levels. The arrays print as nx89 in the script but 
are not being written out to file. The file contains only the first timestep.

I am not sure if I'm indexing the netcdf file correctly.

What version of the product are you using? On what operating system?
The script is in python and using NetCDF4. I am using numpy & Dataset modules.

Please provide any additional information below.

Original issue reported on code.google.com by maryelle...@gmail.com on 27 Mar 2014 at 6:28

Attachments:

GoogleCodeExporter commented 8 years ago
Difficult to know exactly what's going on since I can't run your script (you 
didn't include the data).  If you create a variable named y with dimensions 
('t','x') and the dimension 't' is unlimited and the length of 'x' is 10 and 
you write to y like this

y[:] = data

where data.shape = (89,10), then y.shape will also be (89,10).

If this isn't working for you please create a simple, self-contained script 
that illustrates the problem and create an issue on the new github site 
(http://github.com/Unidata/netcdf4-python).  The netcdf4-python project has 
migrated to github.

Original comment by whitaker.jeffrey@gmail.com on 30 Mar 2014 at 1:59