Export API

Functions for listing completed calculations and outputs, as well as exporting outputs to files.

Functions for getting information about completed jobs and calculation outputs, as well as exporting outputs from the database to various file formats.

openquake.engine.export.core.LT_PATH_JOIN_TOKEN = '_'

Used to separate node labels in a logic tree path

openquake.engine.export.core.export(output_id, target, export_type='xml, geojson, csv')[source]

Export the given calculation output_id from the database to the specified target directory in the specified export_type.

openquake.engine.export.core.get_outputs(job_id, output_type=None)[source]

Get all openquake.engine.db.models.Output objects associated with the specified job and output_type.

Parameters:
Returns:

django.db.models.query.QuerySet of openquake.engine.db.models.Output objects.

openquake.engine.export.core.makedirs(path)[source]

Make all of the directories in the path using os.makedirs.

Hazard Export

API for exporting hazard artifacts from the DB.

Functionality for exporting and serializing hazard curve calculation results.

openquake.engine.export.hazard.export_disagg_matrix_xml(key, output, target)[source]

Export disaggregation histograms to the target.

Parameters:
Returns:

A list of exported file name (including the absolute path to each file).

openquake.engine.export.hazard.export_gmf_xml(key, output, target)[source]

Export the GMF Collection specified by output to the target.

Parameters:
Returns:

The same return value as defined by export().

openquake.engine.export.hazard.export_hazard_curve(key, output, target)[source]

Export the specified hazard curve output to the target.

Parameters:
Returns:

The same return value as defined by export().

openquake.engine.export.hazard.export_hazard_curve_csv(key, output, target)[source]

Save a hazard curve (of a given IMT) as a .csv file in the format (lon lat poe1 ... poeN), where the fields are space separated.

openquake.engine.export.hazard.export_hazard_curve_multi_xml(key, output, target)[source]
openquake.engine.export.hazard.export_hazard_map(key, output, target)[source]

General hazard map export code.

openquake.engine.export.hazard.export_ses_xml(key, output, target)[source]

Export the Stochastic Event Set Collection specified by output to the target.

Parameters:
Returns:

A list of exported file names (including the absolute path to each file).

openquake.engine.export.hazard.export_uh_spectra_xml(key, output, target)[source]

Export the specified UHS output to the target.

Parameters:
Returns:

A list containing the exported file name.