Commit 0a31b7c0affabed8bd9a69cbfc805c9cb7297f3a

Authored by Jürgen Knödlseder
2 parents 53ca257e 5043f2ad

Merge branch 'integration' into devel

ChangeLog
1   -2016-01-06 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
  1 +2016-01-11 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2  
3 3 * Version 1.1.0 released
4 4 ========================
5 5  
6 6  
7   -2016-01-06 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
  7 +2016-01-11 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
8 8  
9 9 * Bug fix version 1.0.1 released
10 10 ================================
... ...
... ... @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.1.0
2 2  
3 3 Author(s) : Juergen Knoedlseder
4 4  
5   -6 January 2016
  5 +11 January 2016
6 6  
7 7  
8 8 1. Introduction
... ...
1 1 ctools information
2 2 ==================
3   -Version: 1.1.0dev (6 January 2016)
  3 +Version: 1.1.0dev (11 January 2016)
4 4 Author: Juergen Knodlseder (jurgen.knodlseder@irap.omp.eu)
5 5 GammaLib dependency: 1.1.0dev
6 6  
... ...
doc/source/reference_manual/csresmap.rst
... ... @@ -31,18 +31,33 @@ General parameters
31 31 ``inobs [file]``
32 32 Input event list, counts cube or observation definition XML file.
33 33  
  34 +``modcube [file]``
  35 + Input model cube file (generated with ctmodel).
  36 +
  37 +``expcube [file]``
  38 + Input exposure cube file (only needed for stacked analysis).
  39 +
  40 +``psfcube [file]``
  41 + Input PSF cube file (only needed for stacked analysis).
  42 +
  43 +``bkgcube [file]``
  44 + Input background cube file (only needed for stacked analysis).
  45 +
34 46 ``inmodel [file]``
35 47 Input model XML file.
36 48  
37   -``outmap [file]``
38   - Output residual counts map file.
39   -
40 49 ``caldb [string]``
41 50 Calibration database.
42 51  
43 52 ``irf [string]``
44 53 Instrument response function.
45 54  
  55 +``(edisp = no) [boolean]``
  56 + Apply energy dispersion?
  57 +
  58 +``outmap [file]``
  59 + Output residual counts map file.
  60 +
46 61 ``(ebinalg = LOG) <FILE|LIN|LOG> [string]``
47 62 Algorithm for defining energy bins.
48 63  
... ... @@ -58,27 +73,27 @@ General parameters
58 73 ``(ebinfile = NONE) [file]``
59 74 Name of the file containing the energy bin definition.
60 75  
61   -``nxpix [integer]``
62   - Number of cube bins in Right Ascension or Galactic longitude.
63   -
64   -``nypix [integer]``
65   - Number of cube bins in Declination or Galactic latitude.
66   -
67   -``binsz [real]``
68   - Cube bin size (in degrees/pixel).
69   -
70 76 ``coordsys <CEL|GAL> [string]``
71 77 Coordinate system (CEL - celestial, GAL - galactic).
72 78  
  79 +``proj <AIT|AZP|CAR|MER|MOL|STG|TAN> [string]``
  80 + Projection method.
  81 +
73 82 ``xref [real]``
74 83 Right Ascension / Galactic longitude of cube centre (J2000, in degrees).
75 84  
76 85 ``yref [real]``
77 86 Declination / Galactic latitude of cube centre (J2000, in degrees).
78 87  
79   -``proj <AIT|AZP|CAR|MER|MOL|STG|TAN> [string]``
80   - Projection method.
81   -
  88 +``nxpix [integer]``
  89 + Number of cube bins in Right Ascension or Galactic longitude.
  90 +
  91 +``nypix [integer]``
  92 + Number of cube bins in Declination or Galactic latitude.
  93 +
  94 +``binsz [real]``
  95 + Cube bin size (in degrees/pixel).
  96 +
