17 #include <gsl/gsl_interp.h> 24 int main(
int argc,
char *argv[])
27 fprintf(stderr,
"Usage: %s PacsAbsorption.txt PacsFilter.txt\n", argv[0]);
32 FILE *bolo = fopen(argv[1],
"r"), *band = fopen(argv[2],
"r");
39 while (fscanf(bolo,
"%lf%lf", &lamb, &resp) == 2) {
42 while (fscanf(band,
"%lf%lf", &lamb, &resp) == 2) {
49 gsl_interp_accel *acc = gsl_interp_accel_alloc();
50 gsl_interp *interp = gsl_interp_alloc(gsl_interp_cspline, lBolo.
size());
52 argv[0],
"Interpolator initialization failed");
54 puts(
" // {nu0, response0}");
55 for (
size_t i = lBand.
size()-1; i != 0; i--) {
57 if (rBand[i] > 1e-4) {
59 gsl_interp_eval(interp, &lBolo[0], &rBolo[0], lBand[i], acc);
60 if (resp > 1e-4) { printf(
" {%.5e, %.5e},\n", nu, resp); }
#define MU_EXCEPTION_IF(cond, src, msg,...)
Conditionally throws mutils::Exception.
constexpr double c_light
Speed of light (cm/s).
int main(int argc, char *argv[])
#define MU_EXCEPTION_ERRNO_IF(cond, src, msg,...)
Conditionally throws mutils::Exception (including errno text).
The MathUtils miscellaneous utilities library.