Commit 8ba1b4c495684cde22905a07e0f45f1af24cf24d

Authored by Jürgen Knödlseder
1 parent d51de83b

Adapt to new spectral model names (#1821)

ChangeLog
1 -2016-07-21 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 1 +2016-07-24 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2
3 * Version 1.1.0 released 3 * Version 1.1.0 released
4 ======================== 4 ========================
5 5
  6 + Adapt to new spatial (#1818) and spectral model names (#1821)
6 Fix stacked analysis bias (#1819) 7 Fix stacked analysis bias (#1819)
7 Add background model science verification (#1815) 8 Add background model science verification (#1815)
8 Add cstsmapsplit script (#1797) 9 Add cstsmapsplit script (#1797)
1 New Features and Important Changes in ctools 1.1.0 1 New Features and Important Changes in ctools 1.1.0
2 2
3 -21 July 2016 3 +24 July 2016
4 4
5 5
6 Introduction 6 Introduction
README.md
1 ctools information 1 ctools information
2 ================== 2 ==================
3 -* Version: 1.1.0.dev1 (21 July 2016) 3 +* Version: 1.1.0.dev1 (24 July 2016)
4 * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) 4 * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu)
5 * GammaLib dependency: 1.1.0.dev1 5 * GammaLib dependency: 1.1.0.dev1
6 6
cscripts/cspull.py
@@ -173,8 +173,8 @@ class cspull(ctools.cscript): @@ -173,8 +173,8 @@ class cspull(ctools.cscript):
173 # Compute spatial binning for point spread function and 173 # Compute spatial binning for point spread function and
174 # energy dispersion cubes 174 # energy dispersion cubes
175 binsz = 10.0 * self['binsz'].real() 175 binsz = 10.0 * self['binsz'].real()
176 - nxpix = self['nxpix'].integer() // 10 # Make sure result is int  
177 - nypix = self['nypix'].integer() // 10 # Make sure result is int 176 + nxpix = self['npix'].integer() // 10 # Make sure result is int
  177 + nypix = self['npix'].integer() // 10 # Make sure result is int
178 if nxpix < 2: 178 if nxpix < 2:
179 nxpix = 2 179 nxpix = 2
180 if nypix < 2: 180 if nypix < 2:
doc/source/users/user_manual/getting_started/models.rst
@@ -118,16 +118,14 @@ term will be appended to each ``&lt;parameter&gt;`` tag. @@ -118,16 +118,14 @@ term will be appended to each ``&lt;parameter&gt;`` tag.
118 parameters so that the effective parameters to be optimised (the ``value`` terms) 118 parameters so that the effective parameters to be optimised (the ``value`` terms)
119 are all of about unity. 119 are all of about unity.
120 120
121 -.. warning:: 121 +.. note::
122 122
123 - The syntax of the model definition XML file has been adopted from the  
124 - syntax used by the Fermi/LAT ScienceTools.  
125 - This should allow for exchange of model definition files between ctools  
126 - and the Fermi/LAT ScienceTools.  
127 - Note, however, that ctools implements a number of extensions with  
128 - respect to the Fermi/LAT ScienceTools syntax, hence eventually minor  
129 - manual adjustments may be needed to use ctools XML files for  
130 - Fermi/LAT analyses. 123 + The syntax of the model definition XML file has been inspired from the
  124 + syntax used by the Fermi/LAT ScienceTools, but for reasons of clarity and
  125 + homogenity of the various model and parameter names we have made some
  126 + modifications.
  127 + Nevertheless, the exact format used by the Fermi/LAT ScienceTools is also
  128 + supported.
131 129
132 130
133 .. _sec_spatial_models: 131 .. _sec_spatial_models:
@@ -155,8 +153,8 @@ Point source @@ -155,8 +153,8 @@ Point source
155 153
156 .. note:: 154 .. note::
157 155
158 - For compatibility with the Fermi/LAT ScienceTools the model type ``PointSource``  
159 - can be replaced by ``SkyDirFunction``. 156 + For compatibility with the Fermi/LAT ScienceTools the model type
  157 + ``PointSource`` can be replaced by ``SkyDirFunction``.
160 158
161 159
162 Radial source 160 Radial source
@@ -373,8 +371,6 @@ in ctools. @@ -373,8 +371,6 @@ in ctools.
373 371
374 .. warning:: 372 .. warning::
375 373
376 - The units of the spectral model depend on the spatial model component.  
377 - Units quoted below apply to spatial models for a source component.  
378 Source intensities are generally given in units of 374 Source intensities are generally given in units of
379 :math:`{\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1}`. 375 :math:`{\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1}`.
380 376
@@ -405,11 +401,11 @@ Constant @@ -405,11 +401,11 @@ Constant
405 401
406 .. code-block:: xml 402 .. code-block:: xml
407 403
408 - <spectrum type="ConstantValue"> 404 + <spectrum type="Constant">
409 <parameter name="Normalization" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/> 405 <parameter name="Normalization" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>
410 </spectrum> 406 </spectrum>
411 407
412 - The ``ConstantValue`` model component implements the constant function 408 + This spectral model component implements the constant function
413 409
414 .. math:: 410 .. math::
415 \frac{dN}{dE} = N_0 411 \frac{dN}{dE} = N_0
@@ -419,6 +415,11 @@ Constant @@ -419,6 +415,11 @@ Constant
419 * :math:`N_0` = ``Normalization`` 415 * :math:`N_0` = ``Normalization``
420 :math:`({\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1})` 416 :math:`({\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1})`
421 417
  418 + .. note::
  419 +
  420 + For compatibility with the Fermi/LAT ScienceTools the model type
  421 + ``Constant`` can be replaced by ``ConstantValue`` and the parameter
  422 + ``Normalization`` by ``Value``.
422 423
423 424
424 Power law 425 Power law
@@ -432,7 +433,7 @@ Power law @@ -432,7 +433,7 @@ Power law
432 <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> 433 <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/>
433 </spectrum> 434 </spectrum>
434 435
435 - The ``PowerLaw`` model component implements the power law function 436 + This spectral model component implements the power law function
436 437
437 .. math:: 438 .. math::
438 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma} 439 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma}
@@ -454,19 +455,19 @@ Power law @@ -454,19 +455,19 @@ Power law
454 For compatibility with the Fermi/LAT ScienceTools the parameter 455 For compatibility with the Fermi/LAT ScienceTools the parameter
455 ``PivotEnergy`` can be replaced by ``Scale``. 456 ``PivotEnergy`` can be replaced by ``Scale``.
456 457
457 - An alternative power law function that uses the integral photon flux as parameter  
458 - rather than the Prefactor is specified by 458 + An alternative power law function that uses the integral photon flux as
  459 + parameter rather than the Prefactor is specified by
459 460
460 .. code-block:: xml 461 .. code-block:: xml
461 462
462 - <spectrum type="PowerLawPhotonFlux"> 463 + <spectrum type="PowerLaw">
463 <parameter scale="1e-07" name="PhotonFlux" min="1e-07" max="1000.0" value="1.0" free="1"/> 464 <parameter scale="1e-07" name="PhotonFlux" min="1e-07" max="1000.0" value="1.0" free="1"/>
464 <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> 465 <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/>
465 <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> 466 <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/>
466 <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> 467 <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/>
467 </spectrum> 468 </spectrum>
468 469
469 - The ``PowerLawPhotonFlux`` model component implements the power law function 470 + This spectral model component implements the power law function
470 471
471 .. math:: 472 .. math::
472 \frac{dN}{dE} = \frac{N(\gamma+1)E^{\gamma}} 473 \frac{dN}{dE} = \frac{N(\gamma+1)E^{\gamma}}
@@ -484,8 +485,8 @@ Power law @@ -484,8 +485,8 @@ Power law
484 485
485 .. warning:: 486 .. warning::
486 487
487 - The ``LowerLimit`` and ``UpperLimit`` parameters are always treated as fixed and,  
488 - the flux given by the ``PhotonFlux`` parameter is computed over the 488 + The ``LowerLimit`` and ``UpperLimit`` parameters are always treated as fixed
  489 + and the flux given by the ``PhotonFlux`` parameter is computed over the
489 range set by these two parameters. 490 range set by these two parameters.
490 Use of this model allows the errors on the integral flux to be evaluated directly 491 Use of this model allows the errors on the integral flux to be evaluated directly
491 by :ref:`ctlike`. 492 by :ref:`ctlike`.
@@ -493,8 +494,8 @@ Power law @@ -493,8 +494,8 @@ Power law
493 .. note:: 494 .. note::
494 495
495 For compatibility with the Fermi/LAT ScienceTools the model type 496 For compatibility with the Fermi/LAT ScienceTools the model type
496 - ``PowerLawPhotonFlux`` can be replaced by ``PowerLaw2`` and the parameter  
497 - ``PhotonFlux`` can be replaced by ``Integral``. 497 + ``PowerLaw`` can be replaced by ``PowerLaw2`` and the parameter
  498 + ``PhotonFlux`` by ``Integral``.
498 499
499 500
500 Exponentially cut-off power law 501 Exponentially cut-off power law
@@ -502,18 +503,19 @@ Exponentially cut-off power law @@ -502,18 +503,19 @@ Exponentially cut-off power law
502 503
503 .. code-block:: xml 504 .. code-block:: xml
504 505
505 - <spectrum type="ExpCutoff">  
506 - <parameter name="Prefactor" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>  
507 - <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/>  
508 - <parameter name="Cutoff" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>  
509 - <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> 506 + <spectrum type="ExponentialCutoffPowerLaw">
  507 + <parameter name="Prefactor" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>
  508 + <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/>
  509 + <parameter name="CutoffEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>
  510 + <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/>
510 </spectrum> 511 </spectrum>
511 512
512 - The ``ExpCutoff`` model component implements the exponentially cut-off power law function 513 + This spectral model component implements the exponentially cut-off power law
  514 + function
513 515
514 .. math:: 516 .. math::
515 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma} 517 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma}
516 - \exp \left( \frac{-E}{\tt E_{\rm cut}} \right) 518 + \exp \left( \frac{-E}{E_{\rm cut}} \right)
517 519
518 where 520 where
519 521
@@ -522,7 +524,7 @@ Exponentially cut-off power law @@ -522,7 +524,7 @@ Exponentially cut-off power law
522 * :math:`\gamma` = ``Index`` 524 * :math:`\gamma` = ``Index``
523 * :math:`E_0` = ``PivotEnergy`` 525 * :math:`E_0` = ``PivotEnergy``
524 :math:`({\rm MeV})` 526 :math:`({\rm MeV})`
525 - * :math:`E_{\rm cut}` = ``Cutoff`` 527 + * :math:`E_{\rm cut}` = ``CutoffEnergy``
526 :math:`({\rm MeV})` 528 :math:`({\rm MeV})`
527 529
528 .. warning:: 530 .. warning::
@@ -531,8 +533,61 @@ Exponentially cut-off power law @@ -531,8 +533,61 @@ Exponentially cut-off power law
531 533
532 .. note:: 534 .. note::
533 535
534 - For compatibility with the Fermi/LAT ScienceTools the parameter  
535 - ``PivotEnergy`` can be replaced by ``Scale``. 536 + For compatibility with the Fermi/LAT ScienceTools the model type
  537 + ``ExponentialCutoffPowerLaw`` can be replaced by ``ExpCutoff`` and
  538 + the parameters ``CutoffEnergy`` by ``Cutoff`` and ``PivotEnergy``
  539 + by ``Scale``.
  540 +
  541 +
  542 +Super exponentially cut-off power law
  543 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  544 +
  545 + .. code-block:: xml
  546 +
  547 + <spectrum type="SuperExponentialCutoffPowerLaw">
  548 + <parameter name="Prefactor" scale="1e-16" value="1.0" min="1e-07" max="1000.0" free="1"/>
  549 + <parameter name="Index1" scale="-1" value="2.0" min="0.0" max="+5.0" free="1"/>
  550 + <parameter name="CutoffEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>
  551 + <parameter name="Index2" scale="1.0" value="1.5" min="0.1" max="5.0" free="1"/>
  552 + <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
  553 + </spectrum>
  554 +
  555 + This spectral model component implements the super exponentially cut-off power
  556 + law function
  557 +
  558 + .. math::
  559 + \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma}
  560 + \exp \left(
  561 + -\left( \frac{E}{E_{\rm cut}} \right)^{\alpha}
  562 + \right)
  563 +
  564 + where
  565 +
  566 + * :math:`k_0` = ``Prefactor``
  567 + :math:`({\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1})`
  568 + * :math:`\gamma` = ``Index1``
  569 + * :math:`\alpha` = ``Index2``
  570 + * :math:`E_0` = ``PivotEnergy``
  571 + :math:`({\rm MeV})`
  572 + * :math:`E_{\rm cut}` = ``CutoffEnergy``
  573 + :math:`({\rm MeV})`
  574 +
  575 + .. warning::
  576 +
  577 + The ``PivotEnergy`` parameter is not intended to be fitted.
  578 +
  579 + An alternative XML format is supported for compatibility with the Fermi/LAT
  580 + XML format:
  581 +
  582 + .. code-block:: xml
  583 +
  584 + <spectrum type="PLSuperExpCutoff">
  585 + <parameter name="Prefactor" scale="1e-16" value="1.0" min="1e-07" max="1000.0" free="1"/>
  586 + <parameter name="Index1" scale="-1" value="2.0" min="0.0" max="+5.0" free="1"/>
  587 + <parameter name="Cutoff" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>
  588 + <parameter name="Index2" scale="1.0" value="1.5" min="0.1" max="5.0" free="1"/>
  589 + <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
  590 + </spectrum>
