Giter Site home page Giter Site logo

snakemake-workflow-fermi-lat's Introduction

Snakemake Workflow for Fermi-LAT Data Reduction

This is an example snakemake workflow for data reduction of Fermi-LAT data. The workflow will run the standard fermitools for a given configuration and produce FITS files in a format that Gammapy can read. Thereby it will handle the reduction of counts, exposure and point spread function (PSF) for multiple PSF classes.

Getting Started

Use as Snakemake Module (recommended)

If you would like use this as Snakmake module you should add e.g. the following to your Snakefile:

module fermi_lat_data_workflow:
    snakefile:
        # here, plain paths, URLs and the special markers for code hosting providers (see below) are possible.
        github("adonath/snakemake-workflow-fermi-lat", path="workflow/Snakefile", branch="main")
    config: config["fermi-lat-data"]

use rule * from fermi_lat_data_workflow as fermi_lat_data_*

Use as Repository

Alternatively you could also just clone this repository to your local machine:

git clone https://github.com/adonath/snakemake-workflow-fermi-lat.git

If you havn't done yet, please install conda or mamba.

Now change to the directory of the repository:

cd snakemake-workflow-fermi-lat/

And create the conda environment using:

mamba env create -f environment.yaml

Once the process is done you can activate the environment:

conda activate snakemake-workflow-fermi-lat

Download Data

Go to https://fermi.gsfc.nasa.gov/cgi-bin/ssc/LAT/LATDataQuery.cgi and download the data you are interested in. The data should be downloaded to the ./data folder.

Configure and Run the Workflow

Now you should adapt the configuration in config/config.yaml to match your data.

Then you are ready to run the workflow, like:

snakemake --cores 8

You can also create a report to see previews of the counts, exposure and PSF images:

snakemake --report report.html
open report.html

Finally you can read and print the datasets as well as models using Gammapy:

from gammapy.datasets import Datasets
from gammapy.modeling.models import Models

datasets = Datasets.read("results/<my-config>/datasets/<my-config>-datasets-all.yaml")
models = Models.read("results/<my-config>/model/<my-config>-model.yaml")

print(datasets)
print(models)

snakemake-workflow-fermi-lat's People

Contributors

adonath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snakemake-workflow-fermi-lat's Issues

Improve content of the report

One could produce a few more plots fo the report, like:

  • Summarize the model
  • Summarize the dataset e..g using dataset.info_dict()
  • Show the output of the diffuse emission

Add tests

Add tests to make sure the workflow runs properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.