Command Line Interface#

esat#

The EPA’s Environmental Source Apportionment Toolkit (ESAT) CLI provides access to the ESAT workflow available in
the Jupyter notebooks. The workflow sequence is as follows:
1) setup : specify where you want your project directory for all solution outputs.
2) analysis-input : (optional) review your input/uncertainty data with metric tables and plots.
3) run : executes a batch source apportionment (SA) run using the values in the setup configuration file.
4) analysis-solution : (optional) review the solutions of the batch SA run with metric tables and plots.
5) setup-error : create an error estimation methods configuration file in the project directory.
6) run-error: executes one or more of the error estimation methods using the error configuration.
7) error-analysis : (optional) review the results of the error estimation methods.
8) setup-constrained : create a constrained model run configuration file in the project directory.
9) analysis-constrained : (optional) review the results of the constrained model run.

An error estimation run can occur before or after a constrained model run, though the solution of a constrained model run can be used in an error estimation run by adding the path to the constrained model run configuration file in the error method configuration. If left empty, the error estimation run will default to the base solution from run.

The ESAT simulator and synthetic datasets can be used by running the ‘setup-sim’ command in place of ‘setup’. To generate the synthetic dataset for analysis run ‘generate-sim’, if this is not executed prior to ‘run’ the command will be executed in the run command sequence. The ‘run’ command will use the generated synthetic data as it would real data. The model outputs can then be compared to the synthetic profiles with the ‘sim-analysis’ command. All other commands are available on the simulated data.

esat [OPTIONS] COMMAND [ARGS]...

Options

--version#

Show the version and exit.

analysis-batch#

The collection of commands for batch model analysis.

esat analysis-batch [OPTIONS] COMMAND [ARGS]...

plot-distribution#

Plots the loss value distribution Q(true) and Q(robust) for the batch solution.

Parameters#

project_directory : The project directory where all configuration output files are saved.

