Re: HDF object/tag retrieval [message #55858] |
Tue, 18 September 2007 09:17  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
leatherback wrote:
> Hi David,
>
> Yes. I am sure. The function returns a variable of type string:
>
> [/color]
[color=blue]> for i=0,nglobatts-1 do begin[/color]
[color=blue]> HDF_SD_ATTRINFO,sd_id,i,name=n,type=t,count=c,data=d[/color]
[color=blue]> if (t eq 'STRING' ) then print,strtrim(n),t,c,d[0,0],FORMAT=FS[/color]
[color=blue]> else $[/color]
[color=blue]> if (t eq 'FLOAT' ) then print,strtrim(n),t,c,d[0,0],FORMAT=FF[/color]
[color=blue]> else $[/color]
[color=blue]> if (t eq 'DOUBLE' ) then print,strtrim(n),t,c,d[0,0],FORMAT=FD[/color]
[color=blue]> else $[/color]
[color=blue]> print,strtrim(n),t,c,d[0,0],FORMAT=FI[/color]
[color=blue]> endfor[/color]
[color=blue]> [/color]
>
> ENVI> help, d
> D STRING = '
> GROUP = ARCHIVEDMETADATA
> GROUPTYPE = MASTERGROUP
>
> The actual string returned is roughly 11000 chars long, which
> indicates it holds all the individual tags. When printed, the string
> is structures in an XML kind-a structure (Nested meta data format).
What you're looking at is the ECS archived metadata string, which is
stored in the HDF file attribute named "ArchivedMetadata.0". There's
also an ECS inventory metadata string, which is stored in the HDF file
attribute named "CoreMetadata.0". ECS metadata
< http://observer.gsfc.nasa.gov/ECSInfo/ecsmetadata/index.html> is
stored in Object Description Language (ODL) format
<http://pds.jpl.nasa.gov/documents/qs/ODL.html>. It is supposed to be
part of all EOS data products.
Liam Gumley's routine will handle almost all ordinary cases where you
want to read ECS metadata. However, it will not handle correctly those
unlikely cases where an ECS object's name or value contain the string
"VALUE" or "END_OBJECT", or where an ECS metadata string is too big to
fit in an single HDF attribute. In that latter case, the ECS metadata
is split among multiple HDF file attributes named, for example
"CoreMetadata.0.0", "CoreMetadata.0.1", etc. (I strongly suspect that
the ".0" at the end of "CoreMetadata.0" was the result of
misunderstanding of how this file attribute splitting would be done).
Somebody might have written IDL code to fully and correctly parse ECS
metadata, but I'm not aware of any such program. The SDP Toolkit
library <http://newsroom.gsfc.nasa.gov/sdptoolkit/toolkit.html>
provides C and Fortran routines for writing and reading ECS metadata;
the C routines all have names that start with "PGS_MET_".
|
|
|