gwgen sensΒΆ
Perform a sensitivity analysis on the given parameters
This function performs a sensitivity analysis on the current experiment. It creates a new project and uses the evaluation and parameterization of the current experiment to get information on the others
usage: gwgen sens [-h] {setup,compile,init,run,evaluate,plot,remove} ...
- Sub-commands:
- setup
Set up the experiments for the project
usage: gwgen sens setup [-h] [-root-dir str] [-p str] [-link] [-nm]
- Optional Arguments
-root-dir The path to the root directory where the experiments, etc. will be stored. If not given, a new directory will be created at the same location as the original project -p, --projectname The name of the project that shall be initialized at `root_dir`. A new directory will be created namely ``root_dir + ‘/’ + projectname``. If not given, defaults to ``’sensitivity_<id>’`` where ``’<id>’`` is the experiment id -link=True If set, the source files are linked to the original ones instead of copied -nm=False, --no-move=False If True, the project in the configuration files is not moved to the position right before the configuration of the current project
- compile
Compile the sensitivity analysis model
usage: gwgen sens compile [-h]
- init
Initialize the experiments for the sensitivity analysis
usage: gwgen sens init [-h] [-nml nml_key=f1[,f21[-f22[-f23]]] [nml_key=f1[,f21[-f22[-f23]]] ...]] [-id str] [-prep] [-use-param] [-nm]
- Optional Arguments
-nml, --namelist A list from namelist parameters and their values to use. A comma (``’,’``) separated string. A single value in this string represents one number, ranges can also be used via a separation by comma (``’-‘``). Hence, ``‘2009,2012-2015’`` will be converted to ``[2009,2012, 2013, 2014]`` and ``2009,2012-2015-2`` to ``[2009, 2012, 2015]``. You can also use ``’<i>err’`` in the list which will be interpreted as ``’<i>’``-times the error from the parameterization. -id, --experiment The base experiment name to use. Should somehow contain a number which will be increased for each experiment. If None, it will default to ``’<id>_sens0’`` -prep=False, --run-prepare=False If True or no ``’input’`` key exists for the experiment, the ``’prepare’`` evaluation task is run to get the reference data. Otherwise, if False and the ``’input’`` key does not exist, the specified file is used -use-param=False If True/set and the parameterization is required, use the parameterization of the original experiment -nm=False, --no-move=False If True, the experiment in the configurations are not moved to the position right before the configuration of the current experiment
- run
Run the analysis
usage: gwgen sens run [-h] [-ids id1,id2,...] [-rm]
- Optional Arguments
-ids, --experiments The experiments to use. If None, all experiments are used -rm=False, --remove=False If True, the `work_dir` will be removed if it already exists
- evaluate
Evaluate the experiments of the sensitivity analysis
usage: gwgen sens evaluate [-h] [-ids id1,id2,...] [-loop] [-s str or list of str] [-ido str] [-f str] [-to-db] [-to-csv] [-db str] [-nr [task1,task2,...]] [-complete] {ks,quality,quants} ...
- Optional Arguments
-ids, --experiments The experiments to use. If None, all experiments are used -loop=False, --loop-exps=False If True the experiments of the sensitivity analysis are called one after each other. Otherwise they are called in parallel, each on a single core (unless the the serial option in the global configuration is set) -s, --stations either a list of stations to use or a filename containing a 1-row table with stations -ido, --other_id Use the configuration from another experiment -f, --from Determine where to get the data from. If `scratch`, the data will be calculated from the raw data. If `file`, the data will be loaded from a file, if `db`, the data will be loaded from a postgres database (Note that the `database` argument must be provided!). -to-db Save the data into a postgresql database (Note that the `database` argument must be provided!) -to-csv Save the data into a csv file -db, --database The name of a postgres data base to write the data to -nr=False, --norun=False If set without value or “all” or a number different from 0, the data is set up and the configuration of the experiment is not affected. Otherwise it can be a comma separated list of parameterization tasks for which to only setup the data -complete=False If True, setup and run all possible tasks - Sub-commands:
- ks
The default configuration for :class:`KSEvaluation` instances. See also the :attr:`KSEvaluation.default_config` attribute
usage: gwgen sens evaluate ks [-h] [-ido str] [-nr] [-n variable [variable ...]] [-tw] [-f { 'scratch' | 'file' | 'db' | None }] [-to-csv] [-to-db] [-rm] [-sf] [-o str]
- Optional Arguments
-ido, --other_id Use the configuration from another experiment - Setup arguments
-n, --names The list of variables use for calculation. If None, all variables will be used
Possible choices: prcp, tmin, tmax, mean_cloud, wind
-tw=False, --transform-wind=False If True, the square root of the wind is evaluated (as this is also simulated in the weather generator) -f, --from The method how to setup the instance either from ``’scratch’`` To set up the task from the raw data ``’file’`` Set up the task from an existing file ``’db’`` Set up the task from a database ``None`` If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
Possible choices: scratch, file, db
-to-csv=False If True, the data at setup will be written to a csv file -to-db=False If True, the data at setup will be written to into a database -rm=False, --remove=False If True and the old data file already exists, remove before writing to it -sf=False, --skip-filtering=False If True, skip the filtering for the correct stations in the datafile - Run arguments
-nr=False, --no-rounding=False Do not round the simulation to the infered precision of the reference. The inferred precision is the minimum difference between two values with in the entire data -o, --plot-output An alternative path to use for the PDF file of the plot
- quality
Estimate simulation quality using ks and quantile evaluation
usage: gwgen sens evaluate quality [-h] [-q q1[,q1[,q2[,...]]]] [-ido str]
- Optional Arguments
-q, --quantiles The quantiles to use for the quality analysis -ido, --other_id Use the configuration from another experiment
- quants
The default configuration for :class:`KSEvaluation` instances. See also the :attr:`KSEvaluation.default_config` attribute
usage: gwgen sens evaluate quants [-h] [-ido str] [-nr] [-n variable [variable ...]] [-tw] [-q f1[,f21[-f22[-f23]]]] [-f { 'scratch' | 'file' | 'db' | None }] [-to-csv] [-to-db] [-rm] [-sf] [-o str] [-onc str] [-op str] [-np] [-p str]
- Optional Arguments
-ido, --other_id Use the configuration from another experiment - Setup arguments
-n, --names The list of variables use for calculation. If None, all variables will be used
Possible choices: prcp, tmin, tmax, mean_cloud, wind
-tw=False, --transform-wind=False If True, the square root of the wind is evaluated (as this is also simulated in the weather generator) -f, --from The method how to setup the instance either from ``’scratch’`` To set up the task from the raw data ``’file’`` Set up the task from an existing file ``’db’`` Set up the task from a database ``None`` If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
Possible choices: scratch, file, db
-to-csv=False If True, the data at setup will be written to a csv file -to-db=False If True, the data at setup will be written to into a database -rm=False, --remove=False If True and the old data file already exists, remove before writing to it -sf=False, --skip-filtering=False If True, skip the filtering for the correct stations in the datafile - Run arguments
-nr=False, --no-rounding=False Do not round the simulation to the infered precision of the reference. The inferred precision is the minimum difference between two values with in the entire data -q=[1, 5, 10, 25, 50, 75, 90, 95, 99, 100], --quantiles=[1, 5, 10, 25, 50, 75, 90, 95, 99, 100] The quantiles to use for calculating the percentiles. A comma (``’,’``) separated string. A single value in this string represents one number, ranges can also be used via a separation by comma (``’-‘``). Hence, ``‘2009,2012-2015’`` will be converted to ``[2009,2012, 2013, 2014]`` and ``2009,2012-2015-2`` to ``[2009, 2012, 2015]``. -o, --plot-output An alternative path to use for the PDF file of the plot -onc, --nc-output An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data -op, --project-output An alternative path to use for the psyplot project file of the plot -np=False, --new-project=False If True, a new project will be created even if a file in `project_output` exists already -p, --project The path to a psyplot project file to use for this parameterization
- plot
Plot the result of the sensitivity analysis 2 different plots are made for each variable and quality indicator: 1. 1d plots with the indicator on the y-axis and the namelist parameter on the x-axis 2. 2d plots with one indicator on the x-axis and another on the y-axis for each possible combination You can disable one of the plot types via the `only_1d` and `only_2d` parameter.
usage: gwgen sens plot [-h] [-i indicator[,indicator[,...]]] [-n variable,[variable[,...]]] [-meta <yaml-file>] {plot1d,plot2d} ...
- Optional Arguments
-i=['rsquared', 'slope', 'ks', 'quality'], --indicators=['rsquared', 'slope', 'ks', 'quality'] The name of the indicators from the `quality` evaluation task -n=['prcp', 'tmin', 'tmax', 'mean_cloud', 'wind'], --names=['prcp', 'tmin', 'tmax', 'mean_cloud', 'wind'] The name(s) of the variable(s) to plot -meta Alternative meta information for the data set - Sub-commands:
- plot1d
The default configuration for :class:`SensitivityPlot` instances. See also the :attr:`SensitivityPlot.default_config` attribute
usage: gwgen sens plot plot1d [-h] [-f { 'scratch' | 'file' | 'db' | None }] [-to-csv] [-to-db] [-rm] [-sf] [-o str] [-onc str] [-op str] [-np] [-p str]
- Setup arguments
-f, --from The method how to setup the instance either from ``’scratch’`` To set up the task from the raw data ``’file’`` Set up the task from an existing file ``’db’`` Set up the task from a database ``None`` If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
Possible choices: scratch, file, db
-to-csv=False If True, the data at setup will be written to a csv file -to-db=False If True, the data at setup will be written to into a database -rm=False, --remove=False If True and the old data file already exists, remove before writing to it -sf=False, --skip-filtering=False If True, skip the filtering for the correct stations in the datafile - Run arguments
-o, --plot-output An alternative path to use for the PDF file of the plot -onc, --nc-output An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data -op, --project-output An alternative path to use for the psyplot project file of the plot -np=False, --new-project=False If True, a new project will be created even if a file in `project_output` exists already -p, --project The path to a psyplot project file to use for this parameterization
- plot2d
The default configuration for :class:`SensitivityPlot` instances. See also the :attr:`SensitivityPlot.default_config` attribute
usage: gwgen sens plot plot2d [-h] [-logx] [-logy] [-f { 'scratch' | 'file' | 'db' | None }] [-to-csv] [-to-db] [-rm] [-sf] [-o str] [-onc str] [-op str] [-np] [-p str]
- Setup arguments
-f, --from The method how to setup the instance either from ``’scratch’`` To set up the task from the raw data ``’file’`` Set up the task from an existing file ``’db’`` Set up the task from a database ``None`` If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
Possible choices: scratch, file, db
-to-csv=False If True, the data at setup will be written to a csv file -to-db=False If True, the data at setup will be written to into a database -rm=False, --remove=False If True and the old data file already exists, remove before writing to it -sf=False, --skip-filtering=False If True, skip the filtering for the correct stations in the datafile - Run arguments
-logx=False If True, the x-axis will be logarithmic -logy=False If True, the y-axis will be logarithmic -o, --plot-output An alternative path to use for the PDF file of the plot -onc, --nc-output An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data -op, --project-output An alternative path to use for the psyplot project file of the plot -np=False, --new-project=False If True, a new project will be created even if a file in `project_output` exists already -p, --project The path to a psyplot project file to use for this parameterization
- remove
Remove the project and files of the sensitivity analysis
usage: gwgen sens remove [-h] [-y] [-ap]
- Optional Arguments
-y=False, --yes=False If True/set, do not ask for confirmation -ap=False, --all-projects=False If True/set, all projects are removed