genbox

genbox is the input data generator for boxmox

Creates input data for the BOXMOX box model. Currently, it uses data extracts from the frappedata dataset as data basis, but can use field campaign ‘merge’ files in ICARTT format as well. The tuv package provides modelled photolysis rates that were not measured.

Installation

pip install genbox

Command-line scripts

Create Environment.csv

usage: make_BOXMOX_environment [-h] [--scaleFac SCALEFAC] [--diurnalCycle] tag

Positional Arguments

tag FRAPPE_extract tag

Named Arguments

--scaleFac

scaling factor; default is 1.0

Default: 1.0

--diurnalCycle

get an idealized diurnal temperature cycle

Default: False

Create InitialConditions.csv

usage: make_BOXMOX_initialConditions [-h] [--scaleFac SCALEFAC]
                                     [--scaleSpec SCALESPEC]
                                     tag mechanism

Positional Arguments

tag FRAPPE_extract tag
mechanism mechanism name

Named Arguments

--scaleFac

scaling factor; default is 1.0

Default: 1.0

--scaleSpec

scaling species (comma-separated if several); default is none

Default: “none”

Create PhotolysisRates.csv

usage: make_BOXMOX_photolysisRates [-h] [--diurnalCycle] [--scaleFac SCALEFAC]
                                   tag

Positional Arguments

tag FRAPPE_extract tag

Named Arguments

--diurnalCycle

get an idealized diurnal photolysis rates cycle

Default: False

--scaleFac

scaling factor for photolysis rates; default is 1.0

Default: 1.0

API

Generators

genbox.createEnvironment(ds, ds_args, scale_factor=1.0, diurnal_cycle=False, f=None)

Create a BOXMOX Environment.csv input file using the dataset provided. Currently, this consists simply of values for temperature. The resulting file is written to f.

genbox.createPhotolysisRates(ds, ds_args, tuv, scale_factor=1.0, diurnal_cycle=False, f=None)

Create a BOXMOX PhotolysisRates.csv input file using the dataset provided. TUV values are used to complement missing measurements. The resulting file is written to f.

genbox.createInitialConditions(ds, ds_args, translator, mechanism, scale_factor=1.0, scale_species='none', static_species={'H2': 0.5, 'N2O': 0.32, 'N2': 780840.0, 'M': 1000000.0, 'O2': 209460.0}, f=None)

Create a BOXMOX InitialConditions.csv input file using the dataset provided. A number of static species, provided as dictionary to the routine, are added as well. Those need to conform to the target mechanism naming and units (e.g. ppmv). The resulting file is written to f.

Perturbations

genbox.perturb.list_distr()

List possible perturbation error distributions

genbox.perturb.perturb_factors(mean, rel_stdev, num, distr='normal', max_err=0.01)

Perturb a variable using different assumptions about error distribution and magnitude.