ToArcInfoASCIIGridArcGISTable Method

Converts a Scientific Data Set (SDS) in each HDF file in a table to a text file in an ArcInfo ASCII Grid format.

Class:HDF
Intended use:Recommended for external callers
COM:Exposed as the ToArcInfoASCIIGridArcGISTable method of COM class GeoEco.HDF
ArcGIS:Exposed as the Convert SDS in HDFs Listed in Table To ArcInfo ASCII Grids geoprocessing tool
Method type:Classmethod

Usage

outputTable = HDF.ToArcInfoASCIIGridArcGISTable(table, inputFileField, outputFileField, sdsName, xLowerLeftCorner, yLowerLeftCorner, cellSize[, nodataValue[, transpose[, mirror[, flip[, swapHemispheres[, where[, orderBy[, directions[, skipExisting[, overwriteExisting[, basePath]]]]]]]]]]])

Arguments

table
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:Yes

Table to query.

inputFileField
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:No

Field containing the paths of the input HDF files.

At the time this tool was written, two major versions of HDF were under continuing development: HDF, which was at release 4.2r1, and HDF5, which was at release 5-1.6.5. This tool can process HDF files but not HDF5 files. It can also process HDF-EOS, a specialized version of HDF, but not HDF5-EOS.

For more information on HDF formats, please see http://www.hdfgroup.org.

If you provide compressed files in a supported compression format, they will be automatically decompressed. If files are compressed in an archive format (e.g. .zip or .tar), each archive must contain exactly one file, which must not be in a subdirectory.

outputFileField
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:No

Field containing the paths of the ArcInfo ASCII Grid files to create.

ArcInfo ASCII Grid format is not formally specified by ESRI but you can find informal specifications by searching the Internet. The format is well-known, stable and very simple. A short example:

ncols 4
nrows 6
xllcorner 0
yllcorner 0
cellsize 50
NODATA_value -9999
-9999 -9999 5 2
-9999 20 100 36
3 8 35 10
32 42 50 6
88 75 27 9
13 5 1 -9999
sdsName
Python type:unicode
Minimum length:1

Name of a Scientific Data Set (SDS) in the HDF file.

If you do not know the name of the SDS, provide your best guess. If an SDS does not exist with that name, a ValueError will be raised. The error message will list the names of all SDSes present in the input file. Select one of these names try again.

You can also use the Extract HDF Header tool to dump the HDF header to a text file. In this file, each SDS will be called a "variable". You can find their names by searching the file for "Variable Name =". For example, the excerpt below from MODIS SST data lists two variables, l3m_data and l3m_qual:

Variable Name = l3m_data
         Index = 0
         Type= 16-bit unsigned integer
         Ref. = 2
         Rank = 2
         Number of attributes = 4
         Dim0: Name=fakeDim0
                 Size = 4320
                 Scale Type = number-type not set
                 Number of attributes = 0
         Dim1: Name=fakeDim1
                 Size = 8640
                 Scale Type = number-type not set
                 Number of attributes = 0
         Attr0: Name = Scaling
                 Type = 8-bit signed char
                 Count= 7
                 Value = linear\\000
         Attr1: Name = Scaling Equation
                 Type = 8-bit signed char
                 Count= 47
                 Value = (Slope*l3m_data) + Intercept = Parameter
                         value\\000
         Attr2: Name = Slope
                 Type = 32-bit floating point
                 Count= 1
                 Value = 0.000717
         Attr3: Name = Intercept
                 Type = 32-bit floating point
                 Count= 1
                 Value = -2.000000

Variable Name = l3m_qual
         Index = 1
         Type= 8-bit unsigned integer
         Ref. = 4
         Rank = 2
         Number of attributes = 1
         Dim0: Name=fakeDim2
                 Size = 4320
                 Scale Type = number-type not set
                 Number of attributes = 0
         Dim1: Name=fakeDim3
                 Size = 8640
                 Scale Type = number-type not set
                 Number of attributes = 0
         Attr0: Name = valid_range
                 Type = 32-bit signed integer
                 Count= 2
                 Value = 0 2
xLowerLeftCorner
Python type:float

X coordinate of the lower-left corner of the raster.

The coordinate is for the corner of the lower-left cell, not the center of that cell. For example, if the raster is a geographic projection of the entire Earth, the coordinate of the lower left corner would be -180.0, corresponding to a longitude of 180 degrees West.

yLowerLeftCorner
Python type:float

Y coordinate of the lower-left corner of the raster.

The coordinate is for the corner of the lower-left cell, not the center of that cell. For example, if the raster is a geographic projection of the entire Earth, the coordinate of the lower left corner would be -90.0, corresponding to a latitude of 90 degrees South.

cellSize
Python type:float

Size of each raster cell.

For example, if the raster is a geographic projection of the entire Earth, with 720 columns and 360 rows, it would have a cell size of 0.5, corresponding to 1/2 of a geographic degree.

The underlying data format requires the cells be square. It is not possible to specify a cell size for each dimension.

nodataValue
Python type:float or None
Default value:None

Value that indicates a cell has no data.

transpose
Python type:bool
Default value:False

If True, the image will be transposed (flipped about the diagonal axis) prior to conversion. Use this option to fix an image that has the east/west axis going up and down instead of left and right.

mirror
Python type:bool
Default value:False

If True, the image will be flipped about the vertical axis prior to conversion. Use this option to fix an image that is the "mirror image" of what it is supposed to be.

flip
Python type:bool
Default value:False

If True, the image will be flipped about the horizontal axis prior to conversion. Use this option to fix an image that is upside-down.

swapHemispheres
Python type:bool
Default value:False

If True, the east and west hemispheres of the image will be swapped. Use this option to change the orientation of a global image from a 0 to 360 orientation centered on the Pacific ocean to a -180 to +180 orientation centered on the Atlantic ocean, or visa versa.

where
Python type:unicode or None
Default value:None
Minimum length:1

SQL WHERE clause expression that specifies the subset of rows to process. If this parameter is not provided, all of the rows will be processed. If this parameter is provided but the underlying database does not support WHERE clauses, an error will be raised.

The exact syntax of this expression depends on the underlying database. ESRI recommends you reference fields using the following syntax:

orderBy
Python type:list of unicode, or None
Default value:None
Minimum length:0

Fields that will be used to sort the rows (i.e., the columns specified in the ORDER BY clause of a SQL SELECT statement). If no fields are provided, the rows will be sorted in the default order determined by the underlying database. If this parameter is provided but this computer is not running ArcGIS 9.2 or later or the underlying database does not support ORDER BY clauses, an error will be raised.

In addition to specifying the ORDER BY fields, you must also specify the sort direction for each field.

directions
Python type:list of unicode, or None
Default value:None
Minimum length:0

List of strings, either 'Ascending' or 'Descending', that specify the sort directions for the ORDER BY fields. If this parameter is provided but this computer is not running ArcGIS 9.2 or later or the underlying database does not support ORDER BY clauses, an error will be raised.

skipExisting
Python type:bool
Default value:False

If True, processing will be skipped for ArcInfo ASCII Grid files that already exist.

overwriteExisting
Python type:bool
Default value:False

If True and skipExisting is False, existing ArcInfo ASCII Grid files will be overwritten.

basePath
Python type:unicode or None
Default value:None
Minimum length:1
Maximum length:255
Must exist:No

Base path to prepend to relative paths.

If a base path is provided, it will be prepended to any relative paths that are obtained from the fields that list the inputs (and outputs, if this tool has outputs). If a base path is not provided, the workspace containing the table will be prepended instead.

Returns

outputTable
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:No

Processed table.