Commit cb25c21272131e2198d4f6e19229b273b1527d05

Authored by knodlseder
1 parent 9eefe6a5

add tests for cspull and cstsdist

Showing 1 changed file with 65 additions and 3 deletions
test/test_cscripts.sh.in
@@ -42,18 +42,49 @@ export PFILES=pfiles @@ -42,18 +42,49 @@ export PFILES=pfiles
42 42
43 43
44 # 44 #
  45 +# Test cspull
  46 +# ===========
  47 +echo -n "Test cspull: "
  48 +chmod +x @abs_top_srcdir@/scripts/cspull.py
  49 +@abs_top_srcdir@/scripts/cspull.py \
  50 + srcmdl="data/crab.xml" \
  51 + outfile="pull.dat" \
  52 + ntrials="1" \
  53 + caldb="irf" \
  54 + irf="kb_E_50h_v3" \
  55 + ra=83.6331 \
  56 + dec=22.0145 \
  57 + emin=0.1 \
  58 + emax=100.0 \
  59 + enumbins=0 \
  60 + duration=1800.0 \
  61 + rad=5.0 \
  62 + npix=200 \
  63 + binsz=0.05 > cspull.log
  64 +echo -n "."
  65 +if [ -s "pull.dat" ]
  66 +then
  67 + echo -n "."
  68 +else
  69 + echo " pull.dat file is not valid"
  70 + exit 1
  71 +fi
  72 +echo " ok"
  73 +
  74 +
  75 +#
45 # Test cssens 76 # Test cssens
46 # =========== 77 # ===========
47 echo -n "Test cssens: " 78 echo -n "Test cssens: "
48 -chmod +x @abs_srcdir@/scripts/cssens.py  
49 -@abs_srcdir@/scripts/cssens.py \ 79 +chmod +x @abs_top_srcdir@/scripts/cssens.py
  80 +@abs_top_srcdir@/scripts/cssens.py \
50 duration=3600.0 \ 81 duration=3600.0 \
51 caldb="irf" \ 82 caldb="irf" \
52 irf="kb_E_50h_v3" \ 83 irf="kb_E_50h_v3" \
53 type="point" \ 84 type="point" \
54 offset="0.0" \ 85 offset="0.0" \
55 bkg="data/bkg_kb_E_50h_v3.txt" \ 86 bkg="data/bkg_kb_E_50h_v3.txt" \
56 - rad=5.0 87 + rad=5.0 > cssens.log
57 echo -n "." 88 echo -n "."
58 if [ -s "sensitivity.dat" ] 89 if [ -s "sensitivity.dat" ]
59 then 90 then
@@ -63,3 +94,34 @@ else @@ -63,3 +94,34 @@ else
63 exit 1 94 exit 1
64 fi 95 fi
65 echo " ok" 96 echo " ok"
  97 +
  98 +
  99 +#
  100 +# Test cstsdist
  101 +# =============
  102 +echo -n "Test cstsdist: "
  103 +chmod +x @abs_top_srcdir@/scripts/cstsdist.py
  104 +@abs_top_srcdir@/scripts/cstsdist.py \
  105 + outfile="ts.dat" \
  106 + ntrials="1" \
  107 + caldb="irf" \
  108 + irf="kb_E_50h_v3" \
  109 + type="point" \
  110 + offset="0.0" \
  111 + bkg="data/bkg_kb_E_50h_v3.txt" \
  112 + emin=0.1 \
  113 + emax=100.0 \
  114 + enumbins=0 \
  115 + duration=1800.0 \
  116 + rad=5.0 \
  117 + npix=200 \
  118 + binsz=0.05 > cstsdist.log
  119 +echo -n "."
  120 +if [ -s "ts.dat" ]
  121 +then
  122 + echo -n "."
  123 +else
  124 + echo " ts.dat file is not valid"
  125 + exit 1
  126 +fi
  127 +echo " ok"