536 591
537 592
538 Broken power law 593 Broken power law
@@ -541,13 +596,13 @@ Broken power law @@ -541,13 +596,13 @@ Broken power law
541 .. code-block:: xml 596 .. code-block:: xml
542 597
543 <spectrum type="BrokenPowerLaw"> 598 <spectrum type="BrokenPowerLaw">
544 - <parameter name="Prefactor" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>  
545 - <parameter name="Index1" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/>  
546 - <parameter name="BreakValue" scale="1e6" value="0.3" min="0.01" max="1000.0" free="1"/>  
547 - <parameter name="Index2" scale="-1" value="2.70" min="0.01" max="1000.0" free="1"/> 599 + <parameter name="Prefactor" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>
  600 + <parameter name="Index1" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/>
  601 + <parameter name="BreakEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="1"/>
  602 + <parameter name="Index2" scale="-1" value="2.70" min="0.01" max="1000.0" free="1"/>
548 </spectrum> 603 </spectrum>
549 604
550 - The ``BrokenPowerLaw`` model component implements the broken power law function 605 + This spectral model component implements the broken power law function
551 606
552 .. math:: 607 .. math::
553 608
@@ -564,15 +619,20 @@ Broken power law @@ -564,15 +619,20 @@ Broken power law
564 :math:`({\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1})` 619 :math:`({\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1})`
565 * :math:`\gamma_1` = ``Index1`` 620 * :math:`\gamma_1` = ``Index1``
566 * :math:`\gamma_2` = ``Index2`` 621 * :math:`\gamma_2` = ``Index2``
567 - * :math:`E_b` = ``BreakValue`` 622 + * :math:`E_b` = ``BreakEnergy``
568 :math:`({\rm MeV})` 623 :math:`({\rm MeV})`
569 624
570 .. warning:: 625 .. warning::
571 626
572 - Note that the ``BreakValue`` parameter may be poorly constrained if 627 + Note that the ``BreakEnergy`` parameter may be poorly constrained if
573 there is no clear spectral cut-off in the spectrum. 628 there is no clear spectral cut-off in the spectrum.
574 This model may lead to complications in the maximum likelihood fitting. 629 This model may lead to complications in the maximum likelihood fitting.
575 630
  631 + .. note::
  632 +
  633 + For compatibility with the Fermi/LAT ScienceTools the parameters
  634 + ``BreakEnergy`` can be replaced by ``BreakValue``.
  635 +