82 97 ``(algorithm = SUBDIV) <SUB|SUBDIV|SUBDIVSQRT> [string]``
83 98 Algorithm used to generate the residual map.
84 99  
... ...
src/ctmodel/ctmodel.cpp
... ... @@ -284,7 +284,7 @@ void ctmodel::run(void)
284 284  
285 285 // Fill cube and leave loop if we are binned mode (meaning we
286 286 // only have one binned observation)
287   - if (m_binned && m_obs.size() == 1) {
  287 + if (m_binned) {
288 288 fill_cube(obs);
289 289 break;
290 290 }
... ... @@ -464,13 +464,16 @@ void ctmodel::get_parameters(void)
464 464 m_append_cube = false;
465 465  
466 466 // If there are no observations in container then load them via user
467   - // parameters
  467 + // parameters.
468 468 if (m_obs.size() == 0) {
469 469 get_obs();
470 470 }
471 471  
472   - // Check if we got excactly one binned CTA observation
473   - if (m_obs.size() == 1) {
  472 + // If we have now excactly one CTA observation (but no cube has yet been
  473 + // appended to the observation) then check whether this observation
  474 + // is a binned observation, and if yes, extract the counts cube for
  475 + // model generation
  476 + if ((m_obs.size() == 1) && (m_append_cube == false)) {
474 477  
475 478 // Get CTA observation
476 479 GCTAObservation* obs = dynamic_cast<GCTAObservation*>(m_obs[0]);
... ... @@ -498,7 +501,6 @@ void ctmodel::get_parameters(void)
498 501  
499 502 } // endif: had exactly one observation
500 503  
501   -
502 504 // Read model definition file if required
503 505 if (m_obs.models().size() == 0) {
504 506  
... ... @@ -513,7 +515,9 @@ void ctmodel::get_parameters(void)
513 515 // Get energy dispersion flag parameters
514 516 m_apply_edisp = (*this)["edisp"].boolean();
515 517  
516   - // Optionally get input counts cube for model cube definition
  518 + // If we do not have yet a counts cube for model computation then check
  519 + // whether we should read it from the "incube" parameter or whether we
  520 + // should create it from scratch using the task parameters
517 521 if (!m_has_cube) {
518 522  
519 523 // Read cube definition file
... ... @@ -544,18 +548,21 @@ void ctmodel::get_parameters(void)
544 548  
545 549 // Signal that cube has been set
546 550 m_has_cube = true;
547   - }
  551 +
  552 + } // endif: we had no cube yet
548 553  
549 554 // Read optionally output cube filenames
550 555 if (read_ahead()) {
551   - m_outcube = (*this)["outcube"].filename();
  556 + m_outcube = (*this)["outcube"].filename();
552 557 }
553 558  
554 559 // If cube should be appended to first observation then do that now.
555 560 // This is a kluge that makes sure that the cube is passed as part
556 561 // of the observation in case that a cube response is used. The kluge
557 562 // is needed because the GCTACubeSourceDiffuse::set method needs to
558   - // get the full event cube from the observation.
  563 + // get the full event cube from the observation. It is also at this
  564 + // step that the GTI, which may just be a dummy GTI when create_cube()
  565 + // has been used, will be set.
559 566 if (m_append_cube) {
560 567  
561 568 //TODO: Check that energy boundaries are compatible
... ... @@ -588,6 +595,11 @@ void ctmodel::get_parameters(void)
588 595 * If no file names are specified for the "expcube", "psfcube" or "bkgcube"
589 596 * parameters, the method reads the necessary parameters to build a CTA
590 597 * observation from scratch.
  598 + *
  599 + * The method sets m_append_cube = true and m_binned = true in case that
  600 + * a stacked observation is requested (as detected by the presence of the
  601 + * "expcube", "psfcube", and "bkgcube" parameters). In that case, it appended
  602 + * a dummy event cube to the observation.
591 603 ***************************************************************************/
592 604 void ctmodel::get_obs(void)
593 605 {
... ... @@ -620,7 +632,6 @@ void ctmodel::get_obs(void)
620 632  
621 633 // Create dummy sky map cube
622 634 GSkyMap map("CAR","GAL",0.0,0.0,1.0,1.0,1,1,ebounds.size());
623   - m_append_cube = true;
624 635  
625 636 // Create event cube
626 637 GCTAEventCube cube(map, ebounds, exposure.gti());
... ... @@ -633,6 +644,12 @@ void ctmodel::get_obs(void)
633 644 // Append observation to container
634 645 m_obs.append(cta);
635 646  
  647 + // Signal that we are in binned mode
  648 + m_binned = true;
  649 +
  650 + // Signal that we appended a cube
  651 + m_append_cube = true;
  652 +
636 653 } // endif: cube response information was available
637 654  
638 655 // ... otherwise build an observation from IRF response information
... ... @@ -646,7 +663,7 @@ void ctmodel::get_obs(void)
646 663  
647 664 // Append observation to container
648 665 m_obs.append(cta);
649   -
  666 +
650 667 }
651 668  
652 669 } // endif: filename was "NONE" or ""
... ...
src/support/ctool.cpp
... ... @@ -652,7 +652,7 @@ GCTAObservation ctool::create_cta_obs(void)
652 652 list.gti(gti);
653 653 list.ebounds(ebounds);
654 654  
655   - // Attach event list to CTA observation
  655 + // Attach empty event list to CTA observation
656 656 obs.events(list);
657 657  
658 658 // Set observation ontime, livetime and deadtime correction factor
... ...