Subsetting with HDF-EOS


One of the reasons for developing HDF-EOS, and one of the main features that sets it apart from the base HDF library, is the ability to "subset" data fields or data sets based on geolocation parameters such as latitude, longitude, and time. The various options are defined in the HDF-EOS Library Users Guide, but an example is provided herein. A user can define a region of interest (latitude/longitude box) then read a dat field(s) for this particular region. This can be done for all three HDF-EOS APIs. A FORTRAN example is presented below.

After initiating the interface and opening the file (gdopen/swopen), a region is then selected or defined by:

	regionid= gddefboxreg(gdid, cornerlon, cornerlat) 
regionid= swdefboxreg(swid, cornerlon, cornerlat)

where

	cornerlon= array (size=2) containing longitude corners/boundaries
cornerlat= array (size=2) containing latitude corners/boundaries

The data is then extracted and read/buffered into another non-HDF array by:

	status= gdextreg(gdid, regionid, fieldname,data)
status=swextreg(swid,regionid,fieldname,data)

where

	fieldname= data field to be subsetted
data= new array for subsetted data

A FORTRAN example for a grid data set would be:

	cornerlon(1)=70.0
cornerlon(2)=120.0
cornerlat(1)=30.0
cornerlat(2)=60.0
C
	regionid=gddefboxreg(gdid,cornerlon, cornerlat)
status= gdextreg(gdid,regionid,"wind", wind_data)

The array called wind_data would contain the subsetted data from the data field named "wind".


Previous Main Topic

Next Main Topic

Return to Main Topics


Return to top