Obtaining Information on Existing HDF-EOS Files


As mentioned previously, a single HDF file may contain any number of sub files which might include swath, point, grid data objects as well as regular HDF data objects such as Vdatas and SDS. Within the HDF-EOS APIs, there are routines that can be called within short programs, C or FORTRAN, that, among other operations, can be used to obtain information the entire listings of attributes, dimensions, data fields, maps (geolocation relationships in swaths), geolocation fields and for grids, projections. The following are a few of the commands (FORTRAN version) available that can be used after initializing, accessin, opening/attaching the SW or GD interfaces:

To obtain information on existing attributes:

	nattr=swinqattrs(swid,attrlist,size)
nattr=gdinqattrs(gdid,attrlist,size)

where the output is

	attrlist=list of attributes (string)
size= length of attributes (string)

To obtain information on existing dimensions:

	ndims=swinqdims(swid,dimname,size)
ndims=gdinqattrs(gdid,dimname,size)

where the output is

	dimname=list of dimension names (string)
size= length of dimensions (string)

To obtain information on existing data fields:

	nflds=swinqflds(swid,fieldlist,rank, number type)
nflds=gdinqflds(gdid,fieldlist,rank, number type)

where the output is

	fieldlist=list of data fields (string)
rank= rank of each data field (string)
number type= number type of each data field (string)

To obtain information on existing swath geolocation fields:

	nflds=swinqgflds(swid,fieldlist,rank, number type)

where the output is as above.


To obtain information on existing Swath geolocation mapping relationships:

	nmaps=swinqmaps(swid,dimmap,offset, incremeny)

where the output is

	dimmap=dimension mapping list (string)
offset= offset of each geolocation relationship (array)
increment= increment of each geolocation relationship (array)

To obtain the name and number of all grids within the file:

	ngrid=gdinqgrid(gdid,gridlist,size)

where the output is

	gridlist=listings of grids (string)
size= size of each grid (string)

To obtain information on grid projections:

	projec=gdprojinfo(gdid,projcode,zonecode,zonecode,spherecode, projecparams)

where the projection codes (projcode), spherecode and zonecode of the defined projections supported by HDF-EOS are returned as output.


The user may also wish to find out more information(size, name, number, etc..) of each field, dimension, attribute etc..by using the SWxxxxinfo/swxxxinfo or GDxxxinfo/gdxxxinfo commands where xxx could be:

	dim - dimensions
map - geolocation mapping
attr - attribute
field - data fields of each geolocation relationship (array)

These commands are detailed in Volume 2 of the HDF-EOS Library Users Guide.

Return to top


Previous Main Topic

Next Main Topic

Return to Main Topics