aboutsummaryrefslogtreecommitdiff
path: root/src/quantum_efficiency.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-10-02 16:57:59 -0500
committertlatorre <tlatorre@uchicago.edu>2018-10-02 16:57:59 -0500
commiteaa96130f5cfa6bcff25021f75448c426a39ebcc (patch)
tree6071e596b27d3c758dcc352a6732afbbe2dbd010 /src/quantum_efficiency.c
parent40809e5e56cfdd8f18f231121330be790705747e (diff)
downloadsddm-eaa96130f5cfa6bcff25021f75448c426a39ebcc.tar.gz
sddm-eaa96130f5cfa6bcff25021f75448c426a39ebcc.tar.bz2
sddm-eaa96130f5cfa6bcff25021f75448c426a39ebcc.zip
update get_quantum_efficiency() to use interp1d()
This speeds up the "boot up" time from ~30 seconds to ~12 seconds.
Diffstat (limited to 'src/quantum_efficiency.c')
-rw-r--r--src/quantum_efficiency.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/quantum_efficiency.c b/src/quantum_efficiency.c
index f8ae972..a3996b7 100644
--- a/src/quantum_efficiency.c
+++ b/src/quantum_efficiency.c
@@ -2,17 +2,13 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <gsl/gsl_errno.h>
-#include <gsl/gsl_spline.h>
+#include "misc.h"
static int initialized = 0;
static double *x, *y;
static size_t size;
-gsl_interp_accel *acc;
-gsl_spline *spline;
-
static int init()
{
int i;
@@ -99,10 +95,6 @@ static int init()
fclose(f);
- acc = gsl_interp_accel_alloc();
- spline = gsl_spline_alloc(gsl_interp_linear, size);
- gsl_spline_init(spline, x, y, size);
-
initialized = 1;
return 0;
@@ -121,5 +113,5 @@ double get_quantum_efficiency(double wavelength)
}
}
- return gsl_spline_eval(spline, wavelength, acc);
+ return interp1d(wavelength, x, y, size);
}