576 636
577 Log parabola 637 Log parabola
578 ^^^^^^^^^^^^ 638 ^^^^^^^^^^^^
@@ -586,7 +646,7 @@ Log parabola @@ -586,7 +646,7 @@ Log parabola
586 <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/> 646 <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
587 </spectrum> 647 </spectrum>
588 648
589 - The ``LogParabola`` model component implements the log parabola function 649 + This spectral model component implements the log parabola function
590 650
591 .. math:: 651 .. math::
592 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma+\eta \ln(E/E_0)} 652 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma+\eta \ln(E/E_0)}
@@ -633,7 +693,7 @@ Gaussian @@ -633,7 +693,7 @@ Gaussian
633 <parameter name="Sigma" scale="1e6" value="1.0" min="0.01" max="100.0" free="1"/> 693 <parameter name="Sigma" scale="1e6" value="1.0" min="0.01" max="100.0" free="1"/>
634 </spectrum> 694 </spectrum>
635 695
636 - The ``Gaussian`` model component implements the gaussian function 696 + This spectral model component implements the gaussian function
637 697
638 .. math:: 698 .. math::
639 \frac{dN}{dE} = \frac{N_0}{\sqrt{2\pi}\sigma} 699 \frac{dN}{dE} = \frac{N_0}{\sqrt{2\pi}\sigma}
@@ -658,7 +718,7 @@ File function @@ -658,7 +718,7 @@ File function
658 <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> 718 <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/>
659 </spectrum> 719 </spectrum>
660 720
661 - The ``FileFunction`` model component implements an arbitrary function 721 + This spectral model component implements an arbitrary function
662 that is defined by intensity values at specific energies. 722 that is defined by intensity values at specific energies.
663 The energy and intensity values are defined using an ASCII file with 723 The energy and intensity values are defined using an ASCII file with
664 columns of energy and differential flux values. 724 columns of energy and differential flux values.
@@ -677,9 +737,10 @@ File function @@ -677,9 +737,10 @@ File function
677 737
678 .. warning:: 738 .. warning::
679 739
680 - If the file name is given as relative path, the path is relative to the  
681 - working directory where the ctool has been launched.  
682 - Alternatively, an absolute path may be specified. 740 + If the file name is given without a path it is expected that the file
  741 + resides in the same directory than the XML file.
  742 + If the file resides in a different directory, an absolute path name should
  743 + be specified.
