Scenario Data Selector

The Scenario Data Selector is a Perl script that makes it easy to serve data from scenario studies on the web. It is ideal when you have

The script will automatically aggregate data over regions, and will calculate growth rates and indices for the indicators you specify.

Try it out online! or just Download it

The Scenario Data Selector is open source, released under the MIT license. Please see the distribution files for the license.

How It Works

You supply a data file and an indicator definition file. You also supply a configuration file with some information about your installation. Then when the Scenario Data Selector script (sds.cgi) is run, it generates the HTML.

Diagram of SDS design

The data file

The data file data.csv contains the actual numbers. It has a simple format, as shown in this sample:

scenario,region,macroregion,year,gdp,pop
Baseline,Africa,Asia and Developing,2000,1898.466892,793.627
Baseline,Africa,Asia and Developing,2010,2762.736319,994.001
Baseline,Africa,Asia and Developing,2020,3949.87246,1224.11
Baseline,Africa,Asia and Developing,2030,5560.424619,1480.77
High Growth,Africa,Asia and Developing,2000,1898.466892,793.627
High Growth,Africa,Asia and Developing,2010,3185.028353,959.343
High Growth,Africa,Asia and Developing,2020,5248.960122,1140.29
High Growth,Africa,Asia and Developing,2030,8515.775634,1331.42
Low Growth,Africa,Asia and Developing,2000,1898.466892,793.627
Low Growth,Africa,Asia and Developing,2010,2465.622288,1022.63
Low Growth,Africa,Asia and Developing,2020,3146.354897,1295.58
Low Growth,Africa,Asia and Developing,2030,3954.130772,1612.22
...

The data should all be for variables that can be added up across regions, such as GDP, population, total emissions, land area, etc. This is what makes it possible for the Scenario Data Selector to automatically aggregate across regions.

The indicator definition file

The values that are actually reported in the table are defined in indicators.csv. Here’s a sample:

Population,millions,Demographics,YYY,pop,1
GDP,trillion 1995$PPP,Economics,YYY,0.001 * gdp,1
Income,1995$PPP/capita,Economics,YYY,1000 * gdp/pop,0

Each line defines an indicator, by specifying

The configuration file

The configuration file, sds.cfg, gives some information about the installation:

For the CSS stylesheet, you can either keep the default (it points to a stylesheet stored on this site), or you can create your own stylesheet.

Download

This is an open-source project hosted on SourceForge. Go to the Scenario Data Selector download page to download the files.

The script is currently in beta, because it requires some care for the person preparing the data and indicator files. However, once the files are set up and tested, it should work without problems for the final end users.

For More Information

For more details about installation and configuration, please see the information in the project files. You can also contact the author at eric@kb-creative.net.