@@ -133,8 +133,6 @@ class from scipy.
133133 self .y_max = self .y_binedges [- 1 ]
134134
135135 x = get_bincenters_from_binedges (self .x_binedges )
136- # y = get_bincenters_from_binedges(self.y_binedges)
137-
138136 # Hack to avoid awkward behaviors due to splining in sin(dec)
139137 y = np .repeat (self .y_binedges , repeats = 2 )[1 :- 1 ]
140138 y [1 ::2 ] -= 1e-10
@@ -271,7 +269,7 @@ def __call__(self, x, y, oor_value=0, grid=False, renorm=True):
271269 if renorm :
272270 f2d = self ._renorm_per_y_grid (f2d , y )
273271
274- # OOR mask on tensor grid in user order
272+ # OOR mask on tensor grid
275273 mx2d , my2d = np .meshgrid (m_x_oor , m_y_oor , indexing = 'ij' )
276274 f2d [mx2d | my2d ] = oor_value
277275 return f2d
@@ -363,45 +361,6 @@ def psi_to_dec_and_ra(
363361
364362 return (dec , ra )
365363
366-
367- def create_energy_cut_spline_old (
368- ds ,
369- exp_data ,
370- spl_smooth ):
371- """Create the spline for the declination-dependent energy cut
372- that the signal generator needs for injection in the southern sky
373- Some special conditions are needed for IC79 and IC86_I, because
374- their experimental dataset shows events that should probably have
375- been cut by the IceCube selection.
376- """
377- data_exp = exp_data .copy (keep_fields = ['sin_dec' , 'log_energy' ])
378- if ds .name == 'IC79' :
379- m = np .invert (np .logical_and (
380- data_exp ['sin_dec' ] < - 0.75 ,
381- data_exp ['log_energy' ] < 4.2 ))
382- data_exp = data_exp [m ]
383- if ds .name == 'IC86_I' :
384- m = np .invert (np .logical_and (
385- data_exp ['sin_dec' ] < - 0.2 ,
386- data_exp ['log_energy' ] < 2.5 ))
387- data_exp = data_exp [m ]
388-
389- sin_dec_binning = ds .get_binning_definition ('sin_dec' )
390- sindec_edges = sin_dec_binning .binedges
391- min_log_e = np .zeros (len (sindec_edges )- 1 , dtype = float )
392- for i in range (len (sindec_edges )- 1 ):
393- mask = np .logical_and (
394- data_exp ['sin_dec' ] >= sindec_edges [i ],
395- data_exp ['sin_dec' ] < sindec_edges [i + 1 ])
396- min_log_e [i ] = np .min (data_exp ['log_energy' ][mask ])
397- del data_exp
398- sindec_centers = 0.5 * (sindec_edges [1 :]+ sindec_edges [:- 1 ])
399-
400- spline = interpolate .UnivariateSpline (
401- sindec_centers , min_log_e , k = 2 , s = spl_smooth )
402-
403- return spline
404-
405364def create_energy_cut_spline (
406365 ds ,
407366 exp_data ,
0 commit comments