683 Any environment variable present in the path name will be expanded. 744 Any environment variable present in the path name will be expanded.
684 745
685 746
@@ -699,7 +760,7 @@ Node function @@ -699,7 +760,7 @@ Node function
699 </node> 760 </node>
700 </spectrum> 761 </spectrum>
701 762
702 - The ``NodeFunction`` model component implements a generalised broken 763 + This spectral model component implements a generalised broken
703 power law which is defined by a set of energy and intensity values 764 power law which is defined by a set of energy and intensity values
704 (the so called nodes) that are piecewise connected by power laws. 765 (the so called nodes) that are piecewise connected by power laws.
705 Energies are given in units of 766 Energies are given in units of
test/data/obs_stacked_two.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<observation_list title="observation list">
  3 + <observation name="Crab" id="000001" instrument="CTA">
  4 + <parameter name="Pointing" ra="83.6331" dec="21.0145" />
  5 + <parameter name="EnergyBoundaries" emin="50000" emax="1e+08" />
  6 + <parameter name="GoodTimeIntervals" tmin="0" tmax="1800" />
  7 + <parameter name="TimeReference" mjdrefi="51544" mjdreff="0.5" timeunit="s" timesys="TT" timeref="LOCAL" />
  8 + <parameter name="RegionOfInterest" ra="83.6331" dec="21.0145" rad="1.5" />
  9 + <parameter name="Deadtime" deadc="0.95" />
  10 + <parameter name="Calibration" database="prod2" response="South_0.5h" />
  11 + </observation>
  12 + <observation name="Crab" id="000002" instrument="CTA">
  13 + <parameter name="Pointing" ra="83.6331" dec="23.0145" />
  14 + <parameter name="EnergyBoundaries" emin="70000" emax="1e+08" />
  15 + <parameter name="GoodTimeIntervals" tmin="1800" tmax="3600" />
  16 + <parameter name="TimeReference" mjdrefi="51544" mjdreff="0.5" timeunit="s" timesys="TT" timeref="LOCAL" />
  17 + <parameter name="RegionOfInterest" ra="83.6331" dec="23.0145" rad="1.5" />
  18 + <parameter name="Deadtime" deadc="0.95" />
  19 + <parameter name="Calibration" database="prod2" response="South_0.5h" />
  20 + </observation>
  21 +</observation_list>
