SME Data Preparation

Obtaining and preprocessing the data necessary to execute a spatial simulation can be the most time consuming part of spatial modeling. There are two general methods for importing data into the SME: 1) Import the date into the SME database and then configure the Driver to read from the DataBase, or 2) Configure the Driver to read the data directly from disk. Whichever method is used, the user must initially convert his/her data into a format that is readable by the SME.

There are a number of different types of data that can be imported into the SME, which are discussed in the following sections.

10.1 Maps

A map is a generally a two-dimensional array of N-byte unsigned values, where N can range from 1 to 4, although some import methods allow arrays of floats. The N-byte binary data is converted to floating point values when read into the SME, see the documentation on the S() config-cmd (section 7.1.2) for an explanation of the scaling algorithm. Maps can be imported into the SME in a number of different formats.

10.1.1 Map II format

The Macintosh-based GIS application MapII can be used to generate maps for import to the SME. Use the ‘M’ mapSource option in the d() or c() config-cmd (section 7.1.3-4) to configure map input in MapII format SMESpatial data may be input from other databases and GIS programs to MapII, and other GIS programs (such as GRASS) can be used to generate maps in MapII format. The MapII project documents must be exported as MapII binary interchange format files (referred to here as "MapII format"). MapII format consists of a simple header file, and a binary file for each MapII file. The user may check ou the examples in one of the DEMO projects if MapII is not available.

10.1.2 GRASS format

Maps may be imported directly from GRASS if the SME is running inside of the GRASS environment. Use the ‘G’ mapSource option in the d() or c() config-cmd (section 7.1.3-4) to configure map input from GRASS. Be sure to set the current region for the GRASS environment using the command "g.region" before the simulation is started. All maps read into the SME should exist in the current mapSet selected within GRASS. The user should also configure the Frame-definition maps (in Modules receiving GRASS maps) to be read from GRASS (sections 7.3.1-2) to make sure that there is no conflict between the GRASS current region and the SME Frames.

10.1.3 HDF format

Maps can be imported in HDF format. Both RIS and SDS format are supported. Use the ‘H’ mapSource option in the d() or c() config-cmd (section 7.1.3-4) to configure map input in HDF RIS format.

10.1.4 ArcInfo format

Maps can be imported in ArcInfo exchange format. Use the ‘A’ mapSource option in the d() or c() config-cmd (section 7.1.3-4) to configure map input in ArcInfo format.

10.2 Timeseries Data

A common form for data is the timeseries. Two timeseries input data formats (denoted ‘format 1’ and ‘format 2’) are currently supported by the SME. Data may be exported in these formats from spreadsheets or other database programs. Examples of these formats are included in the demo project Data/Examples directory. The Example1.ts file is format 1, Example2.ts file is format. 2. To get data into these formats the user may: 1) copy the example file and edit the values, 2) configure a spreadsheet program worksheet in this format and export the file, or 3) write and/or use a program to format timeseries data.

Format 1 is specifically for a one-year tabulation of daily data, where row headings are days of the month and column headings are months. There are more than 10 data fields for header information. The data above and below the separating ---------- lines is ignored. The data between the lines may be tab or space(s) delimited.

Format 2 is the simpler one consisting of a single column of data with a header to define timestep and number of data points. In format 2 the user may set the time step of the data.

10.3 PointTimeseries Data

The SMP Extrapolated TimeSeries Variable is able to generated an extrapolated spatial grid (map) at each timestep from a set of spatially referenced timeseries data files. The extrapolation routine generates a map at each timestep of the simulation by interpolation of a slice of the time series data at the current time.

To define which timeseries files are to be included in the extrapolation, the user creates a Spatial Extrapolation Point Timeseries (PTS) file that must be identified with the suffix ".pts". The data included in this PTS file must follow the form of the PTS file included in the demo project Data/Examples directory. The header defines the data directory:

Data Directory = <ProjDir>/Data

followed by a column of timeseries filenames preceded by the row (c0), and column (c1) coordinates for each point:

c0 c1 <Timeseries filename>.

To configure the SME to import this data, use the Spatially Extrapolated Timeseries config-cmd (section 7.1.7). At the beginning of the simulation the SME will read a set of timeseries named <Timeseries filename><index>.ts (where <index> is an file index starting at 0, see section 7.5.1) from the directory <Data Directory>. The variable's value (IDS) will be generated at each step of the simulation by extrapolation between the spatially referenced timeseries.

10.4 Class-Dependent Parameter Data

Class-Dependent parameter data is used to initialize Class-Dependent Variables (section 4.1.3). The SME can be configured to import this Data using the Dbase Input config-cmd (section 7.1.6).