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 3 * Version 1.1.0 released
4 4 ========================
5 5  
  6 + Adapt to new spatial (#1818) and spectral model names (#1821)
6 7 Fix stacked analysis bias (#1819)
7 8 Add background model science verification (#1815)
8 9 Add cstsmapsplit script (#1797)
... ...
1 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 6 Introduction
... ...
README.md
1 1 ctools information
2 2 ==================
3   -* Version: 1.1.0.dev1 (21 July 2016)
  3 +* Version: 1.1.0.dev1 (24 July 2016)
4 4 * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu)
5 5 * GammaLib dependency: 1.1.0.dev1
6 6  
... ...
cscripts/cspull.py
... ... @@ -173,8 +173,8 @@ class cspull(ctools.cscript):
173 173 # Compute spatial binning for point spread function and
174 174 # energy dispersion cubes
175 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 178 if nxpix < 2:
179 179 nxpix = 2
180 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 118 parameters so that the effective parameters to be optimised (the ``value`` terms)
119 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 131 .. _sec_spatial_models:
... ... @@ -155,8 +153,8 @@ Point source
155 153  
156 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 160 Radial source
... ... @@ -373,8 +371,6 @@ in ctools.
373 371  
374 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 374 Source intensities are generally given in units of
379 375 :math:`{\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1}`.
380 376  
... ... @@ -405,11 +401,11 @@ Constant
405 401  
406 402 .. code-block:: xml
407 403  
408   - <spectrum type="ConstantValue">
  404 + <spectrum type="Constant">
409 405 <parameter name="Normalization" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/>
410 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 410 .. math::
415 411 \frac{dN}{dE} = N_0
... ... @@ -419,6 +415,11 @@ Constant
419 415 * :math:`N_0` = ``Normalization``
420 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 425 Power law
... ... @@ -432,7 +433,7 @@ Power law
432 433 <parameter name="PivotEnergy" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/>
433 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 438 .. math::
438 439 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma}
... ... @@ -454,19 +455,19 @@ Power law
454 455 For compatibility with the Fermi/LAT ScienceTools the parameter
455 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 461 .. code-block:: xml
461 462  
462   - <spectrum type="PowerLawPhotonFlux">
  463 + <spectrum type="PowerLaw">
463 464 <parameter scale="1e-07" name="PhotonFlux" min="1e-07" max="1000.0" value="1.0" free="1"/>
464 465 <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/>
465 466 <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/>
466 467 <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/>
467 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 472 .. math::
472 473 \frac{dN}{dE} = \frac{N(\gamma+1)E^{\gamma}}
... ... @@ -484,8 +485,8 @@ Power law
484 485  
485 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 490 range set by these two parameters.
490 491 Use of this model allows the errors on the integral flux to be evaluated directly
491 492 by :ref:`ctlike`.
... ... @@ -493,8 +494,8 @@ Power law
493 494 .. note::
494 495  
495 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 501 Exponentially cut-off power law
... ... @@ -502,18 +503,19 @@ Exponentially cut-off power law
502 503  
503 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 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 516 .. math::
515 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 520 where
519 521  
... ... @@ -522,7 +524,7 @@ Exponentially cut-off power law
522 524 * :math:`\gamma` = ``Index``
523 525 * :math:`E_0` = ``PivotEnergy``
524 526 :math:`({\rm MeV})`
525   - * :math:`E_{\rm cut}` = ``Cutoff``
  527 + * :math:`E_{\rm cut}` = ``CutoffEnergy``
526 528 :math:`({\rm MeV})`
527 529  
528 530 .. warning::
... ... @@ -531,8 +533,61 @@ Exponentially cut-off power law
531 533  
532 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 593 Broken power law
... ... @@ -541,13 +596,13 @@ Broken power law
541 596 .. code-block:: xml
542 597  
543 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 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 607 .. math::
553 608  
... ... @@ -564,15 +619,20 @@ Broken power law
564 619 :math:`({\rm ph}\,\,{\rm cm}^{-2}\,{\rm s}^{-1}\,{\rm MeV}^{-1})`
565 620 * :math:`\gamma_1` = ``Index1``
566 621 * :math:`\gamma_2` = ``Index2``
567   - * :math:`E_b` = ``BreakValue``
  622 + * :math:`E_b` = ``BreakEnergy``
568 623 :math:`({\rm MeV})`
569 624  
570 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 628 there is no clear spectral cut-off in the spectrum.
574 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 637 Log parabola
578 638 ^^^^^^^^^^^^
... ... @@ -586,7 +646,7 @@ Log parabola
586 646 <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
587 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 651 .. math::
592 652 \frac{dN}{dE} = k_0 \left( \frac{E}{E_0} \right)^{\gamma+\eta \ln(E/E_0)}
... ... @@ -633,7 +693,7 @@ Gaussian
633 693 <parameter name="Sigma" scale="1e6" value="1.0" min="0.01" max="100.0" free="1"/>
634 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 698 .. math::
639 699 \frac{dN}{dE} = \frac{N_0}{\sqrt{2\pi}\sigma}
... ... @@ -658,7 +718,7 @@ File function
658 718 <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/>
659 719 </spectrum>
660 720  
661   - The ``FileFunction`` model component implements an arbitrary function
  721 + This spectral model component implements an arbitrary function
662 722 that is defined by intensity values at specific energies.
663 723 The energy and intensity values are defined using an ASCII file with
664 724 columns of energy and differential flux values.
... ... @@ -677,9 +737,10 @@ File function
677 737  
678 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 744 Any environment variable present in the path name will be expanded.
684 745  
685 746  
... ... @@ -699,7 +760,7 @@ Node function
699 760 </node>
700 761 </spectrum>
701 762  
702   - The ``NodeFunction`` model component implements a generalised broken
  763 + This spectral model component implements a generalised broken
703 764 power law which is defined by a set of energy and intensity values
704 765 (the so called nodes) that are piecewise connected by power laws.
705 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 1 <?xml version="1.0" standalone="no"?>
2 2 <source_library title="source library">
3 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 9 </spectrum>
10 10 <spatialModel type="PointSource">
11 11 <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
... ...
test/data/sciver/crab_plaw2.xml
1 1 <?xml version="1.0" standalone="no"?>
2 2 <source_library title="source library">
3 3 <source name="Crab" type="PointSource">
4   - <spectrum type="PowerLawPhotonFlux">
  4 + <spectrum type="PowerLaw">
5 5 <parameter name="PhotonFlux" scale="1e-5" value="1.617" min="1e-07" max="1000.0" free="1"/>
6 6 <parameter name="Index" scale="-1.0" value="2.48" min="-5.0" max="+5.0" free="1"/>
7 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 1 <?xml version="1.0" standalone="no"?>
2 2 <source_library title="source library">
3 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 10 </spectrum>
11 11 <spatialModel type="PointSource">
12 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 424 self.pull('data/sciver/crab_eplaw')
425 425 self.test('Pull_Crab_Prefactor')
426 426 self.test('Pull_Crab_Index')
427   - self.test('Pull_Crab_Cutoff')
  427 + self.test('Pull_Crab_CutoffEnergy')
428 428 self.test('Pull_Background_Prefactor')
429 429 self.test('Pull_Background_Index')
430 430 return
... ... @@ -438,7 +438,7 @@ class sciver(gammalib.GPythonTestSuite):
438 438 self.test('Pull_Crab_Prefactor')
439 439 self.test('Pull_Crab_Index1')
440 440 self.test('Pull_Crab_Index2')
441   - self.test('Pull_Crab_Cutoff')
  441 + self.test('Pull_Crab_CutoffEnergy')
442 442 self.test('Pull_Background_Prefactor')
443 443 self.test('Pull_Background_Index')
444 444 return
... ...
test/test_cspull.py
... ... @@ -44,6 +44,7 @@ class Test(test):
44 44  
45 45 # Set members
46 46 self._inobs = self._datadir + '/obs_stacked.xml'
  47 + self._inobs_two = self._datadir + '/obs_stacked_two.xml'
47 48 self._stacked_model = self._datadir + '/crab_bkgcube.xml'
48 49  
49 50 # Return
... ... @@ -209,14 +210,13 @@ class Test(test):
209 210 # Check pull distribution file
210 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 215 pull = cscripts.cspull()
214 216 pull['inobs'] = self._inobs
215 217 pull['inmodel'] = self._stacked_model
216 218 pull['outfile'] = 'cspull_py5.dat'
217 219 pull['ntrials'] = 3
218   - pull['caldb'] = self._caldb
219   - pull['irf'] = self._irf
220 220 pull['enumbins'] = 0
221 221 pull['logfile'] = 'cspull_py5.log'
222 222 pull['chatter'] = 4
... ... @@ -227,6 +227,31 @@ class Test(test):
227 227 # Check pull distribution file
228 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 255 # Return
231 256 return
232 257  
... ...