test/data/sciver/crab_eplaw.xml
1 <?xml version="1.0" standalone="no"?> 1 <?xml version="1.0" standalone="no"?>
2 <source_library title="source library"> 2 <source_library title="source library">
3 <source name="Crab" type="PointSource"> 3 <source name="Crab" type="PointSource">
4 - <spectrum type="ExpCutoff">  
5 - <parameter name="Prefactor" scale="1e-15" value="2.0" min="1e-07" max="1000.0" free="1"/>  
6 - <parameter name="Index" scale="-1" value="2.1" min="0.0" max="+5.0" free="1"/>  
7 - <parameter name="Cutoff" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>  
8 - <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> 4 + <spectrum type="ExponentialCutoffPowerLaw">
  5 + <parameter name="Prefactor" scale="1e-15" value="2.0" min="1e-07" max="1000.0" free="1"/>
  6 + <parameter name="Index" scale="-1" value="2.1" min="0.0" max="+5.0" free="1"/>
  7 + <parameter name="CutoffEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>
  8 + <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/>
9 </spectrum> 9 </spectrum>
10 <spatialModel type="PointSource"> 10 <spatialModel type="PointSource">
11 <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> 11 <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
test/data/sciver/crab_plaw2.xml
1 <?xml version="1.0" standalone="no"?> 1 <?xml version="1.0" standalone="no"?>
2 <source_library title="source library"> 2 <source_library title="source library">
3 <source name="Crab" type="PointSource"> 3 <source name="Crab" type="PointSource">
4 - <spectrum type="PowerLawPhotonFlux"> 4 + <spectrum type="PowerLaw">
5 <parameter name="PhotonFlux" scale="1e-5" value="1.617" min="1e-07" max="1000.0" free="1"/> 5 <parameter name="PhotonFlux" scale="1e-5" value="1.617" min="1e-07" max="1000.0" free="1"/>
6 <parameter name="Index" scale="-1.0" value="2.48" min="-5.0" max="+5.0" free="1"/> 6 <parameter name="Index" scale="-1.0" value="2.48" min="-5.0" max="+5.0" free="1"/>
7 <parameter name="LowerLimit" scale="1.0" value="100.0" min="10.0" max="1000000.0" free="0"/> 7 <parameter name="LowerLimit" scale="1.0" value="100.0" min="10.0" max="1000000.0" free="0"/>
test/data/sciver/crab_supeplaw.xml
1 <?xml version="1.0" standalone="no"?> 1 <?xml version="1.0" standalone="no"?>
2 <source_library title="source library"> 2 <source_library title="source library">
3 <source name="Crab" type="PointSource"> 3 <source name="Crab" type="PointSource">
4 - <spectrum type="PLSuperExpCutoff">  
5 - <parameter name="Prefactor" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>  
6 - <parameter name="Index1" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/>  
7 - <parameter name="Cutoff" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>  
8 - <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>  
9 - <parameter name="Index2" scale="1.0" value="1.5" min="0.1" max="5.0" free="1"/> 4 + <spectrum type="SuperExponentialCutoffPowerLaw">
  5 + <parameter name="Prefactor" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>
  6 + <parameter name="Index1" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/>
  7 + <parameter name="CutoffEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/>
  8 + <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
  9 + <parameter name="Index2" scale="1.0" value="1.5" min="0.1" max="5.0" free="1"/>
