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

Home » Public Forums » archive » ncdf global attribute exists function
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: ncdf global attribute exists function [message #93959 is a reply to message #93957] Wed, 07 December 2016 09:26 Go to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Wednesday, December 7, 2016 at 1:46:32 PM UTC+1, Mark Shephard wrote:
> Hi,
>
> I have looked through all the IDL documentation in regards to ncdf, but cannot seem to find a nice solution. I was wondering if anyone had a simple function to check if a global attribute exists in an netCDF file.
>
> I can use the ncdf_get to get all the global attributes (gatt) and then check the hash to see if the key exists, but this seems to have a lot of overhead. I was looking for something similar to the cdf_attexists(id, attribute_name) procedure, but for ncdf that works on global attributes.
>
> Thanks,
> Mark

What about

function ncdf_global_attr_exists, ncid, attr_name
return, (ncdf_attinq(ncid, attr_name, /global)).length gt 0
end

regards,
Lajos
[Message index]
 
Read Message
Read Message
Previous Topic: Newbie questions
Next Topic: Fitting plasma waveforms with 10^6 variable combos!

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

Current Time: Wed Oct 08 13:56:04 PDT 2025

Total time taken to generate the page: 0.00432 seconds