|
1 | 1 | import logging |
2 | | -import os |
3 | 2 |
|
4 | 3 | import numpy as np |
5 | | -from scipy.interpolate import interp1d, interp2d |
| 4 | +from scipy.interpolate import RectBivariateSpline |
6 | 5 |
|
7 | 6 | from flarestack.data.icecube.ic_season import get_published_sens_ref_dir |
8 | 7 |
|
@@ -62,7 +61,9 @@ def reference_7year_sensitivity(sindec=np.array(0.0), gamma=2.0): |
62 | 61 |
|
63 | 62 | sens = np.vstack((sens[0], sens)) |
64 | 63 | sens = np.vstack((sens, sens[-1])) |
65 | | - sens_ref = interp2d(np.array(sindecs), np.array(gammas), np.log(sens.T)) |
| 64 | + sens_ref = RectBivariateSpline( |
| 65 | + np.array(sindecs), np.array(gammas), np.log(sens), kx=1, ky=1 |
| 66 | + ) |
66 | 67 |
|
67 | 68 | if np.array(sindec).ndim > 0: |
68 | 69 | return np.array([np.exp(sens_ref(x, gamma))[0] for x in sindec]) |
@@ -98,7 +99,9 @@ def reference_7year_discovery_potential(sindec=0.0, gamma=2.0): |
98 | 99 |
|
99 | 100 | disc = np.vstack((disc[0], disc)) |
100 | 101 | disc = np.vstack((disc, disc[-1])) |
101 | | - disc_ref = interp2d(np.array(sindecs), np.array(gammas), np.log(disc.T)) |
| 102 | + disc_ref = RectBivariateSpline( |
| 103 | + np.array(sindecs), np.array(gammas), np.log(disc), kx=1, ky=1 |
| 104 | + ) |
102 | 105 |
|
103 | 106 | if np.array(sindec).ndim > 0: |
104 | 107 | return np.array([np.exp(disc_ref(x, gamma))[0] for x in sindec]) |
@@ -130,7 +133,9 @@ def reference_10year_sensitivity(sindec=np.array(0.0), gamma=2.0): |
130 | 133 | scaling = np.array([10 ** (3 * (i)) for i in range(2)]) |
131 | 134 | sens *= scaling |
132 | 135 |
|
133 | | - sens_ref = interp2d(np.array(sindecs), np.array(gammas), np.log(sens.T)) |
| 136 | + sens_ref = RectBivariateSpline( |
| 137 | + np.array(sindecs), np.array(gammas), np.log(sens), kx=1, ky=1 |
| 138 | + ) |
134 | 139 |
|
135 | 140 | if np.array(sindec).ndim > 0: |
136 | 141 | return np.array([np.exp(sens_ref(x, gamma))[0] for x in sindec]) |
@@ -162,7 +167,9 @@ def reference_10year_discovery_potential(sindec=np.array(0.0), gamma=2.0): |
162 | 167 | scaling = np.array([10 ** (3 * i) for i in range(2)]) |
163 | 168 | sens *= scaling |
164 | 169 |
|
165 | | - sens_ref = interp2d(np.array(sindecs), np.array(gammas), np.log(sens.T)) |
| 170 | + sens_ref = RectBivariateSpline( |
| 171 | + np.array(sindecs), np.array(gammas), np.log(sens), kx=1, ky=1 |
| 172 | + ) |
166 | 173 |
|
167 | 174 | if np.array(sindec).ndim > 0: |
168 | 175 | return np.array([np.exp(sens_ref(x, gamma))[0] for x in sindec]) |
|
0 commit comments