Add some scripts and examples #353
Viewing a subset of changes. View all
Add image analysis pipeline script
This is work in progress ... it doesn't do anything useful yet. I just wanted to move this over to Gammapy and continue here ...
- Loading branch information...
|@@ -0,0 +1,42 @@|
|# Licensed under a 3-clause BSD style license - see LICENSE.rst|
|from __future__ import (absolute_import, division, print_function,|
|from gammapy.utils.scripts import get_parser|
|__all__ = ['GammapyImageAnalysis']|
|log = logging.getLogger(__name__)|
|parser = get_parser(GammapyImageAnalysis)|
|help='Config file in YAML format')|
|# TODO: add option to dump the default config file|
|args = parser.parse_args(args)|
|analysis = GammapyImageAnalysis.from_yaml(args.config_file)|
|"""Gammapy 2D image based analysis.|
|def __init__(self, config):|
|self.config = config|
|def from_yaml(cls, filename):|
|"""Read config from YAML file."""|
|with open(filename) as fh:|
|config = yaml.safe_load(fh)|
|"""Run analysis chain."""|
|log.info('Running analysis ...')|
|@@ -0,0 +1,19 @@|
|# Example Gammapy image analysis pipeline config file|
ProTip! Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews.