openModeller request files

26.02.2012 13:36 ·  GIS  ·  openmodeller, howto

In the post about openModeller command-line tools, I have mentioned request files several times. When using openModeller from the command line, we have to deal with these files very often, as they allow us to perform almost all necessary actions and go from the input data to the results.

So let’s take a closer look at these files.

General information

A request file is a plain text file containing key-value pairs separated by one or more line feeds. Request files are often used as input data for various openModeller console tools. For example, using the request file, om_console can: create a model; apply an existing model to a set of layers; or create a model and immediately apply it to a set of layers. The om_viewer and om_sampler also work with request files.

Although the request file does not have a strict structure, it can be logically divided into several sections:

Lines starting with # are comments and will be ignored. Blank lines are also ignored.

Depending on the task, a request file may contain all or only some of the above sections. Let’s have a closer look at each section.

Definition of the occurrence points

As the name suggests, these are parameters related in one way or another to species occurrence points. This section includes the following parameters:

All these parameters are only used to create a new model. Here is an example:

WKT Coord System = GEOGCS["WGS84", DATUM["WGS84", SPHEROID["WGS84", 6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0], UNIT["degree", 0.017453292519943295], AXIS["Longitude",EAST], AXIS["Latitude",NORTH]]
Occurrences source = /home/alex/data/gbif/physalis_peruviana.txt
Occurrences group = Physalis peruviana
Spatially unique = true
Environmentally unique = false

Definition of the source layers

This section describes the layers used to create the model.

Example:

Map = /data/cru_bioclim/meanDiurnal.asc
Map = /data/cru_bioclim/meanDiurnalOverCoolestM.asc
Map = /data/cru_bioclim/meanDiurnalOverWarmestM.asc
Map = /data/cru_bioclim/meanFrostDays.asc
Map = /data/cru_bioclim/meanPrecip.asc
Map = /data/cru_bioclim/meanPrecipOverCoolestQ.asc
Map = /data/cru_bioclim/meanPrecipOverDriestM.asc
Map = /data/cru_bioclim/meanPrecipOverDriestQ.asc
Map = /data/cru_bioclim/meanPrecipOverFrostFreeM.asc

Mask = /data/cru_bioclim/stdevMeanTemp.asc

Final model definition

One of the results of the analysis is a species distribution model that can be saved to disk in XML format (the so-called “generated model”). If the request file isn’t used to generate a model, all parameters of this group should be omitted.

Output model = /home/alex/models/my_model.xml

Projection settings

A model previously created with om_console or om_model can be used as an input model and applied to a set of layers. In this case, all parameters related to occurrence points and source layers are ignored.

Input model = /home/alex/models/test_model.xml

Definition of the target layers

This group of parameters is only needed if you are applying the generated model to a different set of layers.

Example

Output map = /data/clim_2050/meanDiurnal.asc
Output map = /data/clim_2050/meanDiurnalOverCoolestM.asc
Output map = /data/clim_2050/meanDiurnalOverWarmestM.asc
Output map = /data/clim_2050/meanFrostDays.asc
Output map = /data/clim_2050/meanPrecip.asc
Output map = /data/clim_2050/meanPrecipOverCoolestQ.asc
Output map = /data/clim_2050/meanPrecipOverDriestM.asc
Output map = /data/clim_2050/meanPrecipOverDriestQ.asc
Output map = /data/clim_2050/meanPrecipOverFrostFreeM.asc

Output mask = /data/clim_2050/stdevMeanTemp.asc

Projection results

The result of the projection (application of the model) is a raster file showing the species distribution in a given area. The extent of this area will be equal to the combined extent of all layers defined as ‘Output map’ and the mask layer. The coordinate reference system of the output raster, as well as the pixel size, will be the same as that of the template raster. The Output format parameter defines the template raster.

Output format = /data/clim_2050/stdevMeanTemp.asc
Output file type = ByteHFA
Output file = /data/output/acacia-2050.img

Algorithm parameters

If the parameters of this group are not set, om_console will enter interactive mode, display a list of all available algorithms, and ask you to select the desired one. The algorithm parameters are prompted in the same way. If the algorithm and its parameters are set in the request file, om_console will work in non-interactive mode and process the request file without user intervention.

Parameters from this group are only required when generating a model.

If some or all of the parameters are not set, om_console will prompt the user for the value of the missing parameters.

Here is an example of an algorithm definition

Algorithm = CSMBS
Parameter = Randomisations 8
Parameter = StandardDeviations 2
Parameter = MinComponents 1
Parameter = VerboseDebugging 1

The complete request file will look like this:

# Occurrence points
WKT Coord System = GEOGCS["WGS84", DATUM["WGS84", SPHEROID["WGS84", 6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0], UNIT["degree", 0.017453292519943295], AXIS["Longitude",EAST], AXIS["Latitude",NORTH]]
Occurrences source = /home/alex/data/gbif/physalis_peruviana.txt
Occurrences group = Physalis peruviana
Spatially unique = true
Environmentally unique = false

# Input layers
Map = /data/cru_bioclim/meanDiurnal.asc
Map = /data/cru_bioclim/meanDiurnalOverCoolestM.asc
Map = /data/cru_bioclim/meanDiurnalOverWarmestM.asc
Map = /data/cru_bioclim/meanFrostDays.asc
Map = /data/cru_bioclim/meanPrecip.asc
Map = /data/cru_bioclim/meanPrecipOverCoolestQ.asc
Map = /data/cru_bioclim/meanPrecipOverDriestM.asc
Map = /data/cru_bioclim/meanPrecipOverDriestQ.asc
Map = /data/cru_bioclim/meanPrecipOverFrostFreeM.asc

Mask = /data/cru_bioclim/stdevMeanTemp.asc

# Generated model
Output model = /home/alex/models/my_model.xml

# Layers used for projecting (applying) model
Output map = /data/clim_2050/meanDiurnal.asc
Output map = /data/clim_2050/meanDiurnalOverCoolestM.asc
Output map = /data/clim_2050/meanDiurnalOverWarmestM.asc
Output map = /data/clim_2050/meanFrostDays.asc
Output map = /data/clim_2050/meanPrecip.asc
Output map = /data/clim_2050/meanPrecipOverCoolestQ.asc
Output map = /data/clim_2050/meanPrecipOverDriestM.asc
Output map = /data/clim_2050/meanPrecipOverDriestQ.asc
Output map = /data/clim_2050/meanPrecipOverFrostFreeM.asc

Output mask = /data/clim_2050/stdevMeanTemp.asc

# Projection result
Output format = /data/clim_2050/stdevMeanTemp.asc
Output file type = ByteHFA
Output file = /data/output/acacia-2050.img

# Algorithm to use
Algorithm = SVM
Parameter = SvmType 0
Parameter = KernelType 2
Parameter = Degree 3
Parameter = Gamma 0
Parameter = C 1
Parameter = Coef0 0
Parameter = Nu 0.5
Parameter = ProbabilisticOutput 0
Parameter = NumberOfPseudoAbsences 500

As you can see, there is nothing complicated about request files. A simple text format makes it easy to create them programmatically and then use them to process data.

⮜ Prev
Next ⮞