|
Scientific Data Formats: HDF-EOS |
|
This function writes/updates attributes in a swath. If the attribute does not exist, it is created. If it does exist, then the value is updated.
Result = EOS_SW_WRITEATTR( swathID, attrname, datbuf [, COUNT=value] [, HDF_TYPE=value] )
Returns SUCCEED (0) if successful and FAIL (–1) otherwise.
Swath id (long) returned by EOS_SW_CREATE or EOS_SW_ATTACH.
Attribute name (string).
Attribute values (long). If HDF_TYPE is specified, the attribute values are first converted to the type specified by HDF_TYPE before being stored.
Number of values to store in attribute (long).
HDF data type of the attribute. See IDL and HDF Data Types for valid values.
In this example, we write a single precision (32 bit) floating point number with the name "ScalarFloat" and the value 3.14:
f32 = 3.14 status = EOS_SW_WRITEATTR(swathid, "ScalarFloat", f32)
We can update this value by simply calling the function again with the new value: