test_GResponse.cpp
2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/***************************************************************************
* test_GResponse.cpp - test Response classes *
* ----------------------------------------------------------------------- *
* copyright : (C) 2008 by Jurgen Knodlseder *
* ----------------------------------------------------------------------- *
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* __ Includes ___________________________________________________________ */
#include <stdlib.h>
#include <iostream>
#include "test_GResponse.hpp"
/* __ Namespaces _________________________________________________________ */
/* __ Globals ____________________________________________________________ */
/***************************************************************************
* Test: LAT Response *
***************************************************************************/
void test_lat_response(void)
{
// Remove FITS file
system("rm -rf test_rsp.fits");
std::cout << "Test GLATResponse: Open PSF FITS file: ";
try {
// Get HANDOFF Response
GLATResponse rsp;
rsp.set_caldb("irf/lat");
rsp.load("Pass5_v0", "front");
// Save response
rsp.save("test_rsp.fits");
}
catch (std::exception &e) {
std::cout << std::endl << "TEST ERROR: Unable to open FITS file." << std::endl;
std::cout << e.what() << std::endl;
throw;
}
std::cout << ". ok." << std::endl;
}
/***************************************************************************
* Main test function *
***************************************************************************/
int main(void)
{
// Dump header
std::cout << std::endl;
std::cout << "***************************" << std::endl;
std::cout << "* GResponse class testing *" << std::endl;
std::cout << "***************************" << std::endl;
// Execute the tests
test_lat_response();
// Return
return 0;
}