comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Add a variable to existing NetCDF file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Add a variable to existing NetCDF file [message #89957] Fri, 09 January 2015 12:39 Go to previous message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
I know this topic was discussed previously, but the only solution given was to use Dave Fanning's suite of NetCDF tools. Seems like there should be an easier answer.

I opened an existing NetCDF file using ncdf_open with the /write option. Then I set up all the information about a new variable (name, dimensions, etc.) I then tried to create the new variable in the NetCDF file using ncdf_vardef:

newid = ncdf_vardef(id, 'swgup', [timeid,latid,lonid], /float)

In response, I get the message

% NCDF_VARDEF: Unable to define variable, not in define mode.

However, the only way I can find to enter define mode in the Exelis documentation is to create a new file using ncdf_create. There must be another way. If not, why is there a /write option in ncdf_open in the first place? It seems silly to have to copy over the whole existing file just to add a variable. From what I can see, this would take hundreds of commands for my file.

Maybe this question is only for the IDL developers, if using Dave's tools will work. I just don't understand why this should be so difficult.

Laura H.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: object graphics and IDL >= 8.2
Next Topic: Sparse matrixes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:36:29 PDT 2025

Total time taken to generate the page: 0.00413 seconds