A tutorial for the Chandra data science meeting
This tutorial covers the basics of:
- model building and fitting in 3ML
- x-ray analysis with the OGIPLike plugin
- advanced examples with joint fits of different plugins and advanced models
Examples make use of both Bayesian and maximum likelihood fitting techinques with a variety of packages. By the end of the tutorial you should have a basic idea of how to import x-ray data into 3ML, build models, perform fits, and save the results of an analysis to disk for distribution.
There are three ways you can run the tutorial ranging from easy to less easy.
The tutorials live on a pre-built binder which has all the software installed and all the data needed already available. Just click the binder link below.
You can launch the binder here:
You can install the 3ML notebook docker with the following instructions.
- To run this docker first pull it
docker pull threeml/notebook:latest
- Now clone this repo in a directory of your choosing:
git clone https://github.com/threeML/cds_tutorial.git
cd cds_tutorial
- Now you activate the docker with this command (note your choice of local port, here 8008)
docker run -it --rm -p 8008:8888 -v $PWD:/workdir -w /workdir threeml/notebook
then paste localhost:8008
in your browser and you are all set.
Please do this before the tutorial. You can follow the installation instructions for 3ML and astromodels here
You can go with conda or pip, but I recommend some form of virtualenv to isolate your install.
If you go with conda, please use this enironment file:
name: threeml
channels:
- conda-forge
- threeml
- xspecmodels
- fermi
dependencies:
- astropy<4.3
- numpy
- scipy
- ultranest
- pygmo
- fermitools
- fermipy
- matplotlib
- dill
- pandas
- astromodels
- threeml
- xspec-modelsonly
- root==6.22
- pip
- pip:
- twopc
- jupyterthemes
- gbmgeometry
- gbm_drm_gen
- root_numpy
to ensure that you have all the required pacakges. Thus,
conda env create -f environment.yml
conda activate threeml
If you decided to go with pip, you will need to have all the external components you wish to use for the tutorials already installed. 3ML will warn you of things that are missing, e.g., multinest, ROOT, etc. You will also need to have a working installation of XSPEC installed if you wish to demo models comming from XSPEC. The tutorials can be run without these extra components. And you can always try them in the binder link above.
After installation, you can download the tutorial notebooks and start jupyter with:
git clone https://github.com/threeML/cds_tutorial.git
cd cds_tutorial
If you have questions, please post them as issues in this repo or email me jburgess@mpe.mpg.de