You are here

Working with external data : Raw data in scenario file

Normally, the scenario file contains only references to data files, with information as to how the data is to be extracted. However, if you type the data straight into the entry field in the file parameter dialogue, or edit it with the table editor from the table data dialogue, the resulting data no longer corresponds to anything that can be got from a data file, so instead the data is stored directly in the scenario file. This is usually a bad thing, because the XML format used is unwieldy and verbose, and it may take a long time to load or save.

Working with external data : Time series

In the section on time series formats, we saw that the series includes special time points and special values to specify what what values to use away from the actual data points. If you are using one of the mechanisms provided by the table data dialogue to get your data, you do not have the opportunity to include these special points (unless they happen to be in your .csv file, and if they are, they work fine). But you can get the same effect by including them with the tools in the 'other times' panel in the top right corner.

Working with external data : View/edit as table

Once you are in the table data dialogue, you can hit the View/Edit button to bring up a version of the table helper to display your data and, if necessary, edit it. The data need not have come from a file; it might just have been typed into the entry field of the file parameters dialogue. However it will not work if the data has been loaded as raw data from the scenario file.

Working with external data : Data from GeoTIFF or similar

GeoTIFF is a file format which is based on the TIFF image, but which is not actually an image and cannot be displayed in most image viewers. It differs from an image file in that:

Working with external data : Data from image

Simile can extract a 2-dimensional array of data from an image file, with each pixel in the image corresponding to a datapoint. The image can be in any format supported by the Tkimg package, which is to say, most of them.

Working with external data : .csv file with data in grid

If you have a .csv file with a 2-dimensional grid of data items, this can be loaded directly into a 2-dimensional array file parameter in Simile. For other 2-D formats that can be read into a spreadsheet, you can create the .csv file.

Working with external data : Loading and saving scenario files

Once you have specified the data for all the file parameters, you can save that data in a scenario file (extension .spf, sometimes referred to as a parameter metafile). This file does not necessarily contain the actual data, it can contain references to the files that actually contain the data. It is in an XML format, allowing it to be examined and edited if required.

Working with external data : Referencing data in files

Ther normal way to use the file parameter system is to create and save references to data in other files. To do this, click the 'pencil' icon to the right of the data entry field. This brings up the table data dialogue, which allows you to specify the file containing the data, and how to get the data from the file.

Once this has been done, hovering over the entry field will produce a popup showing which file contains the actual data. Hitting the 'pencil' button again will show the reference information and allow it to be altered.

Working with external data : Specifying time series

The File Parameters dialogue will contain entry fields for both fixed and variable parameters. Fixed parameters must be given a value; their captions in the dialogue will be shown in red until a correctly formatted value has been supplied. Variable parameters do not need a value, and can be left empty, so the value can be set by a slider while running the model. However, it is possible to enter a time series in the File Parameters dialogue, which will cause the variable parameter's value to be set at a series of specified time points while the model is running.

File Parameter dialogue : Entering values directly

The simplest way to set a file parameter is to type its value straight into the entry box beside its caption in the file parameter dialogue. For single values, this is the only way to enter them initially. The tick button replaces the currently saved value with what has been typed in, while the cross button reverts the entry field to the saved value.

Pages

Subscribe to Simulistics RSS