...
The file format was documented by ESRI online. (PDF version) and supports integer (1- to 32- bit) pixel values in signed or unsigned format, in either little- or big endian storage order. The 1- and 4- bit integer pixel formats have not been implemented (yet) as they seem less useful for FEWS, but the rest of the documentation is fully implemented.
Note: It is assumed that your data is using unsigned integers, unless the keyword "pixeltype" is used and its value is"signedint".
BIL files in FEWS
In the Public Interface (PI interface) of FEWS, an implementation of the BIL format is also provided, as documented here.
...
This new implementation is fully compliant with the ESRI technical specifications and can be configured with the new "BILBIPBSQ" identifier, whereas the existing PI implementation of FEWS BIL files uses the identifier "BIL".
Using NoData for missing values
In the header files (*.HDR) which normally come with a BIL / BIP / BSQ file, a NoData field can be used to define the numerical value which has been assigned to pixels for which there is no valid data. This field is not mentioned in the ESRI documentation but it's usage is very common, as follows:
Code Block | ||
---|---|---|
| ||
NODATA -999
|
The result if this example is identical to defining <missingValue>-999</missingValue> in the import configuration.
Using NBLOCKS for time series
...
Appending the binary image files (each having the same format and dimensions) to create a time series can be done using (for example) a DOS copy command in binary append mode, as follows:
Code Block | ||
---|---|---|
| ||
copy /b step1.bil+step2.bil+step2step3.bil+step4.bil 4steps.bil |
A header file for the resulting time series can be made by copying and renaming any of the input header files (*.hdr) and adding an extra line to define the number of file blocks:
Code Block | ||
---|---|---|
| ||
NBLOCKS 4 |
If the header contains a definition of NBLOCKS larger than 1, an extra file (*.tim) is required to define a timestamp per block in the format YYYYMMDDHHMM:
Code Block | ||
---|---|---|
| ||
200001011200 200001011300 200001011400 200001011500 |
Note: The way the NBLOCKS parameter is added to the header file (*.hdr) and an extra file with time step definitions (*.tim) is added is practically the same as how these are used by the PI-BIL parser, but one should realize that the order in which BANDS (parameters) and BLOCKS (time steps) are stored is not the same, so the files are not compatible unless either NBANDS or NBLOCKS equals 1.
Configuration
The following configuration example shows what is required to import BIL/BIP/BSQ format satellite data into FEWS. The following files need to be adjusted:
- Locations.xml: to add the satellite location ID
- Grids.xml: for the grid characteristics
- Import_BIL.xml: module instance that imports the data (for example)
- IDMapping file if a special parameter ID needs to be specified
- ModuleInstanceDescriptors.xml: For reference of the import module instance
- ImportUnitConversions.xml: If the units need to be converted on importing
For some of these files examples are provided below. Locations, ModuleInstanceDescriptors and ImportUnitConversions are standard FEWS configuration files.
Example of the locations.xml file element:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<location id="SATH_AFRICA" name="SATH_AFRICA"> <shortName>SATH_AFRICA</shortName> <x>0</x> <y>0</y> </location> |
Example of the Grids.xml file element:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<regular locationId="SATH_AFRICA"> <description>SATH Rainfall files</description> <rows>702</rows> <columns>1002</columns> <geoDatum>WGS 1984</geoDatum> <firstCellCenter> <x>-13</x> <y>25</y> <z>0</z> </firstCellCenter> <xCellSize>.03</xCellSize> <yCellSize>.03</yCellSize> </regular> |
Example of the ID mapping to map band numbers to FEWS parameters:
Code Block | ||||
---|---|---|---|---|
| ||||
<idMap > <parameter internal="P.obs" external = "0"/> <parameter internal="T.obs" external = "1"/> </idMap> |
An example import Module instance configuration file that maps the BSQ band nuymbers (0,1) to FEWS parameters (P.obs, T.obs):
Code Block | ||||
---|---|---|---|---|
| ||||
<timeSeriesImportRun> <import> <general> <importType>BILBIPBSQ</importType> <folder>$IMPORT_FOLDER$\BSQ</folder> <fileNameObservationDateTimePattern>'NI_'yyyyMMdd'.BSQ'</fileNameObservationDateTimePattern> <idMapId>IdImportBSQ</idMapId> <unitConversionsId>ImportUnitConversions</unitConversionsId> <importTimeZone> <timeZoneOffset>+00:00</timeZoneOffset> </importTimeZone> <geoDatum>WGS 1984</geoDatum> <dataFeedId>SATH_AFRICA</dataFeedId> </general> <timeSeriesSet> <moduleInstanceId>ImportBSQ</moduleInstanceId> <valueType>grid</valueType> <parameterId>P.obs</parameterId> <locationId>SATH_AFRICA</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="day"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="30"/> </timeSeriesSet> <timeSeriesSet> <moduleInstanceId>ImportBSQ</moduleInstanceId> <valueType>grid</valueType> <parameterId>T.obs</parameterId> <locationId>SATH_AFRICA</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="day"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="30"/> </timeSeriesSet> </import> </timeSeriesImportRun> |