Commit d063ccd141601b3d2af918ffceff2c002c00d817
1 parent
e634e79a
adjust interface of ctools to properly load binned response. Modified ctbkgcube accordingly
Showing
15 changed files
with
280 additions
and
316 deletions
pyext/ctbkgcube.i
| @@ -47,6 +47,7 @@ public: | @@ -47,6 +47,7 @@ public: | ||
| 47 | void clear(void); | 47 | void clear(void); |
| 48 | void run(void); | 48 | void run(void); |
| 49 | void save(void); | 49 | void save(void); |
| 50 | + const GCTACubeBackground& bgcube(void) const; | ||
| 50 | const GCTAEventCube& cube(void) const; | 51 | const GCTAEventCube& cube(void) const; |
| 51 | const GModels& models(void) const; | 52 | const GModels& models(void) const; |
| 52 | }; | 53 | }; |
scripts/cspull.py
| @@ -107,8 +107,8 @@ class cspull(ctools.cscript): | @@ -107,8 +107,8 @@ class cspull(ctools.cscript): | ||
| 107 | pars.append(gammalib.GApplicationPar("tmin","r","h","0.0","","","Start time (MET in s)")) | 107 | pars.append(gammalib.GApplicationPar("tmin","r","h","0.0","","","Start time (MET in s)")) |
| 108 | pars.append(gammalib.GApplicationPar("tmax","r","a","1800.0","","","Duration (in s)")) | 108 | pars.append(gammalib.GApplicationPar("tmax","r","a","1800.0","","","Duration (in s)")) |
| 109 | pars.append(gammalib.GApplicationPar("enumbins","i","a","0","","","Number of energy bins (0=unbinned)")) | 109 | pars.append(gammalib.GApplicationPar("enumbins","i","a","0","","","Number of energy bins (0=unbinned)")) |
| 110 | - pars.append(gammalib.GApplicationPar("npix","i","h","200","","","Number of pixels for binned")) | ||
| 111 | - pars.append(gammalib.GApplicationPar("binsz","r","h","0.05","","","Pixel size for binned (deg/pixel)")) | 110 | + pars.append(gammalib.GApplicationPar("npix","i","a","200","","","Number of pixels for binned")) |
| 111 | + pars.append(gammalib.GApplicationPar("binsz","r","a","0.05","","","Pixel size for binned (deg/pixel)")) | ||
| 112 | pars.append(gammalib.GApplicationPar("deadc","r","h","0.95","0","1","Deadtime correction factor")) | 112 | pars.append(gammalib.GApplicationPar("deadc","r","h","0.95","0","1","Deadtime correction factor")) |
| 113 | pars.append(gammalib.GApplicationPar("rad","r","h","5.0","0","180","Radius of ROI (deg)")) | 113 | pars.append(gammalib.GApplicationPar("rad","r","h","5.0","0","180","Radius of ROI (deg)")) |
| 114 | pars.append(gammalib.GApplicationPar("pattern","s","h","single","","","Observation pattern (single/four)")) | 114 | pars.append(gammalib.GApplicationPar("pattern","s","h","single","","","Observation pattern (single/four)")) |
| @@ -140,7 +140,7 @@ class cspull(ctools.cscript): | @@ -140,7 +140,7 @@ class cspull(ctools.cscript): | ||
| 140 | 140 | ||
| 141 | # Get number of energy bins | 141 | # Get number of energy bins |
| 142 | self.m_enumbins = self["enumbins"].integer() | 142 | self.m_enumbins = self["enumbins"].integer() |
| 143 | - | 143 | + |
| 144 | # Read parameters for binned if requested | 144 | # Read parameters for binned if requested |
| 145 | if not self.m_enumbins == 0: | 145 | if not self.m_enumbins == 0: |
| 146 | self.m_npix = self["npix"].integer() | 146 | self.m_npix = self["npix"].integer() |
src/ctbkgcube/ctbkgcube.cpp
| @@ -360,18 +360,28 @@ void ctbkgcube::run(void) | @@ -360,18 +360,28 @@ void ctbkgcube::run(void) | ||
| 360 | log << n_observations << std::endl; | 360 | log << n_observations << std::endl; |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | - // Create a background model for output background cube and append | 363 | + // Set cube background response |
| 364 | + m_background.set(m_bkgcube.map(), m_bkgcube.ebounds()); | ||
| 365 | + | ||
| 366 | + // Create a background model for the output background cube and append | ||
| 364 | // that model to the input model in place of the original | 367 | // that model to the input model in place of the original |
| 365 | - // background model | ||
| 366 | - GEnergies energies; | ||
| 367 | - for (int i = 0; i < m_bkgcube.ebins(); ++i) { | ||
| 368 | - energies.append(m_bkgcube.energy(i)); | ||
| 369 | - } | ||
| 370 | - GModelSpatialDiffuseCube spatial(m_bkgcube.map(), energies, 1.0); | ||
| 371 | - GModelSpectralPlaw spectral(1.0, 0.0, GEnergy(1.0, "TeV")); | ||
| 372 | - GCTAModelCubeBackground model(spatial, spectral); | ||
| 373 | - model.name("ctbkgcube default background model"); | ||
| 374 | - m_cube_model = m_outmdl.size(); // Store the slot number for save() | 368 | + // background models |
| 369 | + // Todo: We might think of creating the spectral model via user parameter | ||
| 370 | + GCTAModelCubeBackground model(GModelSpectralConst(1.0)); | ||
| 371 | + | ||
| 372 | + // Set model name | ||
| 373 | + model.name("BackgroundModel"); | ||
| 374 | + | ||
| 375 | + // Set model instrument | ||
| 376 | + // Todo: Account for possibility to have observations from different | ||
| 377 | + // IACTs in the same container | ||
| 378 | + model.instruments("CTA,HESS,MAGIC,VERITAS"); | ||
| 379 | + | ||
| 380 | + // Set model identifier to "0". This is coupled to ctbin, where the binned output | ||
| 381 | + // observation id is set to 0. | ||
| 382 | + model.ids("0"); | ||
| 383 | + | ||
| 384 | + // Append model to output container | ||
| 375 | m_outmdl.append(model); | 385 | m_outmdl.append(model); |
| 376 | 386 | ||
| 377 | // Log output model | 387 | // Log output model |
| @@ -399,47 +409,19 @@ void ctbkgcube::save(void) | @@ -399,47 +409,19 @@ void ctbkgcube::save(void) | ||
| 399 | log.header1("Save background cube"); | 409 | log.header1("Save background cube"); |
| 400 | } | 410 | } |
| 401 | 411 | ||
| 402 | - // Create energies container from energy boundaries | ||
| 403 | - GEnergies energies; | ||
| 404 | - for (int i = 0; i < m_ebounds.size(); ++i) { | ||
| 405 | - energies.append(m_ebounds.elogmean(i)); | ||
| 406 | - } | ||
| 407 | 412 | ||
| 408 | // Get output filenames | 413 | // Get output filenames |
| 409 | std::string outfile = (*this)["outcube"].filename(); | 414 | std::string outfile = (*this)["outcube"].filename(); |
| 410 | std::string outmodel = (*this)["outmodel"].filename(); | 415 | std::string outmodel = (*this)["outmodel"].filename(); |
| 411 | 416 | ||
| 412 | - // Create empty FITS file | ||
| 413 | - GFits fits; | ||
| 414 | - | ||
| 415 | - // Write background cube | ||
| 416 | - m_bkgcube.map().write(fits); | ||
| 417 | - | ||
| 418 | - // Write energies | ||
| 419 | - energies.write(fits); | ||
| 420 | - | ||
| 421 | - // Save FITS file | ||
| 422 | - fits.saveto(outfile, clobber()); | 417 | + // Save background cube |
| 418 | + m_background.save(outfile, clobber()); | ||
| 423 | 419 | ||
| 424 | // Write output models if filename is valid | 420 | // Write output models if filename is valid |
| 425 | if ((outmodel.length() > 0) && (gammalib::tolower(outmodel) != "none")) { | 421 | if ((outmodel.length() > 0) && (gammalib::tolower(outmodel) != "none")) { |
| 426 | 422 | ||
| 427 | - // Set filename of map cube. | ||
| 428 | - if (m_cube_model >= 0) { | ||
| 429 | - GCTAModelCubeBackground* model = | ||
| 430 | - dynamic_cast<GCTAModelCubeBackground*>(m_outmdl[m_cube_model]); | ||
| 431 | - if (model != NULL) { | ||
| 432 | - GModelSpatialDiffuseCube* spatial = | ||
| 433 | - dynamic_cast<GModelSpatialDiffuseCube*>(model->spatial()); | ||
| 434 | - if (spatial != NULL) { | ||
| 435 | - spatial->filename(outfile); | ||
| 436 | - } | ||
| 437 | - } | ||
| 438 | - } | ||
| 439 | - | ||
| 440 | - // Save output model container | 423 | + // Save output model for binned analyses |
| 441 | m_outmdl.save(outmodel); | 424 | m_outmdl.save(outmodel); |
| 442 | - | ||
| 443 | } | 425 | } |
| 444 | 426 | ||
| 445 | // Return | 427 | // Return |
| @@ -463,6 +445,7 @@ void ctbkgcube::init_members(void) | @@ -463,6 +445,7 @@ void ctbkgcube::init_members(void) | ||
| 463 | m_outmodel.clear(); | 445 | m_outmodel.clear(); |
| 464 | m_obs.clear(); | 446 | m_obs.clear(); |
| 465 | m_bkgcube.clear(); | 447 | m_bkgcube.clear(); |
| 448 | + m_background.clear(); | ||
| 466 | m_bkgmdl.clear(); | 449 | m_bkgmdl.clear(); |
| 467 | m_outmdl.clear(); | 450 | m_outmdl.clear(); |
| 468 | m_ebounds.clear(); | 451 | m_ebounds.clear(); |
| @@ -486,6 +469,7 @@ void ctbkgcube::copy_members(const ctbkgcube& app) | @@ -486,6 +469,7 @@ void ctbkgcube::copy_members(const ctbkgcube& app) | ||
| 486 | m_outcube = app.m_outcube; | 469 | m_outcube = app.m_outcube; |
| 487 | m_obs = app.m_obs; | 470 | m_obs = app.m_obs; |
| 488 | m_bkgcube = app.m_bkgcube; | 471 | m_bkgcube = app.m_bkgcube; |
| 472 | + m_background = app.m_background; | ||
| 489 | m_bkgmdl = app.m_bkgmdl; | 473 | m_bkgmdl = app.m_bkgmdl; |
| 490 | m_outmdl = app.m_outmdl; | 474 | m_outmdl = app.m_outmdl; |
| 491 | m_ebounds = app.m_ebounds; | 475 | m_ebounds = app.m_ebounds; |
| @@ -530,22 +514,6 @@ void ctbkgcube::get_parameters(void) | @@ -530,22 +514,6 @@ void ctbkgcube::get_parameters(void) | ||
| 530 | 514 | ||
| 531 | } // endif: there was no observation in the container | 515 | } // endif: there was no observation in the container |
| 532 | 516 | ||
| 533 | - | ||
| 534 | - // If there are no models associated with the observations then load now | ||
| 535 | - // the model definition from the XML file | ||
| 536 | - if (m_obs.models().size() == 0) { | ||
| 537 | - if ((*this)["inmodel"].is_undefined()) { | ||
| 538 | - std::string msg = "No model definition XML file specified. " | ||
| 539 | - "Please set the \"inmodel\" parameter to the " | ||
| 540 | - "XML file that contains the background model " | ||
| 541 | - "definition."; | ||
| 542 | - throw GException::invalid_value(G_GET_PARAMETERS, msg); | ||
| 543 | - } | ||
| 544 | - std::string inmodel = (*this)["inmodel"].filename(); | ||
| 545 | - GModels models(inmodel); | ||
| 546 | - m_obs.models(models); | ||
| 547 | - } | ||
| 548 | - | ||
| 549 | // Get the incube filename | 517 | // Get the incube filename |
| 550 | std::string incube = (*this)["incube"].filename(); | 518 | std::string incube = (*this)["incube"].filename(); |
| 551 | 519 | ||
| @@ -574,6 +542,21 @@ void ctbkgcube::get_parameters(void) | @@ -574,6 +542,21 @@ void ctbkgcube::get_parameters(void) | ||
| 574 | 542 | ||
| 575 | } // endelse: cube was loaded from file | 543 | } // endelse: cube was loaded from file |
| 576 | 544 | ||
| 545 | + // If there are no models associated with the observations then load now | ||
| 546 | + // the model definition from the XML file | ||
| 547 | + if (m_obs.models().size() == 0) { | ||
| 548 | + if ((*this)["inmodel"].is_undefined()) { | ||
| 549 | + std::string msg = "No model definition XML file specified. " | ||
| 550 | + "Please set the \"inmodel\" parameter to the " | ||
| 551 | + "XML file that contains the background model " | ||
| 552 | + "definition."; | ||
| 553 | + throw GException::invalid_value(G_GET_PARAMETERS, msg); | ||
| 554 | + } | ||
| 555 | + std::string inmodel = (*this)["inmodel"].filename(); | ||
| 556 | + GModels models(inmodel); | ||
| 557 | + m_obs.models(models); | ||
| 558 | + } | ||
| 559 | + | ||
| 577 | // Get energy definition | 560 | // Get energy definition |
| 578 | m_ebounds = m_bkgcube.ebounds(); | 561 | m_ebounds = m_bkgcube.ebounds(); |
| 579 | 562 |
src/ctbkgcube/ctbkgcube.hpp
| @@ -59,6 +59,7 @@ public: | @@ -59,6 +59,7 @@ public: | ||
| 59 | void clear(void); | 59 | void clear(void); |
| 60 | void run(void); | 60 | void run(void); |
| 61 | void save(void); | 61 | void save(void); |
| 62 | + const GCTACubeBackground& bgcube(void) const; | ||
| 62 | const GCTAEventCube& cube(void) const; | 63 | const GCTAEventCube& cube(void) const; |
| 63 | const GModels& models(void) const; | 64 | const GModels& models(void) const; |
| 64 | 65 | ||
| @@ -74,7 +75,8 @@ protected: | @@ -74,7 +75,8 @@ protected: | ||
| 74 | std::string m_outcube; //!< Filename of output cube | 75 | std::string m_outcube; //!< Filename of output cube |
| 75 | std::string m_outmodel; //!< Filename of output XML model | 76 | std::string m_outmodel; //!< Filename of output XML model |
| 76 | GObservations m_obs; //!< Observation container | 77 | GObservations m_obs; //!< Observation container |
| 77 | - GCTAEventCube m_bkgcube; //!< Background cube | 78 | + GCTAEventCube m_bkgcube; //!< Background event cube |
| 79 | + GCTACubeBackground m_background; //!< Background cube response | ||
| 78 | GModels m_bkgmdl; //!< CTA background models | 80 | GModels m_bkgmdl; //!< CTA background models |
| 79 | GModels m_outmdl; //!< Output models | 81 | GModels m_outmdl; //!< Output models |
| 80 | GEbounds m_ebounds; //!< Energy boundaries | 82 | GEbounds m_ebounds; //!< Energy boundaries |
| @@ -95,6 +97,19 @@ const GCTAEventCube& ctbkgcube::cube(void) const | @@ -95,6 +97,19 @@ const GCTAEventCube& ctbkgcube::cube(void) const | ||
| 95 | return (m_bkgcube); | 97 | return (m_bkgcube); |
| 96 | } | 98 | } |
| 97 | 99 | ||
| 100 | +/***********************************************************************//** | ||
| 101 | + * @brief Return background response cube containing background rate | ||
| 102 | + * | ||
| 103 | + * @return Background response cube. | ||
| 104 | + ***************************************************************************/ | ||
| 105 | +inline | ||
| 106 | +const GCTACubeBackground& ctbkgcube::bgcube(void) const | ||
| 107 | +{ | ||
| 108 | + // Return background cube | ||
| 109 | + return (m_background); | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | + | ||
| 98 | 113 | ||
| 99 | /***********************************************************************//** | 114 | /***********************************************************************//** |
| 100 | * @brief Return background model container | 115 | * @brief Return background model container |
src/ctbkgcube/ctbkgcube.par
| @@ -18,10 +18,10 @@ | @@ -18,10 +18,10 @@ | ||
| 18 | # Observational parameters | 18 | # Observational parameters |
| 19 | #=================== | 19 | #=================== |
| 20 | inobs, f, a, "NONE",,, "Input event list or observation definition file" | 20 | inobs, f, a, "NONE",,, "Input event list or observation definition file" |
| 21 | -inmodel, f, a, "NONE",,, "Input (background) model XML file" | 21 | +inmodel, f, a, "NONE",,, "Input model XML file" |
| 22 | incube, f, a, "NONE",,, "Counts cube for background cube definition" | 22 | incube, f, a, "NONE",,, "Counts cube for background cube definition" |
| 23 | outcube, f, a, "bkgcube.fits",,, "Output background cube file" | 23 | outcube, f, a, "bkgcube.fits",,, "Output background cube file" |
| 24 | -outmodel, f, a, "NONE",,, "Output (background) model XML file" | 24 | +outmodel, f, a, "NONE",,, "Output model XML file" |
| 25 | caldb, s, a, "dummy",,, "Calibration database" | 25 | caldb, s, a, "dummy",,, "Calibration database" |
| 26 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" | 26 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" |
| 27 | # | 27 | # |
src/ctbutterfly/ctbutterfly.par
| @@ -22,6 +22,7 @@ inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | @@ -22,6 +22,7 @@ inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | ||
| 22 | srcname, s, a, "Crab",,,"Source of interest" | 22 | srcname, s, a, "Crab",,,"Source of interest" |
| 23 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" | 23 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" |
| 24 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" | 24 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" |
| 25 | +bgcube, f, a, "NONE",,, "Background cube file (only needed for stacked analysis)" | ||
| 25 | caldb, s, a, "dummy",,, "Calibration database" | 26 | caldb, s, a, "dummy",,, "Calibration database" |
| 26 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" | 27 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" |
| 27 | outfile, f, a, "butterfly.txt",,, "Output ascii file" | 28 | outfile, f, a, "butterfly.txt",,, "Output ascii file" |
src/ctlike/ctlike.par
| @@ -21,6 +21,7 @@ inobs, f, a, "events.fits",,, "Event list, counts cube or observation definit | @@ -21,6 +21,7 @@ inobs, f, a, "events.fits",,, "Event list, counts cube or observation definit | ||
| 21 | inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | 21 | inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" |
| 22 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" | 22 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" |
| 23 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" | 23 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" |
| 24 | +bgcube, f, a, "NONE",,, "Background cube file (only needed for stacked analysis)" | ||
| 24 | caldb, s, a, "dummy",,, "Calibration database" | 25 | caldb, s, a, "dummy",,, "Calibration database" |
| 25 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" | 26 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" |
| 26 | outmodel, f, a, "crab_results.xml",,, "Source model output file" | 27 | outmodel, f, a, "crab_results.xml",,, "Source model output file" |
src/ctmodel/ctmodel.par
| @@ -27,6 +27,7 @@ edisp, b, h, no,,, "Apply energy dispersion?" | @@ -27,6 +27,7 @@ edisp, b, h, no,,, "Apply energy dispersion?" | ||
| 27 | inobs, f, a, "NONE",,, "Event list, counts cube or observation definition file" | 27 | inobs, f, a, "NONE",,, "Event list, counts cube or observation definition file" |
| 28 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" | 28 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" |
| 29 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" | 29 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" |
| 30 | +bgcube, f, a, "NONE",,, "Background cube file (only needed for stacked analysis)" | ||
| 30 | caldb, s, a, "dummy",,, "Calibration database" | 31 | caldb, s, a, "dummy",,, "Calibration database" |
| 31 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" | 32 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" |
| 32 | ra, r, a, 83.63,0,360, "RA of pointing (degrees)" | 33 | ra, r, a, 83.63,0,360, "RA of pointing (degrees)" |
src/cttsmap/cttsmap.par
| @@ -22,6 +22,7 @@ inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | @@ -22,6 +22,7 @@ inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | ||
| 22 | srcname, s, a, "Crab",,, "Test source" | 22 | srcname, s, a, "Crab",,, "Test source" |
| 23 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" | 23 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" |
| 24 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" | 24 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" |
| 25 | +bgcube, f, a, "NONE",,, "Background cube file (only needed for stacked analysis)" | ||
| 25 | caldb, s, a, "dummy",,, "Calibration database" | 26 | caldb, s, a, "dummy",,, "Calibration database" |
| 26 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" | 27 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" |
| 27 | outmap, f, a, "tsmap.fits",,, "Output Test Statistic map" | 28 | outmap, f, a, "tsmap.fits",,, "Output Test Statistic map" |
src/ctulimit/ctulimit.par
| @@ -22,6 +22,7 @@ inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | @@ -22,6 +22,7 @@ inmodel, f, a, "$CTOOLS/share/models/crab.xml",,, "Source model" | ||
| 22 | srcname, s, a, "Crab",,, "Source of interest" | 22 | srcname, s, a, "Crab",,, "Source of interest" |
| 23 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" | 23 | expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis)" |
| 24 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" | 24 | psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" |
| 25 | +bgcube, f, a, "NONE",,, "Background cube file (only needed for stacked analysis)" | ||
| 25 | caldb, s, a, "dummy",,, "Calibration database" | 26 | caldb, s, a, "dummy",,, "Calibration database" |
| 26 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" | 27 | irf, s, a, "cta_dummy_irf",,, "Instrument response function" |
| 27 | 28 |
src/support/ctool.cpp
| @@ -731,23 +731,26 @@ void ctool::set_obs_response(GCTAObservation* obs) | @@ -731,23 +731,26 @@ void ctool::set_obs_response(GCTAObservation* obs) | ||
| 731 | // If the observation contains a counts cube, then first check whether | 731 | // If the observation contains a counts cube, then first check whether |
| 732 | // the expcube and psfcube parameters exist and are not NONE | 732 | // the expcube and psfcube parameters exist and are not NONE |
| 733 | if (dynamic_cast<const GCTAEventCube*>(obs->events()) != NULL) { | 733 | if (dynamic_cast<const GCTAEventCube*>(obs->events()) != NULL) { |
| 734 | - if (has_par("expcube") && has_par("psfcube")) { | 734 | + if (has_par("expcube") && has_par("psfcube") && has_par("bgcube")) { |
| 735 | 735 | ||
| 736 | // Get filenames | 736 | // Get filenames |
| 737 | std::string expcube = (*this)["expcube"].filename(); | 737 | std::string expcube = (*this)["expcube"].filename(); |
| 738 | std::string psfcube = (*this)["psfcube"].filename(); | 738 | std::string psfcube = (*this)["psfcube"].filename(); |
| 739 | + std::string bgcube = (*this)["bgcube"].filename(); | ||
| 739 | 740 | ||
| 740 | // Extract response information if available | 741 | // Extract response information if available |
| 741 | - if ((expcube != "NONE") && (psfcube != "NONE") && | 742 | + if ((expcube != "NONE") && (psfcube != "NONE") && (bgcube != "NONE") && |
| 742 | (gammalib::strip_whitespace(expcube) != "") && | 743 | (gammalib::strip_whitespace(expcube) != "") && |
| 743 | - (gammalib::strip_whitespace(psfcube) != "")) { | 744 | + (gammalib::strip_whitespace(psfcube) != "") && |
| 745 | + (gammalib::strip_whitespace(bgcube) != "")) { | ||
| 744 | 746 | ||
| 745 | // Get exposure and PSF cubes | 747 | // Get exposure and PSF cubes |
| 746 | GCTACubeExposure exposure(expcube); | 748 | GCTACubeExposure exposure(expcube); |
| 747 | GCTACubePsf psf(psfcube); | 749 | GCTACubePsf psf(psfcube); |
| 750 | + GCTACubeBackground background(bgcube); | ||
| 748 | 751 | ||
| 749 | // Set reponse | 752 | // Set reponse |
| 750 | - obs->response(exposure, psf); | 753 | + obs->response(exposure, psf, background); |
| 751 | 754 | ||
| 752 | // Signal response availability | 755 | // Signal response availability |
| 753 | has_response = true; | 756 | has_response = true; |
test/data/model_background_cube_const.xml deleted
| 1 | -<?xml version="1.0" standalone="no"?> | ||
| 2 | -<source_library title="source library"> | ||
| 3 | - <source name="CTABackgroundModel" type="CTACubeBackground" instrument="CTA"> | ||
| 4 | - <spectrum type="ConstantValue"> | ||
| 5 | - <parameter name="Value" scale="1.0" min="0.01" max="1000.0" value="1.0" free="1"/> | ||
| 6 | - </spectrum> | ||
| 7 | - <spatialModel type="MapCubeFunction" file="data/test_cube.fits"> | ||
| 8 | - <parameter name="Normalization" scale="1" value="1" min="0.1" max="10" free="0"/> | ||
| 9 | - </spatialModel> | ||
| 10 | - </source> | ||
| 11 | -</source_library> |
test/data/model_background_cube.xml renamed to test/data/model_cube_background.xml
| @@ -6,8 +6,5 @@ | @@ -6,8 +6,5 @@ | ||
| 6 | <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/> | 6 | <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/> |
| 7 | <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/> | 7 | <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/> |
| 8 | </spectrum> | 8 | </spectrum> |
| 9 | - <spatialModel type="MapCubeFunction" file="data/test_cube.fits"> | ||
| 10 | - <parameter name="Normalization" scale="1" value="1" min="0.1" max="10" free="0"/> | ||
| 11 | - </spatialModel> | ||
| 12 | </source> | 9 | </source> |
| 13 | </source_library> | 10 | </source_library> |
test/data/test_cube.fits deleted
No preview for this file type
test/test_ctools.sh
| @@ -91,27 +91,6 @@ else | @@ -91,27 +91,6 @@ else | ||
| 91 | echo " events.fits file is not found" | 91 | echo " events.fits file is not found" |
| 92 | exit 1 | 92 | exit 1 |
| 93 | fi | 93 | fi |
| 94 | -# | ||
| 95 | -# Run 2 | ||
| 96 | -$ctobssim inmodel="data/model_background_cube.xml" \ | ||
| 97 | - outevents="events2.fits" \ | ||
| 98 | - caldb="irf" \ | ||
| 99 | - irf="cta_dummy_irf" \ | ||
| 100 | - ra=84.17263 \ | ||
| 101 | - dec=22.01444 \ | ||
| 102 | - rad=1.0 \ | ||
| 103 | - tmin=0.0 \ | ||
| 104 | - tmax=1.0 \ | ||
| 105 | - emin=0.3 \ | ||
| 106 | - emax=8.0 chatter=4 | ||
| 107 | -$ECHO -n "." | ||
| 108 | -if [ -s "events2.fits" ] | ||
| 109 | -then | ||
| 110 | - $ECHO -n "." | ||
| 111 | -else | ||
| 112 | - echo " events2.fits file is not found" | ||
| 113 | - exit 1 | ||
| 114 | -fi | ||
| 115 | $ECHO " ok" | 94 | $ECHO " ok" |
| 116 | 95 | ||
| 117 | 96 | ||
| @@ -148,7 +127,7 @@ $ECHO -n "Test ctbin: " | @@ -148,7 +127,7 @@ $ECHO -n "Test ctbin: " | ||
| 148 | # | 127 | # |
| 149 | # Run 1 | 128 | # Run 1 |
| 150 | $ctbin inobs="events.fits" \ | 129 | $ctbin inobs="events.fits" \ |
| 151 | - outcube="cntmap.fits" \ | 130 | + outcube="cntmap1.fits" \ |
| 152 | emin=0.1 \ | 131 | emin=0.1 \ |
| 153 | emax=100.0 \ | 132 | emax=100.0 \ |
| 154 | enumbins=20 \ | 133 | enumbins=20 \ |
| @@ -161,27 +140,27 @@ $ctbin inobs="events.fits" \ | @@ -161,27 +140,27 @@ $ctbin inobs="events.fits" \ | ||
| 161 | yref=22.01 \ | 140 | yref=22.01 \ |
| 162 | proj="CAR" | 141 | proj="CAR" |
| 163 | $ECHO -n "." | 142 | $ECHO -n "." |
| 164 | -if [ -s "cntmap.fits" ] | 143 | +if [ -s "cntmap1.fits" ] |
| 165 | then | 144 | then |
| 166 | $ECHO -n "." | 145 | $ECHO -n "." |
| 167 | else | 146 | else |
| 168 | - $ECHO " cntmap.fits file is not found" | 147 | + $ECHO " cntmap1.fits file is not found" |
| 169 | exit 1 | 148 | exit 1 |
| 170 | fi | 149 | fi |
| 171 | # | 150 | # |
| 172 | # Run 2 | 151 | # Run 2 |
| 173 | -$ctbin inobs="events2.fits" \ | 152 | +$ctbin inobs="events.fits" \ |
| 174 | outcube="cntmap2.fits" \ | 153 | outcube="cntmap2.fits" \ |
| 175 | emin=0.3 \ | 154 | emin=0.3 \ |
| 176 | emax=8.0 \ | 155 | emax=8.0 \ |
| 177 | - enumbins=10 \ | 156 | + enumbins=7 \ |
| 178 | ebinalg="LOG" \ | 157 | ebinalg="LOG" \ |
| 179 | - nxpix=50 \ | ||
| 180 | - nypix=50 \ | ||
| 181 | - binsz=0.02 \ | 158 | + nxpix=30 \ |
| 159 | + nypix=30 \ | ||
| 160 | + binsz=0.05 \ | ||
| 182 | coordsys="CEL" \ | 161 | coordsys="CEL" \ |
| 183 | - xref=84.17263 \ | ||
| 184 | - yref=22.01444 \ | 162 | + xref=86.63 \ |
| 163 | + yref=22.01 \ | ||
| 185 | proj="CAR" | 164 | proj="CAR" |
| 186 | $ECHO -n "." | 165 | $ECHO -n "." |
| 187 | if [ -s "cntmap2.fits" ] | 166 | if [ -s "cntmap2.fits" ] |
| @@ -193,6 +172,168 @@ else | @@ -193,6 +172,168 @@ else | ||
| 193 | fi | 172 | fi |
| 194 | $ECHO " ok" | 173 | $ECHO " ok" |
| 195 | 174 | ||
| 175 | +# | ||
| 176 | +# Test ctexpcube | ||
| 177 | +# ============== | ||
| 178 | +$ECHO -n "Test ctexpcube: " | ||
| 179 | +# | ||
| 180 | +# Run 1 | ||
| 181 | +$ctexpcube inobs="data/crab_events.fits" \ | ||
| 182 | +incube="NONE" \ | ||
| 183 | +outcube="expcube1.fits" \ | ||
| 184 | +caldb="irf" \ | ||
| 185 | +irf="cta_dummy_irf" \ | ||
| 186 | +emin=0.1 \ | ||
| 187 | +emax=100.0 \ | ||
| 188 | +enumbins=20 \ | ||
| 189 | +nxpix=200 \ | ||
| 190 | +nypix=200 \ | ||
| 191 | +binsz=0.02 \ | ||
| 192 | +coordsys="CEL" \ | ||
| 193 | +xref=83.63 \ | ||
| 194 | +yref=22.01 \ | ||
| 195 | +proj="CAR" | ||
| 196 | +$ECHO -n "." | ||
| 197 | +if [ -s "expcube1.fits" ] | ||
| 198 | +then | ||
| 199 | +$ECHO -n "." | ||
| 200 | +else | ||
| 201 | +$ECHO " expcube1.fits file is not found" | ||
| 202 | +exit 1 | ||
| 203 | +fi | ||
| 204 | +# | ||
| 205 | +# Run 2 | ||
| 206 | +$ctexpcube inobs="events.fits" \ | ||
| 207 | +incube="cntmap2.fits" \ | ||
| 208 | +outcube="expcube2.fits" \ | ||
| 209 | +caldb="irf" \ | ||
| 210 | +irf="cta_dummy_irf" | ||
| 211 | +$ECHO -n "." | ||
| 212 | +if [ -s "expcube2.fits" ] | ||
| 213 | +then | ||
| 214 | +$ECHO -n "." | ||
| 215 | +else | ||
| 216 | +$ECHO " expcube2.fits file is not found" | ||
| 217 | +exit 1 | ||
| 218 | +fi | ||
| 219 | +$ECHO " ok" | ||
| 220 | + | ||
| 221 | + | ||
| 222 | +# | ||
| 223 | +# Test ctpsfcube | ||
| 224 | +# ============== | ||
| 225 | +$ECHO -n "Test ctpsfcube: " | ||
| 226 | +# | ||
| 227 | +# Run 1 | ||
| 228 | +$ctpsfcube inobs="data/crab_events.fits" \ | ||
| 229 | +incube="NONE" \ | ||
| 230 | +outcube="psfcube1.fits" \ | ||
| 231 | +caldb="irf" \ | ||
| 232 | +irf="cta_dummy_irf" \ | ||
| 233 | +emin=0.1 \ | ||
| 234 | +emax=100.0 \ | ||
| 235 | +enumbins=20 \ | ||
| 236 | +nxpix=10 \ | ||
| 237 | +nypix=10 \ | ||
| 238 | +binsz=0.4 \ | ||
| 239 | +coordsys="CEL" \ | ||
| 240 | +xref=83.63 \ | ||
| 241 | +yref=22.01 \ | ||
| 242 | +proj="CAR" \ | ||
| 243 | +amax=0.3 \ | ||
| 244 | +anumbins=10 | ||
| 245 | +$ECHO -n "." | ||
| 246 | +if [ -s "psfcube1.fits" ] | ||
| 247 | +then | ||
| 248 | +$ECHO -n "." | ||
| 249 | +else | ||
| 250 | +$ECHO " psfcube1.fits file is not found" | ||
| 251 | +exit 1 | ||
| 252 | +fi | ||
| 253 | +# | ||
| 254 | +# Run 2 | ||
| 255 | +$ctpsfcube inobs="events.fits" \ | ||
| 256 | +incube="cntmap2.fits" \ | ||
| 257 | +outcube="psfcube2.fits" \ | ||
| 258 | +caldb="irf" \ | ||
| 259 | +irf="cta_dummy_irf" \ | ||
| 260 | +amax=0.3 \ | ||
| 261 | +anumbins=2 | ||
| 262 | +$ECHO -n "." | ||
| 263 | +if [ -s "psfcube2.fits" ] | ||
| 264 | +then | ||
| 265 | +$ECHO -n "." | ||
| 266 | +else | ||
| 267 | +$ECHO " psfcube2.fits file is not found" | ||
| 268 | +exit 1 | ||
| 269 | +fi | ||
| 270 | +$ECHO " ok" | ||
| 271 | + | ||
| 272 | + | ||
| 273 | +# | ||
| 274 | +# Test ctbkgcube | ||
| 275 | +# ============== | ||
| 276 | +$ECHO -n "Test ctbkgcube: " | ||
| 277 | +# | ||
| 278 | +# Run 1 | ||
| 279 | +$ctbkgcube inobs="data/crab_events.fits" \ | ||
| 280 | +inmodel="data/crab.xml" \ | ||
| 281 | +incube="NONE" \ | ||
| 282 | +outcube="bkgcube1.fits" \ | ||
| 283 | +outmodel="bkgcube1.xml" \ | ||
| 284 | +caldb="irf" \ | ||
| 285 | +irf="cta_dummy_irf" \ | ||
| 286 | +emin=0.1 \ | ||
| 287 | +emax=100.0 \ | ||
| 288 | +enumbins=20 \ | ||
| 289 | +nxpix=10 \ | ||
| 290 | +nypix=10 \ | ||
| 291 | +binsz=0.4 \ | ||
| 292 | +coordsys="CEL" \ | ||
| 293 | +xref=83.63 \ | ||
| 294 | +yref=22.01 \ | ||
| 295 | +proj="CAR" | ||
| 296 | +$ECHO -n "." | ||
| 297 | +if [ -s "bkgcube1.fits" ] | ||
| 298 | +then | ||
| 299 | +$ECHO -n "." | ||
| 300 | +else | ||
| 301 | +$ECHO " bkgcube1.fits file is not found" | ||
| 302 | +exit 1 | ||
| 303 | +fi | ||
| 304 | +if [ -s "bkgcube1.xml" ] | ||
| 305 | +then | ||
| 306 | +$ECHO -n "." | ||
| 307 | +else | ||
| 308 | +$ECHO " bkgcube1.xml file is not found" | ||
| 309 | +exit 1 | ||
| 310 | +fi | ||
| 311 | +# | ||
| 312 | +# Run 2 | ||
| 313 | +$ctbkgcube inobs="events.fits" \ | ||
| 314 | +inmodel="data/crab.xml" \ | ||
| 315 | +incube="cntmap2.fits" \ | ||
| 316 | +caldb="irf" \ | ||
| 317 | +irf="cta_dummy_irf" \ | ||
| 318 | +outcube="bkgcube2.fits" \ | ||
| 319 | +outmodel="bkgcube2.xml" | ||
| 320 | +$ECHO -n "." | ||
| 321 | +if [ -s "bkgcube2.fits" ] | ||
| 322 | +then | ||
| 323 | +$ECHO -n "." | ||
| 324 | +else | ||
| 325 | +$ECHO " bkgcube2.fits file is not found" | ||
| 326 | +exit 1 | ||
| 327 | +fi | ||
| 328 | +if [ -s "bkgcube2.fits" ] | ||
| 329 | +then | ||
| 330 | +$ECHO -n "." | ||
| 331 | +else | ||
| 332 | +$ECHO " bkgcube2.xml file is not found" | ||
| 333 | +exit 1 | ||
| 334 | +fi | ||
| 335 | +$ECHO " ok" | ||
| 336 | + | ||
| 196 | 337 | ||
| 197 | 338 | ||
| 198 | # | 339 | # |
| @@ -201,11 +342,12 @@ $ECHO " ok" | @@ -201,11 +342,12 @@ $ECHO " ok" | ||
| 201 | $ECHO -n "Test ctmodel: " | 342 | $ECHO -n "Test ctmodel: " |
| 202 | # | 343 | # |
| 203 | # Run 1 | 344 | # Run 1 |
| 204 | -$ctmodel inobs="cntmap.fits" \ | ||
| 205 | - incube="cntmap.fits" \ | 345 | +$ctmodel inobs="cntmap1.fits" \ |
| 346 | + incube="cntmap1.fits" \ | ||
| 206 | outcube="modmap1.fits" \ | 347 | outcube="modmap1.fits" \ |
| 207 | expcube="NONE" \ | 348 | expcube="NONE" \ |
| 208 | psfcube="NONE" \ | 349 | psfcube="NONE" \ |
| 350 | + bgcube="NONE" \ | ||
| 209 | caldb="irf" \ | 351 | caldb="irf" \ |
| 210 | irf="cta_dummy_irf" \ | 352 | irf="cta_dummy_irf" \ |
| 211 | inmodel="data/crab.xml" | 353 | inmodel="data/crab.xml" |
| @@ -218,6 +360,26 @@ else | @@ -218,6 +360,26 @@ else | ||
| 218 | exit 1 | 360 | exit 1 |
| 219 | fi | 361 | fi |
| 220 | # | 362 | # |
| 363 | +# Run 2 | ||
| 364 | +$ctmodel inobs="cntmap2.fits" \ | ||
| 365 | +incube="cntmap2.fits" \ | ||
| 366 | +outcube="modmap2.fits" \ | ||
| 367 | +expcube="expcube2.fits" \ | ||
| 368 | +psfcube="psfcube2.fits" \ | ||
| 369 | +bgcube="bkgcube2.fits" \ | ||
| 370 | +caldb="irf" \ | ||
| 371 | +irf="cta_dummy_irf" \ | ||
| 372 | +inmodel="bkgcube2.xml" | ||
| 373 | +$ECHO -n "." | ||
| 374 | +if [ -s "modmap2.fits" ] | ||
| 375 | +then | ||
| 376 | +$ECHO -n "." | ||
| 377 | +else | ||
| 378 | +$ECHO " modmap2.fits file is not found" | ||
| 379 | +exit 1 | ||
| 380 | +fi | ||
| 381 | + | ||
| 382 | +# | ||
| 221 | # Run 3 | 383 | # Run 3 |
| 222 | $ctmodel inobs="NONE" \ | 384 | $ctmodel inobs="NONE" \ |
| 223 | incube="NONE" \ | 385 | incube="NONE" \ |
| @@ -248,24 +410,6 @@ else | @@ -248,24 +410,6 @@ else | ||
| 248 | $ECHO " modmap3.fits file is not found" | 410 | $ECHO " modmap3.fits file is not found" |
| 249 | exit 1 | 411 | exit 1 |
| 250 | fi | 412 | fi |
| 251 | -# | ||
| 252 | -# Run 2 | ||
| 253 | -$ctmodel inobs="cntmap2.fits" \ | ||
| 254 | - incube="cntmap2.fits" \ | ||
| 255 | - outcube="modmap2.fits" \ | ||
| 256 | - expcube="NONE" \ | ||
| 257 | - psfcube="NONE" \ | ||
| 258 | - caldb="irf" \ | ||
| 259 | - irf="cta_dummy_irf" \ | ||
| 260 | - inmodel="data/model_background_cube.xml" | ||
| 261 | -$ECHO -n "." | ||
| 262 | -if [ -s "modmap2.fits" ] | ||
| 263 | -then | ||
| 264 | - $ECHO -n "." | ||
| 265 | -else | ||
| 266 | - $ECHO " modmap2.fits file is not found" | ||
| 267 | - exit 1 | ||
| 268 | -fi | ||
| 269 | $ECHO " ok" | 413 | $ECHO " ok" |
| 270 | 414 | ||
| 271 | 415 | ||
| @@ -299,11 +443,12 @@ $ECHO " ok" | @@ -299,11 +443,12 @@ $ECHO " ok" | ||
| 299 | $ECHO -n "Test ctlike: " | 443 | $ECHO -n "Test ctlike: " |
| 300 | # | 444 | # |
| 301 | # Run 1 | 445 | # Run 1 |
| 302 | -$ctlike inobs="cntmap.fits" \ | 446 | +$ctlike inobs="cntmap1.fits" \ |
| 303 | inmodel="data/crab.xml" \ | 447 | inmodel="data/crab.xml" \ |
| 304 | outmodel="results_binned.xml" \ | 448 | outmodel="results_binned.xml" \ |
| 305 | expcube="NONE" \ | 449 | expcube="NONE" \ |
| 306 | psfcube="NONE" \ | 450 | psfcube="NONE" \ |
| 451 | + bgcube="NONE" \ | ||
| 307 | caldb="irf" \ | 452 | caldb="irf" \ |
| 308 | irf="cta_dummy_irf" | 453 | irf="cta_dummy_irf" |
| 309 | $ECHO -n "." | 454 | $ECHO -n "." |
| @@ -329,36 +474,23 @@ else | @@ -329,36 +474,23 @@ else | ||
| 329 | $ECHO " results_unbinned.xml file is not found" | 474 | $ECHO " results_unbinned.xml file is not found" |
| 330 | exit 1 | 475 | exit 1 |
| 331 | fi | 476 | fi |
| 477 | + | ||
| 332 | # | 478 | # |
| 333 | # Run 3 | 479 | # Run 3 |
| 334 | -$ctlike inobs="events2.fits" \ | ||
| 335 | - inmodel="data/model_background_cube.xml" \ | ||
| 336 | - outmodel="results_unbinned_background_cube.xml" \ | ||
| 337 | - caldb="irf" \ | ||
| 338 | - irf="cta_dummy_irf" | ||
| 339 | -$ECHO -n "." | ||
| 340 | -if [ -s "results_unbinned_background_cube.xml" ] | ||
| 341 | -then | ||
| 342 | - $ECHO -n "." | ||
| 343 | -else | ||
| 344 | - $ECHO " results_unbinned_background_cube.xml file is not found" | ||
| 345 | - exit 1 | ||
| 346 | -fi | ||
| 347 | -# | ||
| 348 | -# Run 4 | ||
| 349 | $ctlike inobs="cntmap2.fits" \ | 480 | $ctlike inobs="cntmap2.fits" \ |
| 350 | - inmodel="data/model_background_cube.xml" \ | ||
| 351 | - outmodel="results_binned_background_cube.xml" \ | ||
| 352 | - expcube="NONE" \ | ||
| 353 | - psfcube="NONE" \ | 481 | + inmodel="bkgcube2.xml" \ |
| 482 | + outmodel="results_binned_cube_background.xml" \ | ||
| 483 | + expcube="expcube2.fits" \ | ||
| 484 | + psfcube="psfcube2.fits" \ | ||
| 485 | + bgcube="bkgcube2.fits" \ | ||
| 354 | caldb="irf" \ | 486 | caldb="irf" \ |
| 355 | irf="cta_dummy_irf" | 487 | irf="cta_dummy_irf" |
| 356 | $ECHO -n "." | 488 | $ECHO -n "." |
| 357 | -if [ -s "results_binned_background_cube.xml" ] | 489 | +if [ -s "results_binned_cube_background.xml" ] |
| 358 | then | 490 | then |
| 359 | $ECHO -n "." | 491 | $ECHO -n "." |
| 360 | else | 492 | else |
| 361 | - $ECHO " results_binned_background_cube.xml file is not found" | 493 | + $ECHO " results_binned_cube_background.xml file is not found" |
| 362 | exit 1 | 494 | exit 1 |
| 363 | fi | 495 | fi |
| 364 | $ECHO " ok" | 496 | $ECHO " ok" |
| @@ -392,167 +524,6 @@ fi | @@ -392,167 +524,6 @@ fi | ||
| 392 | $ECHO " ok" | 524 | $ECHO " ok" |
| 393 | 525 | ||
| 394 | 526 | ||
| 395 | -# | ||
| 396 | -# Test ctexpcube | ||
| 397 | -# ============== | ||
| 398 | -$ECHO -n "Test ctexpcube: " | ||
| 399 | -# | ||
| 400 | -# Run 1 | ||
| 401 | -$ctexpcube inobs="data/crab_events.fits" \ | ||
| 402 | - incube="NONE" \ | ||
| 403 | - outcube="expcube1.fits" \ | ||
| 404 | - caldb="irf" \ | ||
| 405 | - irf="cta_dummy_irf" \ | ||
| 406 | - emin=0.1 \ | ||
| 407 | - emax=100.0 \ | ||
| 408 | - enumbins=20 \ | ||
| 409 | - nxpix=200 \ | ||
| 410 | - nypix=200 \ | ||
| 411 | - binsz=0.02 \ | ||
| 412 | - coordsys="CEL" \ | ||
| 413 | - xref=83.63 \ | ||
| 414 | - yref=22.01 \ | ||
| 415 | - proj="CAR" | ||
| 416 | -$ECHO -n "." | ||
| 417 | -if [ -s "expcube1.fits" ] | ||
| 418 | -then | ||
| 419 | - $ECHO -n "." | ||
| 420 | -else | ||
| 421 | - $ECHO " expcube1.fits file is not found" | ||
| 422 | - exit 1 | ||
| 423 | -fi | ||
| 424 | -# | ||
| 425 | -# Run 2 | ||
| 426 | -$ctexpcube inobs="data/crab_events.fits" \ | ||
| 427 | - incube="data/crab_cntmap.fits" \ | ||
| 428 | - outcube="expcube2.fits" \ | ||
| 429 | - caldb="irf" \ | ||
| 430 | - irf="cta_dummy_irf" | ||
| 431 | -$ECHO -n "." | ||
| 432 | -if [ -s "expcube2.fits" ] | ||
| 433 | -then | ||
| 434 | - $ECHO -n "." | ||
| 435 | -else | ||
| 436 | - $ECHO " expcube2.fits file is not found" | ||
| 437 | - exit 1 | ||
| 438 | -fi | ||
| 439 | -$ECHO " ok" | ||
| 440 | - | ||
| 441 | - | ||
| 442 | -# | ||
| 443 | -# Test ctpsfcube | ||
| 444 | -# ============== | ||
| 445 | -$ECHO -n "Test ctpsfcube: " | ||
| 446 | -# | ||
| 447 | -# Run 1 | ||
| 448 | -$ctpsfcube inobs="data/crab_events.fits" \ | ||
| 449 | - incube="NONE" \ | ||
| 450 | - outcube="psfcube1.fits" \ | ||
| 451 | - caldb="irf" \ | ||
| 452 | - irf="cta_dummy_irf" \ | ||
| 453 | - emin=0.1 \ | ||
| 454 | - emax=100.0 \ | ||
| 455 | - enumbins=20 \ | ||
| 456 | - nxpix=10 \ | ||
| 457 | - nypix=10 \ | ||
| 458 | - binsz=0.4 \ | ||
| 459 | - coordsys="CEL" \ | ||
| 460 | - xref=83.63 \ | ||
| 461 | - yref=22.01 \ | ||
| 462 | - proj="CAR" \ | ||
| 463 | - amax=0.3 \ | ||
| 464 | - anumbins=10 | ||
| 465 | -$ECHO -n "." | ||
| 466 | -if [ -s "psfcube1.fits" ] | ||
| 467 | -then | ||
| 468 | - $ECHO -n "." | ||
| 469 | -else | ||
| 470 | - $ECHO " psfcube1.fits file is not found" | ||
| 471 | - exit 1 | ||
| 472 | -fi | ||
| 473 | -# | ||
| 474 | -# Run 2 | ||
| 475 | -$ctpsfcube inobs="data/crab_events.fits" \ | ||
| 476 | - incube="data/crab_cntmap.fits" \ | ||
| 477 | - outcube="psfcube2.fits" \ | ||
| 478 | - caldb="irf" \ | ||
| 479 | - irf="cta_dummy_irf" \ | ||
| 480 | - amax=0.3 \ | ||
| 481 | - anumbins=2 | ||
| 482 | -$ECHO -n "." | ||
| 483 | -if [ -s "psfcube2.fits" ] | ||
| 484 | -then | ||
| 485 | - $ECHO -n "." | ||
| 486 | -else | ||
| 487 | - $ECHO " psfcube2.fits file is not found" | ||
| 488 | - exit 1 | ||
| 489 | -fi | ||
| 490 | -$ECHO " ok" | ||
| 491 | - | ||
| 492 | - | ||
| 493 | -# | ||
| 494 | -# Test ctbkgcube | ||
| 495 | -# ============== | ||
| 496 | -$ECHO -n "Test ctbkgcube: " | ||
| 497 | -# | ||
| 498 | -# Run 1 | ||
| 499 | -$ctbkgcube inobs="data/crab_events.fits" \ | ||
| 500 | - inmodel="data/crab.xml" \ | ||
| 501 | - incube="NONE" \ | ||
| 502 | - outcube="bkgcube1.fits" \ | ||
| 503 | - outmodel="bkgcube1.xml" \ | ||
| 504 | - caldb="irf" \ | ||
| 505 | - irf="cta_dummy_irf" \ | ||
| 506 | - emin=0.1 \ | ||
| 507 | - emax=100.0 \ | ||
| 508 | - enumbins=20 \ | ||
| 509 | - nxpix=10 \ | ||
| 510 | - nypix=10 \ | ||
| 511 | - binsz=0.4 \ | ||
| 512 | - coordsys="CEL" \ | ||
| 513 | - xref=83.63 \ | ||
| 514 | - yref=22.01 \ | ||
| 515 | - proj="CAR" | ||
| 516 | -$ECHO -n "." | ||
| 517 | -if [ -s "bkgcube1.fits" ] | ||
| 518 | -then | ||
| 519 | - $ECHO -n "." | ||
| 520 | -else | ||
| 521 | - $ECHO " bkgcube1.fits file is not found" | ||
| 522 | - exit 1 | ||
| 523 | -fi | ||
| 524 | -if [ -s "bkgcube1.xml" ] | ||
| 525 | -then | ||
| 526 | - $ECHO -n "." | ||
| 527 | -else | ||
| 528 | - $ECHO " bkgcube1.xml file is not found" | ||
| 529 | - exit 1 | ||
| 530 | -fi | ||
| 531 | -# | ||
| 532 | -# Run 2 | ||
| 533 | -$ctbkgcube inobs="data/crab_events.fits" \ | ||
| 534 | - inmodel="data/crab.xml" \ | ||
| 535 | - incube="data/crab_cntmap.fits" \ | ||
| 536 | - caldb="irf" \ | ||
| 537 | - irf="cta_dummy_irf" \ | ||
| 538 | - outcube="bkgcube2.fits" \ | ||
| 539 | - outmodel="bkgcube2.xml" | ||
| 540 | -$ECHO -n "." | ||
| 541 | -if [ -s "bkgcube2.fits" ] | ||
| 542 | -then | ||
| 543 | - $ECHO -n "." | ||
| 544 | -else | ||
| 545 | - $ECHO " bkgcube2.fits file is not found" | ||
| 546 | - exit 1 | ||
| 547 | -fi | ||
| 548 | -if [ -s "bkgcube2.fits" ] | ||
| 549 | -then | ||
| 550 | - $ECHO -n "." | ||
| 551 | -else | ||
| 552 | - $ECHO " bkgcube2.xml file is not found" | ||
| 553 | - exit 1 | ||
| 554 | -fi | ||
| 555 | -$ECHO " ok" | ||
| 556 | 527 | ||
| 557 | 528 | ||
| 558 | # | 529 | # |