f



ncdf global attribute exists function

Hi,

I have looked through all the IDL documentation in regards to ncdf, but can=
not seem to find a nice solution.  I was wondering if anyone had a simple f=
unction 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 che=
ck the hash to see if the key exists, but this seems to have a lot of overh=
ead.  I was looking for something similar to the cdf_attexists(id, attribut=
e_name) procedure, but for ncdf that works on global attributes.

Thanks,
Mark 
0
Mark
12/7/2016 12:46:28 PM
comp.lang.idl-pvwave 12260 articles. 2 followers. Post Follow

1 Replies
35 Views

Similar Articles

[PageSpeed] 46

On Wednesday, December 7, 2016 at 1:46:32 PM UTC+1, Mark Shephard wrote:
> Hi,
>=20
> I have looked through all the IDL documentation in regards to ncdf, but c=
annot 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.
>=20
> I can use the ncdf_get to get all the global attributes (gatt) and then c=
heck the hash to see if the key exists, but this seems to have a lot of ove=
rhead.  I was looking for something similar to the cdf_attexists(id, attrib=
ute_name) procedure, but for ncdf that works on global attributes.
>=20
> Thanks,
> Mark

What about=20

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

regards,
Lajos
0
fawltylanguage
12/7/2016 5:26:12 PM
Reply: