Commit c495b3a423df07c2675009d1c94e6ed858770aab
1 parent
5303e49b
Re-arrange (possibly obsolete) test scripts
Showing
4 changed files
with
19 additions
and
23 deletions
inst/lat/test/binned_integration.py renamed to inst/lat/test/dev/binned_integration.py
inst/lat/test/test_python.py renamed to inst/lat/test/dev/test_python.py
| @@ -40,8 +40,8 @@ def analyse_unbinned(xmlname): | @@ -40,8 +40,8 @@ def analyse_unbinned(xmlname): | ||
| 40 | 40 | ||
| 41 | # Load LAT observation | 41 | # Load LAT observation |
| 42 | lat = GLATObservation() | 42 | lat = GLATObservation() |
| 43 | - lat.load_unbinned("data/p7v6/ft1.fits", "data/p7v6/ft2.fits", "data/p7v6/ltcube.fits") | ||
| 44 | - lat.response("P7SOURCE_V6", "../caldb") | 43 | + lat.load_unbinned("../data/p7v6/ft1.fits", "../data/p7v6/ft2.fits", "../data/p7v6/ltcube.fits") |
| 44 | + lat.response("P7SOURCE_V6") | ||
| 45 | 45 | ||
| 46 | # Setup ROI covered by data | 46 | # Setup ROI covered by data |
| 47 | instDir = GSkyDir() | 47 | instDir = GSkyDir() |
| @@ -82,8 +82,8 @@ def analyse_binned(xmlname): | @@ -82,8 +82,8 @@ def analyse_binned(xmlname): | ||
| 82 | 82 | ||
| 83 | # Load LAT observation | 83 | # Load LAT observation |
| 84 | lat = GLATObservation() | 84 | lat = GLATObservation() |
| 85 | - lat.load_binned("data/p7v6/srcmap.fits", "data/p7v6/binned_expmap.fits", "data/p7v6/ltcube.fits") | ||
| 86 | - lat.response("P7SOURCE_V6", "../caldb") | 85 | + lat.load_binned("../data/p7v6/srcmap.fits", "../data/p7v6/binned_expmap.fits", "../data/p7v6/ltcube.fits") |
| 86 | + lat.response("P7SOURCE_V6") | ||
| 87 | lat.response().force_mean(True) | 87 | lat.response().force_mean(True) |
| 88 | 88 | ||
| 89 | # Append LAT observation to container | 89 | # Append LAT observation to container |
| @@ -180,9 +180,7 @@ def plot_residuals(obs): | @@ -180,9 +180,7 @@ def plot_residuals(obs): | ||
| 180 | # Main routine entry point # | 180 | # Main routine entry point # |
| 181 | #==========================# | 181 | #==========================# |
| 182 | if __name__ == '__main__': | 182 | if __name__ == '__main__': |
| 183 | - """ | ||
| 184 | - Perform testing. | ||
| 185 | - """ | 183 | + |
| 186 | # Dump result | 184 | # Dump result |
| 187 | print("") | 185 | print("") |
| 188 | print("**************************************") | 186 | print("**************************************") |
| @@ -190,5 +188,5 @@ if __name__ == '__main__': | @@ -190,5 +188,5 @@ if __name__ == '__main__': | ||
| 190 | print("**************************************") | 188 | print("**************************************") |
| 191 | 189 | ||
| 192 | # Analyse data | 190 | # Analyse data |
| 193 | -# analyse_unbinned("data/p7v6/crab_model.xml") | ||
| 194 | - analyse_binned("data/p7v6/crab_model.xml") | 191 | +# analyse_unbinned("../data/p7v6/crab_model.xml") |
| 192 | + analyse_binned("../data/p7v6/crab_model.xml") |
inst/mwl/test/test_python.py renamed to inst/mwl/test/dev/test_python.py
| @@ -103,9 +103,7 @@ def fit_spectrum(filename, xmlname): | @@ -103,9 +103,7 @@ def fit_spectrum(filename, xmlname): | ||
| 103 | # Main routine entry point # | 103 | # Main routine entry point # |
| 104 | #==========================# | 104 | #==========================# |
| 105 | if __name__ == '__main__': | 105 | if __name__ == '__main__': |
| 106 | - """ | ||
| 107 | - Perform testing. | ||
| 108 | - """ | 106 | + |
| 109 | # Dump result | 107 | # Dump result |
| 110 | print("") | 108 | print("") |
| 111 | print("****************************") | 109 | print("****************************") |
| @@ -123,10 +121,10 @@ if __name__ == '__main__': | @@ -123,10 +121,10 @@ if __name__ == '__main__': | ||
| 123 | plt.title('GammaLib fit of the Crab PWN') | 121 | plt.title('GammaLib fit of the Crab PWN') |
| 124 | 122 | ||
| 125 | # Extract data from FITS file | 123 | # Extract data from FITS file |
| 126 | - extract_data("data/crab_mwl.fits") | 124 | + extract_data("../data/crab_mwl.fits") |
| 127 | 125 | ||
| 128 | # Fit spectrum | 126 | # Fit spectrum |
| 129 | - fit_spectrum("data/crab_mwl.fits", "data/crab_mwl2.xml") | 127 | + fit_spectrum("../data/crab_mwl.fits", "../data/crab_mwl2.xml") |
| 130 | 128 | ||
| 131 | # Show spectrum | 129 | # Show spectrum |
| 132 | plt.show() | 130 | plt.show() |
testall.sh
| @@ -56,20 +56,20 @@ cd inst/cta/test/dev | @@ -56,20 +56,20 @@ cd inst/cta/test/dev | ||
| 56 | cd $base | 56 | cd $base |
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | -# inst/lat/test | ||
| 60 | -# ============= | 59 | +# inst/lat/test/dev |
| 60 | +# ================= | ||
| 61 | echo | 61 | echo |
| 62 | -echo "=====> inst/lat/test" | ||
| 63 | -cd inst/lat/test | ||
| 64 | -./test_python.py | 62 | +echo "=====> inst/lat/test/dev" |
| 63 | +cd inst/lat/test/dev | ||
| 64 | +#./test_python.py | ||
| 65 | cd $base | 65 | cd $base |
| 66 | 66 | ||
| 67 | 67 | ||
| 68 | -# inst/mwl/test | ||
| 69 | -# ============= | 68 | +# inst/mwl/test/dev |
| 69 | +# ================= | ||
| 70 | echo | 70 | echo |
| 71 | -echo "=====> inst/mwl/test" | ||
| 72 | -cd inst/mwl/test | 71 | +echo "=====> inst/mwl/test/dev" |
| 72 | +cd inst/mwl/test/dev | ||
| 73 | ./test_python.py | 73 | ./test_python.py |
| 74 | cd $base | 74 | cd $base |
| 75 | 75 |