Commit 9be69c6ce5a331aad6a85ac68e90abcb3688fc33

Authored by knodlseder
1 parent 39e9c7a9

initial version

Showing 1 changed file with 129 additions and 0 deletions
test/test_ctatools.sh 0 → 100755
  1 +#! /bin/bash
  2 +#
  3 +# ctatools test script
  4 +# ====================================================================
  5 +
  6 +#
  7 +# Print Header
  8 +#
  9 +echo "*****************************"
  10 +echo "* Test ctatools executables *"
  11 +echo "*****************************"
  12 +
  13 +
  14 +#
  15 +# Remove any existing result files
  16 +# ================================
  17 +rm -rf *.fits *.log *.xml
  18 +
  19 +
  20 +#
  21 +# Test ctobssim
  22 +# ============
  23 +echo -n "Test ctobssim: "
  24 +ctobssim infile="data/crab.xml" \
  25 + outfile="events.fits" \
  26 + caldb="irf" \
  27 + irf="kb_E_50h_v3" \
  28 + ra=83.63 \
  29 + dec=22.01 \
  30 + rad=10.0 \
  31 + tmin=0.0 \
  32 + tmax=1800.0 \
  33 + emin=0.1 \
  34 + emax=100.0
  35 +echo -n "."
  36 +if [ -s "events.fits" ]
  37 +then
  38 + echo -n "."
  39 +else
  40 + echo " events.fits file is not valid"
  41 + exit 1
  42 +fi
  43 +echo " ok"
  44 +
  45 +
  46 +#
  47 +# Test ctbin
  48 +# ==========
  49 +echo -n "Test ctbin: "
  50 +ctbin evfile="events.fits" \
  51 + outfile="cntmap.fits" \
  52 + emin=0.1 \
  53 + emax=100.0 \
  54 + enumbins=20 \
  55 + nxpix=200 \
  56 + nypix=200 \
  57 + binsz=0.02 \
  58 + coordsys="CEL" \
  59 + xref=83.63 \
  60 + yref=22.01 \
  61 + proj="CAR"
  62 +echo -n "."
  63 +if [ -s "cntmap.fits" ]
  64 +then
  65 + echo -n "."
  66 +else
  67 + echo " cntmap.fits file is not valid"
  68 + exit 1
  69 +fi
  70 +echo " ok"
  71 +
  72 +
  73 +#
  74 +# Test ctselect
  75 +# =============
  76 +echo -n "Test ctselect: "
  77 +ctselect infile="events.fits" \
  78 + outfile="selected_events.fits" \
  79 + ra=83.63 \
  80 + dec=22.01 \
  81 + rad=10.0 \
  82 + tmin=0.0 \
  83 + tmax=1800.0 \
  84 + emin=0.1 \
  85 + emax=100.0
  86 +echo -n "."
  87 +if [ -s "selected_events.fits" ]
  88 +then
  89 + echo -n "."
  90 +else
  91 + echo " selected_events.fits file is not valid"
  92 + exit 1
  93 +fi
  94 +echo " ok"
  95 +
  96 +
  97 +#
  98 +# Test ctlike
  99 +# ===========
  100 +echo -n "Test ctlike: "
  101 +ctlike cntmap="cntmap.fits" \
  102 + srcmdl="data/crab.xml" \
  103 + outmdl="results_binned.xml" \
  104 + method="BINNED" \
  105 + caldb="irf" \
  106 + irf="kb_E_50h_v3"
  107 +echo -n "."
  108 +if [ -s "results_binned.xml" ]
  109 +then
  110 + echo -n "."
  111 +else
  112 + echo " results_binned.xml file is not valid"
  113 + exit 1
  114 +fi
  115 +ctlike evfile="selected_events.fits" \
  116 + srcmdl="data/crab.xml" \
  117 + outmdl="results_unbinned.xml" \
  118 + method="UNBINNED" \
  119 + caldb="irf" \
  120 + irf="kb_E_50h_v3"
  121 +echo -n "."
  122 +if [ -s "results_unbinned.xml" ]
  123 +then
  124 + echo -n "."
  125 +else
  126 + echo " results_unbinned.xml file is not valid"
  127 + exit 1
  128 +fi
  129 +echo " ok"
... ...