Commit b7fc1ef5aab491c78e0ef2d4dd9217cb0a969831
1 parent
f8dcecb3
text rendering fixes
Showing
3 changed files
with
18 additions
and
14 deletions
doc/source/users/tutorials/beyond/combining-observations.ipynb
| @@ -48,7 +48,9 @@ | @@ -48,7 +48,9 @@ | ||
| 48 | { | 48 | { |
| 49 | "cell_type": "code", | 49 | "cell_type": "code", |
| 50 | "execution_count": 4, | 50 | "execution_count": 4, |
| 51 | - "metadata": {}, | 51 | + "metadata": { |
| 52 | + "collapsed": true | ||
| 53 | + }, | ||
| 52 | "outputs": [], | 54 | "outputs": [], |
| 53 | "source": [ | 55 | "source": [ |
| 54 | "obssim = ctools.ctobssim()\n", | 56 | "obssim = ctools.ctobssim()\n", |
| @@ -86,7 +88,7 @@ | @@ -86,7 +88,7 @@ | ||
| 86 | "cell_type": "markdown", | 88 | "cell_type": "markdown", |
| 87 | "metadata": {}, | 89 | "metadata": {}, |
| 88 | "source": [ | 90 | "source": [ |
| 89 | - "This will produce the two event files events1.fits and events2.fits on disk.\n", | 91 | + "This will produce the two event files `events1.fits` and `events2.fits` on disk.\n", |
| 90 | "\n", | 92 | "\n", |
| 91 | "As next step you have to create an observation definition XML file that collects both observations in a list. We'll do it in Python, but for a simple observation definition file like this you could also create it using a text editor." | 93 | "As next step you have to create an observation definition XML file that collects both observations in a list. We'll do it in Python, but for a simple observation definition file like this you could also create it using a text editor." |
| 92 | ] | 94 | ] |
| @@ -151,7 +153,7 @@ | @@ -151,7 +153,7 @@ | ||
| 151 | "\n", | 153 | "\n", |
| 152 | "## Combined likelihood analysis\n", | 154 | "## Combined likelihood analysis\n", |
| 153 | "\n", | 155 | "\n", |
| 154 | - "Now you are ready to do a joint maximum likelihood analysis using ctlike." | 156 | + "Now you are ready to do a joint maximum likelihood analysis using `ctlike`." |
| 155 | ] | 157 | ] |
| 156 | }, | 158 | }, |
| 157 | { | 159 | { |
| @@ -177,7 +179,7 @@ | @@ -177,7 +179,7 @@ | ||
| 177 | "cell_type": "markdown", | 179 | "cell_type": "markdown", |
| 178 | "metadata": {}, | 180 | "metadata": {}, |
| 179 | "source": [ | 181 | "source": [ |
| 180 | - "Instead of providing an event list or a counts cube, you now provide the filename of the observation definition XML file (here obs.xml) as input parameter. ctlike recognises this format and automatically performs a joint maximum likelihood analysis. " | 182 | + "Instead of providing an event list or a counts cube, you now provide the filename of the observation definition XML file (here `obs.xml`) as input parameter. `ctlike` recognises this format and automatically performs a joint maximum likelihood analysis. " |
| 181 | ] | 183 | ] |
| 182 | }, | 184 | }, |
| 183 | { | 185 | { |
doc/source/users/tutorials/beyond/stacked-analysis.ipynb
| @@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
| 44 | "\n", | 44 | "\n", |
| 45 | "## Stacking Events\n", | 45 | "## Stacking Events\n", |
| 46 | "\n", | 46 | "\n", |
| 47 | - "The event stacking is done using the ctbin tool. Instead of providing to ctbin an event list you should specify the observation definition XML file obs.xml on input. ctbin will then loop over all observations and collect all events into a single counts cube." | 47 | + "The event stacking is done using the `ctbin` tool. Instead of providing to ctbin an event list you should specify the observation definition XML file on input. `ctbin` will then loop over all observations and collect all events into a single counts cube." |
| 48 | ] | 48 | ] |
| 49 | }, | 49 | }, |
| 50 | { | 50 | { |
| @@ -83,9 +83,9 @@ | @@ -83,9 +83,9 @@ | ||
| 83 | "source": [ | 83 | "source": [ |
| 84 | "## Computing the stacked response and background\n", | 84 | "## Computing the stacked response and background\n", |
| 85 | "\n", | 85 | "\n", |
| 86 | - "You now have a stacked counts cube cntcube.fits on disk. Before you can use that counts cube in a maximum likelihood analysis, you need to compute the stacked instrument response function and the background model that is needed for the analysis.\n", | 86 | + "You now have a stacked counts cube `cntcube.fits` on disk. Before you can use that counts cube in a maximum likelihood analysis, you need to compute the stacked instrument response function and the background model that is needed for the analysis.\n", |
| 87 | "\n", | 87 | "\n", |
| 88 | - "For the instrument response function, you have to compute the total exposure for the stacked cube (i.e. the sum of the effective areas for each observation multiplied by the corresponding livetimes) and an effective point spread function (i.e. the point spread function of the different observations weighted by the corresponding exposures). Optionally, you can also compute an effective energy dispersion (i.e. the energy dispersion of the different observations weighted by the corresponding exposures). To get these informations you use the ctexpcube, ctpsfcube and ctedispcube tools:" | 88 | + "For the instrument response function, you have to compute the total exposure for the stacked cube (i.e. the sum of the effective areas for each observation multiplied by the corresponding livetimes) and an effective point spread function (i.e. the point spread function of the different observations weighted by the corresponding exposures). Optionally, you can also compute an effective energy dispersion (i.e. the energy dispersion of the different observations weighted by the corresponding exposures). To get these informations you use the `ctexpcube`, `ctpsfcube` and `ctedispcube` tools:" |
| 89 | ] | 89 | ] |
| 90 | }, | 90 | }, |
| 91 | { | 91 | { |
| @@ -169,9 +169,9 @@ | @@ -169,9 +169,9 @@ | ||
| 169 | "cell_type": "markdown", | 169 | "cell_type": "markdown", |
| 170 | "metadata": {}, | 170 | "metadata": {}, |
| 171 | "source": [ | 171 | "source": [ |
| 172 | - "You have noticed that for ctexpcube you provided an input counts cube, while for the other tools you specified NONE. By providing an input counts cube you instructed ctexpcube to extract the geometry of the cube from the counts cube. This is a convenient trick to reduce the number of user parameters that you need to specify. You did however not apply this trick for ctpsfcube and ctedispcube. In fact, the point spread function and energy dispersion do not vary significantly on spatial scales of 0.02°, and using the counts cube definition for these cubes would lead to large response cube files with a spatial precision that is actually not needed (the point spread function and energy dispersion cubes are actually 4-dimensional data cubes, hence their size increases quickly for a large number of spatial pixels). Therefore, you have specified a larger image scale of 1° for both cubes and only a small number of 10x10 spatial pixels, leading to point spread function and energy dispersion cubes of modest size (a few MB).\n", | 172 | + "You have noticed that for `ctexpcube` you provided an input counts cube, while for the other tools you specified NONE. By providing an input counts cube you instructed ctexpcube to extract the geometry of the cube from the counts cube. This is a convenient trick to reduce the number of user parameters that you need to specify. You did however not apply this trick for `ctpsfcube` and `ctedispcube`. In fact, the point spread function and energy dispersion do not vary significantly on spatial scales of 0.02°, and using the counts cube definition for these cubes would lead to large response cube files with a spatial precision that is actually not needed (the point spread function and energy dispersion cubes are actually 4-dimensional data cubes, hence their size increases quickly for a large number of spatial pixels). Therefore, you have specified a larger image scale of 1° for both cubes and only a small number of 10x10 spatial pixels, leading to point spread function and energy dispersion cubes of modest size (a few MB).\n", |
| 173 | "\n", | 173 | "\n", |
| 174 | - "You provided the obs.xml file that defines all observations on input so that the tools know which observations were combined in the ctbin run. As final step of the analysis preparation, you need to generate a background cube using the ctbkgcube tool." | 174 | + "You provided the `obs.xml` file that defines all observations on input so that the tools know which observations were combined in the ctbin run. As final step of the analysis preparation, you need to generate a background cube using the `ctbkgcube` tool." |
| 175 | ] | 175 | ] |
| 176 | }, | 176 | }, |
| 177 | { | 177 | { |
| @@ -199,7 +199,7 @@ | @@ -199,7 +199,7 @@ | ||
| 199 | "cell_type": "markdown", | 199 | "cell_type": "markdown", |
| 200 | "metadata": {}, | 200 | "metadata": {}, |
| 201 | "source": [ | 201 | "source": [ |
| 202 | - "The usage of ctbkgcube is very similar to that of ctexpcube, yet it takes the model definition XML file as an additional input parameter. You used here the usual $CTOOLS/share/models/crab.xml model file that is shipped with the ctools. ctbkgcube provides on output the background cube file bkgcube.fits and the model definition XML file model.xml that can be used for further analysis. Having a look at the model.xml file illustrates how the background modelling works:" | 202 | + "The usage of `ctbkgcube` is very similar to that of ctexpcube, yet it takes the model definition XML file as an additional input parameter. You used here the usual `$CTOOLS/share/models/crab.xml` model file that is shipped with the ctools. `ctbkgcube` provides on output the background cube file `bkgcube.fits` and the model definition XML file `model.xml` that can be used for further analysis. Having a look at the `model.xml` file illustrates how the background modelling works:" |
| 203 | ] | 203 | ] |
| 204 | }, | 204 | }, |
| 205 | { | 205 | { |
| @@ -238,7 +238,7 @@ | @@ -238,7 +238,7 @@ | ||
| 238 | "cell_type": "markdown", | 238 | "cell_type": "markdown", |
| 239 | "metadata": {}, | 239 | "metadata": {}, |
| 240 | "source": [ | 240 | "source": [ |
| 241 | - "The Crab source component is the same that is also present in $CTOOLS/share/models/crab.xml and is not modified. The background component, however, has been replaced by a model of type CTACubeBackground. This model is a 3-dimensional data cube that describes the expected background rate as function of spatial position and energy. The data cube is multiplied by a power law spectrum that allows to adjust the normalization and slope of the background spectrum in the fit. This power law could be replaced by any spectral model that is found as an appropriate multiplicator to the background cube.\n", | 241 | + "The Crab source component is the same that is also present in `$CTOOLS/share/models/crab.xml` and is not modified. The background component, however, has been replaced by a model of type \"CTACubeBackground\". This model is a 3-dimensional data cube that describes the expected background rate as function of spatial position and energy. The data cube is multiplied by a power law spectrum that allows to adjust the normalization and slope of the background spectrum in the fit. This power law could be replaced by any spectral model that is found as an appropriate multiplicator to the background cube.\n", |
| 242 | "\n", | 242 | "\n", |
| 243 | "**There is no constraint on providing the same spatial binning or the same energy binning for an exposure cube, a PSF cube, an energy dispersion cube, a background cube and a counts cube**. ctools interpolates internally all response cubes hence any arbitrary appropriate binning may be used. Using the same binning for the exposure cube, the background cube and the counts cube is only a convenience.\n", | 243 | "**There is no constraint on providing the same spatial binning or the same energy binning for an exposure cube, a PSF cube, an energy dispersion cube, a background cube and a counts cube**. ctools interpolates internally all response cubes hence any arbitrary appropriate binning may be used. Using the same binning for the exposure cube, the background cube and the counts cube is only a convenience.\n", |
| 244 | "\n", | 244 | "\n", |
| @@ -250,7 +250,9 @@ | @@ -250,7 +250,9 @@ | ||
| 250 | { | 250 | { |
| 251 | "cell_type": "code", | 251 | "cell_type": "code", |
| 252 | "execution_count": 34, | 252 | "execution_count": 34, |
| 253 | - "metadata": {}, | 253 | + "metadata": { |
| 254 | + "collapsed": true | ||
| 255 | + }, | ||
| 254 | "outputs": [], | 256 | "outputs": [], |
| 255 | "source": [ | 257 | "source": [ |
| 256 | "like = ctools.ctlike()\n", | 258 | "like = ctools.ctlike()\n", |
| @@ -354,7 +356,7 @@ | @@ -354,7 +356,7 @@ | ||
| 354 | "collapsed": true | 356 | "collapsed": true |
| 355 | }, | 357 | }, |
| 356 | "source": [ | 358 | "source": [ |
| 357 | - "If you want to consider also the energy dispersion during the maximum likelihood fitting you should pass the hidden (i.e., not queried by the command line interface) edisp parameter to ctlike, and the energy dispersion cube:" | 359 | + "If you want to consider also the energy dispersion during the maximum likelihood fitting you should pass the hidden (i.e., not queried by the command line interface) `edisp` parameter to `ctlike`, and the energy dispersion cube:" |
| 358 | ] | 360 | ] |
| 359 | }, | 361 | }, |
| 360 | { | 362 | { |
doc/source/users/tutorials/quickstart/ctools-from-python.ipynb
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | "\n", | 24 | "\n", |
| 25 | "ctools provides two Python modules that allow using all tools and scripts as Python classes. To use ctools from Python you have to import the `ctools` and `cscripts` modules into Python. You should also import the `gammalib` module, as ctools without GammaLib is generally not very useful.\n", | 25 | "ctools provides two Python modules that allow using all tools and scripts as Python classes. To use ctools from Python you have to import the `ctools` and `cscripts` modules into Python. You should also import the `gammalib` module, as ctools without GammaLib is generally not very useful.\n", |
| 26 | "\n", | 26 | "\n", |
| 27 | - "__Warning:__ Always import gammalib before you import ctools and cscripts." | 27 | + "__Warning:__ Always import `gammalib` before you import `ctools` and `cscripts`." |
| 28 | ] | 28 | ] |
| 29 | }, | 29 | }, |
| 30 | { | 30 | { |