Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Omar Laurino edited this pageDec 19, 2015 ·1 revision

A collection of Sherpa jupyter (ipython) notebooks.

These notebooks are not an official product of the Chandra X-ray Center. Credit goes to the original authors.

Sherpa Quick Start Notebook

Notebooks taken from @dougburke's GitHub repository:

  • A simple fit which is based ontheNumPy/SciPy fitting examplefrom thePractical Python for Astronomerscourse.

  • Writing your own user model,which fits the cumulative distribution function of a data setwith the Gamma CDF. The same code can be run from the CIAO versionof Sherpa (I added this as we are currently lacking in documentationfor how to use theadd_user_model routine).

    May 26 2015.

  • An integrated user model,which fits the Gamma probability distribution function to the dataset used in the 'Writing your own user model' example. This isan example of handling "integrated" data sets, and also shows offhow to write aguess routine for your model, and some plotmanipulations (in particular, re-creating a region-projection plotand adding extra annotations to it).

    June 4 2015.

  • How can I plot data and models when using the lower-level routines,which came up (in my mind) in the "Writing your own user model"example, where I started off using the lower-level API, but quicklyswitched to the higher-level (data management) API in part becauseI did not know how to create the plots. Well, I do know, and socanyou.

    June 5 2015.

  • Extending existing models (and an example of using XSPEC models),which shows how to write a user model that extends the behavior ofan existing model (in this case, subtracting a model from itself withdifferent parameter values). It also shows how to build the XSPEC module,and so use theXSPEC modelsfrom standalone Sherpa.

    June 16 2015.

  • Simulating 2D data with a dash of error analysis,which uses the object API to simulate a 2D model (i.e. an image),fit it, and calculate errors on the parameters. This can be thought ofas an extension of the previous notebooks that show how to replicatethe functionality of the high-level UI layer using the object API(it also marks the start of me using the term "object API" for what Ipreviously referred to as the "low-level API").

    June 19 2015

  • Simulating and fitting a 2D image (this time with a Bayesian approach),which is based on the previous notebook, this time showing howyou can use the Monte Carlo Markov Chain (MCMC) analysis modulein Sherpa (that is, theBayesian Low-Count X-ray Spectral (pyBLoCXS)module). This notebook is mainly intended to showhow to do this,rather than explain why (or the differences between the variousfrequentist and Bayesian methods for coming up with an error estimate).

    June 22 2015

Notebooks taken from @anetasie's GitHub repository

  • Templates: Sherpa can use the template models and combined them with the other models. Here we show a simple template fitting to the SED of a quasar. A set of accretion disk spectral models with the standard parameters (mass, accretion rate, inclination anlge) has been stored in the subdirectory Templates.

  • Image fitting: Images can be easily fit in Sherpa. In the following example we show how to include the PSF in the modeling of the central source. The X-ray Chandra image data are modeled with the gaussian shape that accounts for the point source emission (quasar in this case) and a constant for the background. We ignore the region of the image with the additional structure in the vicinity of a point source.

  • Bayes Example: A Simple Bayesian analysis of X-ray spectrum in Sherpa (requires Xspec models).


[8]ページ先頭

©2009-2025 Movatter.jp