On Wednesday, December 7, 2016 at 1:46:32 PM UTC+1, Mark Shephard wrote:
> 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.
> 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.
function ncdf_global_attr_exists, ncid, attr_name
return, (ncdf_attinq(ncid, attr_name, /global)).length gt 0