scripts - Command line tools#

gammapy#

Gammapy command line interface (CLI).

Gammapy is a Python package for gamma-ray astronomy.

Use --help to see available sub-commands, as well as the available arguments and options for each sub-command.

For further information, see https://gammapy.org/ and https://docs.gammapy.org/

Examples#

$ gammapy --help
$ gammapy --version
$ gammapy info --help
$ gammapy info
gammapy [OPTIONS] COMMAND [ARGS]...

Options

--log-level <log_level>#

Logging verbosity level.

Options:

debug | info | warning | error

--ignore-warnings#

Ignore warnings?

--version#

Print version and exit.

analysis#

Automation of configuration driven data reduction process.

Examples#

$ gammapy analysis config
$ gammapy analysis run
$ gammapy analysis config --overwrite
$ gammapy analysis config --filename myconfig.yaml
$ gammapy analysis run --filename myconfig.yaml
gammapy analysis [OPTIONS] COMMAND [ARGS]...

config#

Write default configuration file.

gammapy analysis config [OPTIONS]

Options

--filename <filename>#

Filename to store the default configuration values.

Default:

'config.yaml'

--overwrite#

Overwrite existing file.

run#

Perform automated data reduction process.

gammapy analysis run [OPTIONS]

Options

--filename <filename>#

Filename with default configuration values.

Default:

'config.yaml'

--out <out>#

Output folder where reduced datasets are stored.

Default:

'datasets'

--overwrite#

Overwrite existing datasets.

check#

Run checks for Gammapy.

gammapy check [OPTIONS] COMMAND [ARGS]...

logging#

Check logging.

gammapy check logging [OPTIONS]

download#

Download notebooks and datasets.

Download notebooks published in the Gammapy documentation as well as the related datasets needed to execute them.

  • The option “notebooks” will download the notebook files into a gammapy-notebooks folder created at the current working directory.

  • The option “datasets” will download the datasets used in the documentation into a gammapy-datasets folder created at the current working directory.

Examples#

$ gammapy download datasets  --out localfolder
$ gammapy download notebooks --release 2.0 --out localfolder
gammapy download [OPTIONS] COMMAND [ARGS]...

datasets#

Download datasets.

gammapy download datasets [OPTIONS]

Options

--release <release>#

Number of stable release - ex: 2.0)

Default:

'dev'

--out <out>#

Destination folder.

Default:

'gammapy-datasets'

notebooks#

Download notebooks.

gammapy download notebooks [OPTIONS]

Options

--release <release>#

Number of stable release - ex: 2.0)

Default:

'dev'

--out <out>#

Path where the versioned notebook files will be copied.

Default:

'gammapy-notebooks'

info#

Display information about Gammapy.

gammapy info [OPTIONS]

Options

--system, --no-system#

Show system info

--version, --no-version#

Show version

--dependencies, --no-dependencies#

Show dependencies

--envvar, --no-envvar#

Show environment variables

tutorial#

Gammapy tutorial helper commands.

gammapy tutorial [OPTIONS] COMMAND [ARGS]...

setup#

Check tutorial setup and show environment info.

gammapy tutorial setup [OPTIONS]

Options

--path <path>#

Path to download the datasets if needed.

Default:

'./gammapy-data'

workflow#

Automation of configuration driven data reduction process.

Examples#

$ gammapy workflow config
$ gammapy workflow run
$ gammapy workflow config --overwrite
$ gammapy workflow config --filename myconfig.yaml
$ gammapy workflow run --filename myconfig.yaml
gammapy workflow [OPTIONS] COMMAND [ARGS]...

config#

Write default configuration file.

gammapy workflow config [OPTIONS]

Options

--filename <filename>#

Filename to store the default configuration values.

Default:

'config.yaml'

--overwrite#

Overwrite existing file.

run#

Perform automated data reduction process.

gammapy workflow run [OPTIONS]

Options

--filename <filename>#

Filename with default configuration values.

Default:

'config.yaml'