CDF_ATTGET_ENTRY -------------------------------------------------------------------------------- The CDF_ATTGET_ENTRY procedure reads a variable attribute's entry from a CDF file. Syntax CDF_ATTGET_ENTRY, Id, Attribute, EntryNum, Value, AttributeEntryType, Value, Status [,CDF_TYPE= attribute_entry_datatype] [, ATTRIBUTE_NAME=attribute_name] [,/ZVARIABLE] Arguments --------- Id The CDF ID, returned from a previous call to CDF_OPEN or CDF_CREATE. Attribute A string containing the name of the attribute or the attribute number from which attribute entry is retrieved. EntryNum The entry number. If the attribute is variable in scope, this is either the name or number of the variable the attribute is to be associated with. If the attribute is global in scope, this is the actual gEntry. It is the user's responsibility to keep track of valid gEntry numbers. Normally, gEntry numbers will begin with 0 or 1 and will increase up to MAXGENTRY (as reported in the GET_ATTR_INFO structure returned by CDF_CONTROL), but this is not required. AttributeEntryType The data type of the requested attribute entry Value A named variable in which the value of the attribute is returned. Status Return status. 1 is returned if the requested attribute exist and its entry is retrieved. Otherwise, 0 is returned. Keywords -------- CDF_TYPE Set this keyword equal to a named variable that will contain the CDF type of the attribute entry, returned as a scalar string. Possible returned values are: CDF_CHAR, CDF_UCHAR, CDF_INT1, CDF_BYTE, CDF_UINT1, CDF_UINT2, CDF_INT2, CDF_UINT4, CDF_INT4, CDF_REAL4, CDF_FLOAT, CDF_REAL8, CDF_DOUBLE, CDF_EPOCH, or CDF_EPOCH16. If the type cannot be determined, "UNKNOWN" is returned. ATTRIBUTE_NAME The name of the requested attribute number. ZVARIABLE If EntryNum is a variable ID (as opposed to a variable name) and the variable is a zVariable, set this flag to indicate that the variable ID is a zVariable ID. The default is to assume that EntryNum is an rVariable ID. Note: the attribute must have a scope of VARIABLE_SCOPE. Examples -------- id = cdf_open('test.cdf') inq = cdf_inquire(id) ; Read all the variable attribute entries. for var_num = 0, inq.nzvars-1 do begin for attr_num = 0, inq.natts-1 do begin cdf_attget_entry, id, attr_num, var_num, att_type, value, status, /zvar, cdf_type=cdf_type, attribute_name=att_name if status ne 1 then continue print, "attr_name = ", att_name, ", ", cdf_type, ", ", value endfor endfor