Re: Can't exit DEFINE mode in netCDF File [message #68266 is a reply to message #68119] |
Tue, 06 October 2009 15:33   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> FĂ–LDY Lajos came up with a solution,
>
>
>> I have found the solution: _FillValue needs to be the same type as the
>> variable. ' ' is an IDL string, which is converted to something, probably
>> BYTE. So let's add an explicite /CHAR to ncdf_attput:
>>
>> ncid=ncdf_create('test.nc', /clobber)
>> dim32=ncdf_dimdef(ncid, 'dim1', 32)
>> n_absorbers_dimid=ncdf_dimdef(ncid, 'dim2', 9)
>> varid = ncdf_vardef( ncid, 'absorber_units_name', [dim32,n_absorbers_dimid], /char)
>> ncdf_attput, ncid, varid, '_FillValue', ' ', /CHAR
>> ncdf_control, ncid, /endef
>> ncdf_close, ncid
>>
>> It works now! :-)
>>
>> regards,
>> lajos
>
> Does that help?
Ah! Yes, I remember reading that and thinking it was too
esoteric for an article on my web page. I should have known
better. I won't make that mistake again!
Where is it written, though, that the _FillValue attribute has
to be the same data type as the variable it is an attribute of?
And why doesn't *that* cause an error, instead of this action at
a distance thing?
I'm not sure this was worth three hours of effort, not counting the
time it will take to write the damn article. :-(
Thanks for the help.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|