esat analysis-batch plot-distribution [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

plot-loss#

Plots the loss value Q(true) over the training iterations for the batch solution.

Parameters#

project_directory : The project directory where all configuration output files are saved.

esat analysis-batch plot-loss [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

analysis-constrained#

The collection of commands for analyzing the constrained model results.

esat analysis-constrained [OPTIONS] COMMAND [ARGS]...

eval-constraints#

Display the evaluation table of the constrained model results, for each constraint.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained eval-constraints [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

eval-expressions#

Display the evaluation table of the constrained model results, for each expression.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained eval-expressions [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

plot-contributions#

Display the factor contributions for the specified feature (feature_idx).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained plot-contributions [OPTIONS] PROJECT_DIRECTORY

Options

-i, --feature_idx <feature_idx>#

The feature index to display.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

plot-fingerprints#

Display the constrained solution factor fingerprints.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained plot-fingerprints [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

plot-gspace#

Display a specified factor index (factor_idx1) vs factor index (factor_idx2) g-space plot.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained plot-gspace [OPTIONS] PROJECT_DIRECTORY

Options

-x, --factor_idx1 <factor_idx1>#

The factor index for the x-axis.

Default:

0

-y, --factor_idx2 <factor_idx2>#

The factor index for the y-axis.

Default:

1

--show_base#

Show the base solution values.

Default:

True

--show_delta#

Show the change between the constrained solution values and the base solution values

Default:

True

Arguments

PROJECT_DIRECTORY#

Required argument

plot-q#

Display the loss function plotted over all training iterations. Loss value options for Q include: True, Robust, and Aux (the loss value difference between the current solution values and the target values as defined from the constraints and expressions).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained plot-q [OPTIONS] PROJECT_DIRECTORY

Options

-q, --qtype <qtype>#

Plot the loss value for qtype: True, Robust, Aux

Default:

'Aux'

Arguments

PROJECT_DIRECTORY#

Required argument

summary#

Display the results of a constrained model run.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-constrained summary [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

analysis-error#

The collection of commands for analyzing the results of error estimation methods.

esat analysis-error [OPTIONS] COMMAND [ARGS]...

error-results#

Show the results of an error estimation method. One method must be selected.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-error error-results [OPTIONS] PROJECT_DIRECTORY

Options

--disp#

Summarize the displacement (DISP) error estimation results.

Default:

False

--bs#

Summarize the bootstrap (BS) error estimation results.

Default:

False

--bsdisp#

Summarize the bootstrap-displacement (BSDISP) error estimation results.

Default:

False

--factor_idx <factor_idx>#

The factor index to display results.

Arguments

PROJECT_DIRECTORY#

Required argument

summary#

Summarize the results of an error estimation method results.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-error summary [OPTIONS] PROJECT_DIRECTORY

Options

--disp#

Summarize the displacement (DISP) error estimation results.

Default:

False

--bs#

Summarize the bootstrap (BS) error estimation results.

Default:

False

--bsdisp#

Summarize the bootstrap-displacement (BSDISP) error estimation results.

Default:

False

Arguments

PROJECT_DIRECTORY#

Required argument

analysis-input#

The collection of commands for analyzing the input/uncertainty datasets.

esat analysis-input [OPTIONS] COMMAND [ARGS]...

metrics#

Display the input metrics for the input/uncertainty data specified in the configuration file.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-input metrics [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

plot-data#

Display the feature vs feature scatter plot.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-input plot-data [OPTIONS] PROJECT_DIRECTORY

Options

-x, --feature_idx1 <feature_idx1>#

The index of the first (x-axis) input data feature, column in the dataset.

Default:

0

-y, --feature_idx2 <feature_idx2>#

The index of the second (y-axis) input data feature, column in the dataset.

Default:

1

Arguments

PROJECT_DIRECTORY#

Required argument

plot-feature#

Display the Concentration/Uncertainty scatter plot for the specified feature.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-input plot-feature [OPTIONS] PROJECT_DIRECTORY

Options

-i, --feature_idx <feature_idx>#

The index of the input/uncertainty data feature, column in the dataset.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

plot-timeseries#

Display the feature(s) timeseries.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-input plot-timeseries [OPTIONS] PROJECT_DIRECTORY

Options

-i, --feature_idx <feature_idx>#

The indices of the input data feature, columns in the dataset.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

analysis-solution#

The collection of commands for analyzing an SA project base solution.

esat analysis-solution [OPTIONS] COMMAND [ARGS]...

plot-composition#

Plot factor composition for a specified solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-composition [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

Arguments

PROJECT_DIRECTORY#

Required argument

plot-contributions#

Plot factor contributions for a specified feature index (feature_idx) and solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-contributions [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-i, --feature_idx <feature_idx>#

The index of the feature to plot.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

plot-estimated#

Plot the estimated vs observed for a specified feature index (feature_idx) and solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-estimated [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-i, --feature_idx <feature_idx>#

The index of the feature to plot.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

plot-fingerprints#

Plot the factor fingerprints for a specified solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-fingerprints [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

Arguments

PROJECT_DIRECTORY#

Required argument

plot-gspace#

Plot two factor g-space graph for a specified solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-gspace [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-x, --factor_idx1 <factor_idx1>#

The index of the x-axis factor profile.

Default:

0

-y, --factor_idx2 <factor_idx2>#

The index of the y-axis factor profile.

Default:

1

Arguments

PROJECT_DIRECTORY#

Required argument

plot-profile#

Plot the factor profile for a specified factor index (factor_idx) and solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-profile [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-i, --factor_idx <factor_idx>#

The index of the factor profile.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

plot-residuals#

Plot the residual histogram for a specified feature index (feature_idx) and solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-residuals [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-i, --feature_idx <feature_idx>#

The index of the feature to plot.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

plot-surface#

Plot factor surface for a specified factor index (factor_idx), set of features (feature_idx), and solution model (selected_model). Multiple feature indices can be provided as ‘-f 0 -f 1 -f 2’.

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-surface [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-i, --factor_idx <factor_idx>#

The index of the factor profile.

Default:

0

-f, --feature_idx <feature_idx>#

The index/indices of the factor feature to include. Default: -1, includes all features which contribution to the factor_idx. Multiple indices can be provided.

Arguments

PROJECT_DIRECTORY#

Required argument

plot-timeseries#

Plot the estimated timeseries for a specified feature index (feature_idx) and solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution plot-timeseries [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

-i, --feature_idx <feature_idx>#

The index of the feature to plot.

Default:

0

Arguments

PROJECT_DIRECTORY#

Required argument

statistics#

Display the solution statistics for a specified solution model (selected_model).

Parameters

project_directory : The project directory containing .toml configuration files.

esat analysis-solution statistics [OPTIONS] PROJECT_DIRECTORY

Options

-m, --selected_model <selected_model>#

The index of the model from the solution. Default: -1, the best performing model.

Default:

-1

Arguments

PROJECT_DIRECTORY#

Required argument

estimate#

Run a factor estimation using the provided configuration file.

Parameters

project_directory : The project directory containing .toml configuration files.

esat estimate [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

run#

Run a batch source apportionment run using the provided configuration file.

Parameters

project_directory : The project directory containing .toml configuration files.

esat run [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

run-constrained#

Run a constrained model with the specified configuration file.

Parameters

project_directory : The project directory containing .toml configuration files.

esat run-constrained [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

run-error#

Run one or more of the error estimation methods using the specified error configuration file.

Parameters

project_directory : The project directory containing .toml configuration files.

esat run-error [OPTIONS] PROJECT_DIRECTORY

Options

--disp#

Run the displacement (DISP) error estimation method.

Default:

False

--bs#

Run the bootstrap (BS) error estimation method.

Default:

False

--bsdisp#

Run the bootstrap-displacement (BSDISP) error estimation method.

Default:

False

Arguments

PROJECT_DIRECTORY#

Required argument

setup#

Create the configuration file for a batch source apportionment run in the provided directory.

Parameters

project_directory : The project directory where all configuration output files are saved.

esat setup [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

setup-constrained#

Create a configuration file for executing a constrained model run on a specified project.

Parameters

project_directory : The project directory where all output files are saved.

esat setup-constrained [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

setup-error#

Create an error estimation configuration file for the specified project.

Parameters

project_directory : The project directory where all output files are saved.

esat setup-error [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

simulator#

The collection of commands for managing ESAT simulator instances.

esat simulator [OPTIONS] COMMAND [ARGS]...

compare#

Compares the models generated from the synthetic data to show how similar the modelled profiles are to the known synthetic profiles.

Parameters

project_directory : The project directory where all configuration output files are saved.

esat simulator compare [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

generate#

Generate the synthetic data and uncertainty datasets as defined in the sim_config.toml. Only required for data analysis functions, run will check for a simulated config if no file is found in the project_directory and generate if required.

Parameters

project_directory : The project directory where all configuration output files are saved.

esat simulator generate [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

plot#

Plots the results of the simulator output comparison to the synthetic profiles.

Parameters

project_directory : The project directory where all configuration output files are saved.

esat simulator plot [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument

setup#

Create the configuration file for a batch source apportionment simulated run in the provided directory.

Parameters

project_directory : The project directory where all configuration output files are saved.

esat simulator setup [OPTIONS] PROJECT_DIRECTORY

Arguments

PROJECT_DIRECTORY#

Required argument