10 </spectrum> 10 </spectrum>
11 <spatialModel type="PointSource"> 11 <spatialModel type="PointSource">
12 <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> 12 <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
test/science_verification.py
@@ -424,7 +424,7 @@ class sciver(gammalib.GPythonTestSuite): @@ -424,7 +424,7 @@ class sciver(gammalib.GPythonTestSuite):
424 self.pull('data/sciver/crab_eplaw') 424 self.pull('data/sciver/crab_eplaw')
425 self.test('Pull_Crab_Prefactor') 425 self.test('Pull_Crab_Prefactor')
426 self.test('Pull_Crab_Index') 426 self.test('Pull_Crab_Index')
427 - self.test('Pull_Crab_Cutoff') 427 + self.test('Pull_Crab_CutoffEnergy')
428 self.test('Pull_Background_Prefactor') 428 self.test('Pull_Background_Prefactor')
429 self.test('Pull_Background_Index') 429 self.test('Pull_Background_Index')
430 return 430 return
@@ -438,7 +438,7 @@ class sciver(gammalib.GPythonTestSuite): @@ -438,7 +438,7 @@ class sciver(gammalib.GPythonTestSuite):
438 self.test('Pull_Crab_Prefactor') 438 self.test('Pull_Crab_Prefactor')
439 self.test('Pull_Crab_Index1') 439 self.test('Pull_Crab_Index1')
440 self.test('Pull_Crab_Index2') 440 self.test('Pull_Crab_Index2')
441 - self.test('Pull_Crab_Cutoff') 441 + self.test('Pull_Crab_CutoffEnergy')
442 self.test('Pull_Background_Prefactor') 442 self.test('Pull_Background_Prefactor')
443 self.test('Pull_Background_Index') 443 self.test('Pull_Background_Index')
444 return 444 return
test/test_cspull.py
@@ -44,6 +44,7 @@ class Test(test): @@ -44,6 +44,7 @@ class Test(test):
44 44
45 # Set members 45 # Set members
46 self._inobs = self._datadir + '/obs_stacked.xml' 46 self._inobs = self._datadir + '/obs_stacked.xml'
  47 + self._inobs_two = self._datadir + '/obs_stacked_two.xml'
