From f78e0b8ac73b37278de8d286c7b1f9871986f672 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 13 Dec 2013 23:52:34 +0100 Subject: [PATCH] Adapt all test scripts to GammaLib-00-08-00. --- examples/cpp/createfits/Makefile | 4 ++-- examples/cpp/createskymap/Makefile | 4 ++-- examples/cpp/createxml/Makefile | 4 ++-- examples/cpp/readmodel/Makefile | 4 ++-- examples/cpp/readmodel/readmodel.cpp | 32 ++++++++++++++++++++++++++++++++ inst/lat/test/data/p7v6/crab_model.xml | 2 +- inst/mwl/test/test_python.py | 4 ++-- testall.sh | 21 ++++++++++++++++++--- 8 files changed, 61 insertions(+), 14 deletions(-) diff --git a/examples/cpp/createfits/Makefile b/examples/cpp/createfits/Makefile index 1661acb..7e33f69 100644 --- a/examples/cpp/createfits/Makefile +++ b/examples/cpp/createfits/Makefile @@ -1,6 +1,6 @@ CXX=g++ -CFLAGS=-I/usr/local/gamma/include/gammalib -LDFLAGS=-L/usr/local/gamma/lib -lgamma +CFLAGS=-I${GAMMALIB}/include/gammalib +LDFLAGS=-L${GAMMALIB}/lib -lgamma DEPS= OBJ=createfits.cpp diff --git a/examples/cpp/createskymap/Makefile b/examples/cpp/createskymap/Makefile index d3fe7db..77a2cad 100644 --- a/examples/cpp/createskymap/Makefile +++ b/examples/cpp/createskymap/Makefile @@ -1,6 +1,6 @@ CXX=g++ -CFLAGS=-I/usr/local/gamma/include/gammalib -LDFLAGS=-L/usr/local/gamma/lib -lgamma +CFLAGS=-I${GAMMALIB}/include/gammalib +LDFLAGS=-L${GAMMALIB}/lib -lgamma DEPS= OBJ=createskymap.cpp diff --git a/examples/cpp/createxml/Makefile b/examples/cpp/createxml/Makefile index a4bf964..25f1270 100644 --- a/examples/cpp/createxml/Makefile +++ b/examples/cpp/createxml/Makefile @@ -1,6 +1,6 @@ CXX=g++ -CFLAGS=-I/usr/local/gamma/include/gammalib -LDFLAGS=-L/usr/local/gamma/lib -lgamma +CFLAGS=-I${GAMMALIB}/include/gammalib +LDFLAGS=-L${GAMMALIB}/lib -lgamma DEPS= OBJ=createxml.cpp diff --git a/examples/cpp/readmodel/Makefile b/examples/cpp/readmodel/Makefile index 99ec394..c949225 100644 --- a/examples/cpp/readmodel/Makefile +++ b/examples/cpp/readmodel/Makefile @@ -1,6 +1,6 @@ CXX=g++ -CFLAGS=-I/usr/local/gamma/include/gammalib -LDFLAGS=-L/usr/local/gamma/lib -lgamma +CFLAGS=-I${GAMMALIB}/include/gammalib +LDFLAGS=-L${GAMMALIB}/lib -lgamma DEPS= OBJ=readmodel.cpp diff --git a/examples/cpp/readmodel/readmodel.cpp b/examples/cpp/readmodel/readmodel.cpp index 2461837..98d6fbe 100644 --- a/examples/cpp/readmodel/readmodel.cpp +++ b/examples/cpp/readmodel/readmodel.cpp @@ -1,5 +1,37 @@ +/*************************************************************************** + * readmodel.cpp - Illustrates how to read a model * + * ----------------------------------------------------------------------- * + * copyright (C) 2013 by Juergen Knoedlseder * + * ----------------------------------------------------------------------- * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + * * + ***************************************************************************/ +/** + * @file readmodel.cpp + * @brief Illustrates how to read a model + * @author Juergen Knoedlseder + */ + +/* __ Includes ___________________________________________________________ */ #include #include "GammaLib.hpp" + + +/***********************************************************************//** + * @brief Dummy read model test + ***************************************************************************/ int main(void) { GModels models("source.xml"); std::cout << models << std::endl; diff --git a/inst/lat/test/data/p7v6/crab_model.xml b/inst/lat/test/data/p7v6/crab_model.xml index 3c2a85b..61020e4 100644 --- a/inst/lat/test/data/p7v6/crab_model.xml +++ b/inst/lat/test/data/p7v6/crab_model.xml @@ -11,7 +11,7 @@ - + diff --git a/inst/mwl/test/test_python.py b/inst/mwl/test/test_python.py index 8df5190..49c347b 100755 --- a/inst/mwl/test/test_python.py +++ b/inst/mwl/test/test_python.py @@ -22,8 +22,8 @@ def extract_data(filename): # Loop over all table HDUs k = 0 for extno in range(fits.size()): - if fits.hdu(extno).exttype() == GFitsHDU.HT_ASCII_TABLE or \ - fits.hdu(extno).exttype() == GFitsHDU.HT_BIN_TABLE: + if fits.at(extno).exttype() == GFitsHDU.HT_ASCII_TABLE or \ + fits.at(extno).exttype() == GFitsHDU.HT_BIN_TABLE: # Load spectrum spectrum = GMWLSpectrum() diff --git a/testall.sh b/testall.sh index caf9ea1..2ed2590 100755 --- a/testall.sh +++ b/testall.sh @@ -20,11 +20,25 @@ base=$PWD -# examples -# ======== +# examples/cpp +# =============== echo -echo "=====> examples" +echo "=====> examples/cpp" +cd examples/cpp +cd createfits; rm -f createfits; make; ./createfits; cd .. +cd createskymap; rm -f createskymap; make; ./createskymap; cd .. +cd createxml; rm -f createxml; make; ./createxml; cd .. +cd numerics; rm -f numerics; make; ./numerics; cd .. +cd readmodel; rm -f readmodel; make; ./readmodel; cd .. +cd $base + + +# examples/python +# =============== +echo +echo "=====> examples/python" cd examples/python +./matrix_howto.py ./models_howto.py ./xml_howto.py ./xml_html_create.py @@ -50,6 +64,7 @@ cd inst/cta/test ./test_gauss.py ./example_binned_ml_fit.py ./example_sim_photons.py +./example_sim_psf.py cd $base -- libgit2 0.21.4