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

Home » Public Forums » archive » Modify netcdf attributes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Modify netcdf attributes [message #93521 is a reply to message #93519] Wed, 10 August 2016 09:31 Go to previous messageGo to previous message
khyde is currently offline  khyde
Messages: 21
Registered: November 2013
Junior Member
On Wednesday, August 10, 2016 at 11:37:56 AM UTC-4, joe....@noaa.gov wrote:
> On Thursday, August 4, 2016 at 2:49:08 PM UTC-4, KH wrote:
>> Is it possible to change an existing global attribute in a netcdf file? I have figured out a couple different ways to add a new global attribute, but I would also like to modify the information stored in an existing attribute.
>
> You need to be in "define" mode if the attribute is a different size from the existing one (e.g., a string). Try `ncdf_control, ncid, /redef` first to see if that fixes things.


Thank you for your suggestion. I tried the following:

1) id = ncdf_open(file,/write)
2) ncdf_control, id, /redef
3) ncdf_attput, id, 'title', 'new_title',/global
4) ncdf_control,id,/endef
5) ncdf_close, id

The program crashes the entire IDL session at step 4. I tried skipping this step as well, and then it crashes the system at ncdf_close. This happens in both on both the Mac and Linux OS.

Any thoughts on what I am doing wrong or is this something I just won't be able to do without first deleting the original attribute?

Thanks,
-K
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: plotting function will not compile
Next Topic: "Automatically indent lines" breaks copying and pasting code

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

Current Time: Sat Oct 11 23:42:54 PDT 2025

Total time taken to generate the page: 0.79612 seconds