Commit 5d076b36ab98ae5a919be70d98d3e57ace7120c7
1 parent
2a1a89e1
changed to
Showing
3 changed files
with
35 additions
and
35 deletions
inst/cta/include/GCTAResponseIrf.hpp
| ... | ... | @@ -217,13 +217,13 @@ private: |
| 217 | 217 | std::string m_xml_caldb; //!< Calibration database string in XML file |
| 218 | 218 | std::string m_xml_rspname; //!< Response name in XML file |
| 219 | 219 | std::string m_xml_aeff; //!< Aeff file name in XML file |
| 220 | - std::string m_xml_aeff_hdu; //!< Aeff HDU name in FITS file | |
| 220 | + std::string m_xml_aeff_extname; //!< Aeff HDU name in FITS file | |
| 221 | 221 | std::string m_xml_psf; //!< PSF file name in XML file |
| 222 | - std::string m_xml_psf_hdu; //!< PSF HDU name in FITS file | |
| 222 | + std::string m_xml_psf_extname; //!< PSF HDU name in FITS file | |
| 223 | 223 | std::string m_xml_edisp; //!< Edisp file name in XML file |
| 224 | - std::string m_xml_edisp_hdu; //!< Edisp HDU name in FITS file | |
| 224 | + std::string m_xml_edisp_extname; //!< Edisp HDU name in FITS file | |
| 225 | 225 | std::string m_xml_background; //!< Background file name in XML file |
| 226 | - std::string m_xml_background_hdu; //!< Background HDU name in FITS file | |
| 226 | + std::string m_xml_background_extname; //!< Background HDU name in FITS file | |
| 227 | 227 | |
| 228 | 228 | // Npred cache |
| 229 | 229 | mutable std::vector<std::string> m_npred_names; //!< Model names | ... | ... |
inst/cta/src/GCTAResponseIrf.cpp
| ... | ... | @@ -768,13 +768,13 @@ void GCTAResponseIrf::read(const GXmlElement& xml) |
| 768 | 768 | // If filename is not empty then load effective area |
| 769 | 769 | if (!m_xml_aeff.empty()) { |
| 770 | 770 | |
| 771 | - if (par->has_attribute("hdu")) { | |
| 771 | + if (par->has_attribute("extname")) { | |
| 772 | 772 | |
| 773 | 773 | // Store HDU name |
| 774 | - m_xml_aeff_hdu = par->attribute("hdu"); | |
| 774 | + m_xml_aeff_extname = par->attribute("extname"); | |
| 775 | 775 | |
| 776 | 776 | // Load effective area with extension attribute |
| 777 | - load_aeff(m_xml_aeff, m_xml_aeff_hdu); | |
| 777 | + load_aeff(m_xml_aeff, m_xml_aeff_extname); | |
| 778 | 778 | } |
| 779 | 779 | else { |
| 780 | 780 | |
| ... | ... | @@ -832,13 +832,13 @@ void GCTAResponseIrf::read(const GXmlElement& xml) |
| 832 | 832 | // If filename is not empty then load point spread function |
| 833 | 833 | if (!m_xml_psf.empty()) { |
| 834 | 834 | |
| 835 | - if (par->has_attribute("hdu")) { | |
| 835 | + if (par->has_attribute("extname")) { | |
| 836 | 836 | |
| 837 | 837 | // Store hdu name |
| 838 | - m_xml_psf_hdu = par->attribute("hdu"); | |
| 838 | + m_xml_psf_extname = par->attribute("extname"); | |
| 839 | 839 | |
| 840 | 840 | // Load PSF with extension attribute |
| 841 | - load_psf(m_xml_psf, m_xml_psf_hdu); | |
| 841 | + load_psf(m_xml_psf, m_xml_psf_extname); | |
| 842 | 842 | } |
| 843 | 843 | else { |
| 844 | 844 | |
| ... | ... | @@ -861,13 +861,13 @@ void GCTAResponseIrf::read(const GXmlElement& xml) |
| 861 | 861 | // If filename is not empty then load energy dispersion |
| 862 | 862 | if (!m_xml_edisp.empty()) { |
| 863 | 863 | |
| 864 | - if (par->has_attribute("hdu")) { | |
| 864 | + if (par->has_attribute("extname")) { | |
| 865 | 865 | |
| 866 | 866 | // Store hdu name |
| 867 | - m_xml_edisp_hdu = par->attribute("hdu"); | |
| 867 | + m_xml_edisp_extname = par->attribute("extname"); | |
| 868 | 868 | |
| 869 | 869 | // Load energy dispersion with extension attribute |
| 870 | - load_edisp(m_xml_edisp, m_xml_edisp_hdu); | |
| 870 | + load_edisp(m_xml_edisp, m_xml_edisp_extname); | |
| 871 | 871 | } |
| 872 | 872 | else { |
| 873 | 873 | |
| ... | ... | @@ -889,13 +889,13 @@ void GCTAResponseIrf::read(const GXmlElement& xml) |
| 889 | 889 | |
| 890 | 890 | // If filename is not empty then load background model |
| 891 | 891 | if (!m_xml_background.empty()) { |
| 892 | - if (par->has_attribute("hdu")) { | |
| 892 | + if (par->has_attribute("extname")) { | |
| 893 | 893 | |
| 894 | 894 | // Store hdu name |
| 895 | - m_xml_background_hdu = par->attribute("hdu"); | |
| 895 | + m_xml_background_extname = par->attribute("extname"); | |
| 896 | 896 | |
| 897 | 897 | // Load background with extension attribute |
| 898 | - load_background(m_xml_background, m_xml_background_hdu); | |
| 898 | + load_background(m_xml_background, m_xml_background_extname); | |
| 899 | 899 | } |
| 900 | 900 | else { |
| 901 | 901 | |
| ... | ... | @@ -1004,8 +1004,8 @@ void GCTAResponseIrf::write(GXmlElement& xml) const |
| 1004 | 1004 | |
| 1005 | 1005 | // Set attributes |
| 1006 | 1006 | par->attribute("file", m_xml_aeff); |
| 1007 | - if (!(m_xml_aeff_hdu.empty())) { | |
| 1008 | - par->attribute("hdu", m_xml_aeff_hdu); | |
| 1007 | + if (!(m_xml_aeff_extname.empty())) { | |
| 1008 | + par->attribute("hdu", m_xml_aeff_extname); | |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | 1011 | if (thetacut > 0.0) { |
| ... | ... | @@ -1026,8 +1026,8 @@ void GCTAResponseIrf::write(GXmlElement& xml) const |
| 1026 | 1026 | if (!(m_xml_psf.empty())) { |
| 1027 | 1027 | GXmlElement* par = gammalib::xml_need_par(G_WRITE, xml, "PointSpreadFunction"); |
| 1028 | 1028 | par->attribute("file", m_xml_psf); |
| 1029 | - if (!m_xml_psf_hdu.empty()) { | |
| 1030 | - par->attribute("hdu", m_xml_psf_hdu); | |
| 1029 | + if (!m_xml_psf_extname.empty()) { | |
| 1030 | + par->attribute("hdu", m_xml_psf_extname); | |
| 1031 | 1031 | } |
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| ... | ... | @@ -1037,8 +1037,8 @@ void GCTAResponseIrf::write(GXmlElement& xml) const |
| 1037 | 1037 | if (!(m_xml_edisp.empty())) { |
| 1038 | 1038 | GXmlElement* par = gammalib::xml_need_par(G_WRITE, xml, "EnergyDispersion"); |
| 1039 | 1039 | par->attribute("file", m_xml_edisp); |
| 1040 | - if (!m_xml_edisp_hdu.empty()) { | |
| 1041 | - par->attribute("hdu", m_xml_edisp_hdu); | |
| 1040 | + if (!m_xml_edisp_extname.empty()) { | |
| 1041 | + par->attribute("hdu", m_xml_edisp_extname); | |
| 1042 | 1042 | } |
| 1043 | 1043 | } |
| 1044 | 1044 | } |
| ... | ... | @@ -1048,8 +1048,8 @@ void GCTAResponseIrf::write(GXmlElement& xml) const |
| 1048 | 1048 | if (!(m_xml_background.empty())) { |
| 1049 | 1049 | GXmlElement* par = gammalib::xml_need_par(G_WRITE, xml, "Background"); |
| 1050 | 1050 | par->attribute("file", m_xml_background); |
| 1051 | - if (!m_xml_background_hdu.empty()) { | |
| 1052 | - par->attribute("hdu", m_xml_background_hdu); | |
| 1051 | + if (!m_xml_background_extname.empty()) { | |
| 1052 | + par->attribute("hdu", m_xml_background_extname); | |
| 1053 | 1053 | } |
| 1054 | 1054 | } |
| 1055 | 1055 | } |
| ... | ... | @@ -1992,10 +1992,10 @@ void GCTAResponseIrf::init_members(void) |
| 1992 | 1992 | m_xml_psf.clear(); |
| 1993 | 1993 | m_xml_edisp.clear(); |
| 1994 | 1994 | m_xml_background.clear(); |
| 1995 | - m_xml_aeff_hdu.clear(); | |
| 1996 | - m_xml_psf_hdu.clear(); | |
| 1997 | - m_xml_edisp_hdu.clear(); | |
| 1998 | - m_xml_background_hdu.clear(); | |
| 1995 | + m_xml_aeff_extname.clear(); | |
| 1996 | + m_xml_psf_extname.clear(); | |
| 1997 | + m_xml_edisp_extname.clear(); | |
| 1998 | + m_xml_background_extname.clear(); | |
| 1999 | 1999 | |
| 2000 | 2000 | // Initialise Npred cache |
| 2001 | 2001 | m_npred_names.clear(); |
| ... | ... | @@ -2029,10 +2029,10 @@ void GCTAResponseIrf::copy_members(const GCTAResponseIrf& rsp) |
| 2029 | 2029 | m_xml_psf = rsp.m_xml_psf; |
| 2030 | 2030 | m_xml_edisp = rsp.m_xml_edisp; |
| 2031 | 2031 | m_xml_background = rsp.m_xml_background; |
| 2032 | - m_xml_aeff_hdu = rsp.m_xml_aeff_hdu; | |
| 2033 | - m_xml_psf_hdu = rsp.m_xml_psf_hdu; | |
| 2034 | - m_xml_edisp_hdu = rsp.m_xml_edisp_hdu; | |
| 2035 | - m_xml_background_hdu = rsp.m_xml_background_hdu; | |
| 2032 | + m_xml_aeff_extname = rsp.m_xml_aeff_extname; | |
| 2033 | + m_xml_psf_extname = rsp.m_xml_psf_extname; | |
| 2034 | + m_xml_edisp_extname = rsp.m_xml_edisp_extname; | |
| 2035 | + m_xml_background_extname = rsp.m_xml_background_extname; | |
| 2036 | 2036 | |
| 2037 | 2037 | // Copy cache |
| 2038 | 2038 | m_npred_names = rsp.m_npred_names; | ... | ... |
inst/cta/test/data/irf_1dc.xml
| 1 | 1 | <observation_list title="observation library"> |
| 2 | 2 | <observation name="Crab" id="000001" instrument="CTA"> |
| 3 | 3 | <parameter name="CountsCube" file="$(PACKAGE_SOURCE)/inst/cta/test/data/crab_cntmap.fits"/> |
| 4 | - <parameter name="EffectiveArea" file="$(PACKAGE_SOURCE)/inst/cta/test/caldb/dc1/arf.fits" hdu="SPECRESP"/> | |
| 5 | - <parameter name="PointSpreadFunction" file="$(PACKAGE_SOURCE)/inst/cta/test/caldb/dc1/psf.fits" hdu="POINT SPREAD FUNCTION"/> | |
| 6 | - <parameter name="EnergyDispersion" file="$(PACKAGE_SOURCE)/inst/cta/test/caldb/dc1/rmf.fits" hdu="MATRIX"/> | |
| 4 | + <parameter name="EffectiveArea" file="$(PACKAGE_SOURCE)/inst/cta/test/caldb/dc1/arf.fits" extname="SPECRESP"/> | |
| 5 | + <parameter name="PointSpreadFunction" file="$(PACKAGE_SOURCE)/inst/cta/test/caldb/dc1/psf.fits" extname="POINT SPREAD FUNCTION"/> | |
| 6 | + <parameter name="EnergyDispersion" file="$(PACKAGE_SOURCE)/inst/cta/test/caldb/dc1/rmf.fits" extname="MATRIX"/> | |
| 7 | 7 | <parameter name="Background" file=""/> |
| 8 | 8 | </observation> |
| 9 | 9 | </observation_list> | ... | ... |