Skip to main content

IAM_tools

The IAM_tools is command line utility to query data from AMPERE Scenario database. Input data are comma separated value [csv] file.

For testing purpose there is small test file following IAM structure: tests/iam_test.csv

Installation

IAM_tools can be installed directly from gitlab repository:

pip install iam_tools --upgrade

Usage

The IAM_tools can be used to filter, query and export data from IAM. The command line tool is filter_IAM The filter use regexp when selecting values from columns. The columns to filter are: mode, region, scenario, variable. The utility can be used to show unique values of this columns. Selection can be exported to csv, mat and h5 output file. If the output arg is omitted the result will be printed to console.

Examples

Run help:

filter_IAM -h

IAM_tools is designed to work with the AMPERE project model output. To follow the examples described below, you can use the small subsample (with modified numbers) used for testing. You can downlowd this file here.

Viewing unique entries for a specific index

Print all unique models:

filter_IAM iam_input.csv -unique model

Print to console unique regions of rows where model is GCAM:

filter_IAM iam_input.csv -model "GCAM" -unique region
Selecting rows based on the index

Print to console all rows where variables starts with "Capacity|Electricity|":

filter_IAM iam_input.csv -variable "^Capacity\|Electricity\|.*"

Note, that the vertical bar '|' has a special meaning in regex (as the or symbol). Thus to match the literal character '|' you have to escape it with a backslash ('\').

Export all rows where variable column start with Secondary Energy|Electricity| to my_output.mat [cell array] file:

filter_IAM iam_input.csv -variable "^Secondary Energy\|Electricity\|.*" -output my_output.mat

Export all rows where scenario column contains 450- and -OPT to my_output.csv file:

filter_IAM iam_input.csv -scenario "450-.*.-OPT" -output my_output.csv

Print to console all rows where models are either GCAM or REMIND:

filter_IAM iam_input.csv -model "GCAM|REMIND"

Export all rows where variable column start with Emissions|CO2 to my_output.csv file:

filter_IAM iam_input.csv -variable "^Emissions\|CO2.*" -output my_output.csv

Contributing

If you find a bug or have suggestions for improvement please use the Issue Tracker for communication. Development follows a gitlab centric workflow, thus if you want to contribute fork the repository and file a merge request when you are finished.

Authors

  • Radek Lonka
  • Konstantin Stadler

License

BSD 3-Clause License

Copyright (c) 2018, Industrial Ecology Digital Lab at NTNU

Metadata

Release files for iam-tools 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iam-tools 0.1.5
File Size Uploaded
iam_tools-0.1.5.tar.gz 5.0 kB Details

Release files / iam_tools-0.1.5.tar.gz

Download URL iam_tools-0.1.5.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6619f179df983703f8d746c46e91f178b9a426901b36c4f65e24d24d45c81aca
BLAKE2b-256 checksum
How to use checksums
c2b64278b41d2739268438966876fa7924706ecff78550063b6b463e711b2231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page