47 self._stacked_model = self._datadir + '/crab_bkgcube.xml' 48 self._stacked_model = self._datadir + '/crab_bkgcube.xml'
48 49
49 # Return 50 # Return
@@ -209,14 +210,13 @@ class Test(test): @@ -209,14 +210,13 @@ class Test(test):
209 # Check pull distribution file 210 # Check pull distribution file
210 self._check_pull_file('cspull_py4.dat') 211 self._check_pull_file('cspull_py4.dat')
211 212
212 - # Set-up stacked cspull 213 + # Set-up stacked cspull with one observation where response cubes
  214 + # are specified in the input observation
213 pull = cscripts.cspull() 215 pull = cscripts.cspull()
214 pull['inobs'] = self._inobs 216 pull['inobs'] = self._inobs
215 pull['inmodel'] = self._stacked_model 217 pull['inmodel'] = self._stacked_model
216 pull['outfile'] = 'cspull_py5.dat' 218 pull['outfile'] = 'cspull_py5.dat'
217 pull['ntrials'] = 3 219 pull['ntrials'] = 3
218 - pull['caldb'] = self._caldb  
219 - pull['irf'] = self._irf  
220 pull['enumbins'] = 0 220 pull['enumbins'] = 0
221 pull['logfile'] = 'cspull_py5.log' 221 pull['logfile'] = 'cspull_py5.log'
222 pull['chatter'] = 4 222 pull['chatter'] = 4
@@ -227,6 +227,31 @@ class Test(test): @@ -227,6 +227,31 @@ class Test(test):
227 # Check pull distribution file 227 # Check pull distribution file
228 self._check_pull_file('cspull_py5.dat') 228 self._check_pull_file('cspull_py5.dat')
229 229
  230 + # Set-up stacked cspull with two observations from which response
  231 + # cubes will be computed internally. The IRFs are also specified
  232 + # in the input observation, hence we do not need to query the IRF
  233 + # parameters.
  234 + pull = cscripts.cspull()
  235 + pull['inobs'] = self._inobs_two
  236 + pull['inmodel'] = self._model
  237 + pull['outfile'] = 'cspull_py6.dat'
  238 + pull['ntrials'] = 3
  239 + pull['emin'] = 0.02
  240 + pull['emax'] = 100.0
  241 + pull['enumbins'] = 10
  242 + pull['npix'] = 20
  243 + pull['binsz'] = 0.2
  244 + pull['coordsys'] = 'CEL'
  245 + pull['proj'] = 'TAN'
  246 + pull['logfile'] = 'cspull_py6.log'
  247 + pull['chatter'] = 4
  248 +
  249 + # Execute cspull script
  250 + pull.execute()
  251 +
  252 + # Check pull distribution file
  253 + self._check_pull_file('cspull_py6.dat')
  254 +
230 # Return 255 # Return
231 return 256 return
232 257