The Command Line Interface

The phot_class package can be accessed either from within a Python environment or via the command line using run_pipeline.py. We here outline how to use the command line interface. For working from within an environment, see the API documentation.

See run_pipeline.sh for a complete list of commands that were run as part of our analysis. In principle, all light curve fits considered by this project can be reproduced by running bash run_pipeline.sh.

Important

bash run_pipeline.sh includes a mix of commands that can vary dramatically in runtime and redundancy. You probably only want to run a subset of commands (if any since the results are cached in the project repository).

Creating a Config File

Note

Pre-made config files are available in the project’s repository.

Using the command line interface requires creating a configuration file. Config files are used to define priors and keyword arguments used when fitting each light-curve. Files should be saved in yaml format and follow the template below. Notice that priors and keyword arguments are specified for both the custom hsiao_x1 and sn91bg models defined in the project’s analysis pipeline.

Specifying Priors

Valid prior values for both models include z, t0, amplitude, x1, and mwebv. The sn91bg model also has an additional c parameter. It is important to understand how these parameters are handled by the pipeline:

  • When fitting all bands simultaneously, t0, amplitude, x1, and c are always varied. z is only varied if it is not specified by the prior.
  • When fitting bands independently, only amplitude, x1, and c are varied. z and t0 are fixed to the value determined when fitting all bands simultaneously.
  • mwebv is never varied in any fit, and is fixed to the given value. If no value is given, the default value is 0.

See the Fitting and Classification section for more information on how the pipeline handles light-curve fitting.

Specifying Kwargs

Valid keyword arguments depend slightly on the fitting function that is being used, but are overwhelmingly uniform across the available functions. Each fitting function is a simple wrapper around an sncosmo minimization routine (the wrapping is just to avoid an argument mutation bug in sncosmo). For more information on the available fitting routines, see phot_class.fit_func_wraps.

Running the Analysis

Arguments for the command line interface are as follows:

usage: run_pipeline.py [-h] -s SURVEY -r RELEASE [-f FIT_FUNC] [-m METHOD]
                       [-c CONFIG] -o OUT_DIR

Named Arguments

-s, --survey The name of the survey to analyze. This should be the name of a survey in the sndata package (e.g. csp).
-r, --release The name of the survey’s data release. This should also match the sndata package (e.g. dr3).
-f, --fit_func

The name of the fitting routine to use (simple_fit, nest_fit, mcmc_fit).

Default: “simple_fit”

-m, --method

Whether to fit bands independently (‘band’) or as red and blue sets (‘collective’)

Default: “band”

-c, --config Path of the yaml config file.
-o, --out_dir Directory to write output files to.