How do I retrieve the value of a global attribute from a netCDF file in Python by its name?
I have tried:
value = ncfile.getncattr(ncfile, global_attribute_name)
but I get the error:
NameError: name 'global_attribute_name' is not defined
I have also read the section of the netCDF4 API documentation that deals with global attributes, but I'm sure there's something I don't understand with the syntax.
Can anyone help? I'm an R user moving over to Python, please be gentle.