Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detectors with veto threshold "None" fail #42

Open
rhallid opened this issue May 12, 2022 · 0 comments
Open

Detectors with veto threshold "None" fail #42

rhallid opened this issue May 12, 2022 · 0 comments

Comments

@rhallid
Copy link
Contributor

rhallid commented May 12, 2022

If a configuration is added, or generated (either by editing factory.py or by using it's functions), and the vet_threshold value is left as None (the default for the KM3NeT config), it will throw an error:

`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/var/folders/94/sygq2hyx6rl0h_61_vm5t_d80000gn/T/ipykernel_78786/2428488385.py in
13 #set up separate discovery potential calculations for Fictive-Optical-TracksOnly
14
---> 15 discpot=figures_of_merit.PointSource({'KM3NeT':15}, i)
16 outdat2[i]=discpot.benchmark(figures_of_merit.TOT.ul)

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/figures_of_merit.py in init(self, exposures, zi)
101 class PointSource(object):
102 def init(self, exposures, zi):
--> 103 self.bundle = factory.component_bundle(
104 exposures, partial(self.make_components, zi)
105 )

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/factory.py in init(self, livetimes, component_factory, **kwargs)
291 self.detectors = dict()
292 for detector, livetime in livetimes.items():
--> 293 for channel, aeff in aeff_factory.get()(detector).items():
294 key = detector + "_" + channel
295 if "restricted" in kwargs:

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/factory.py in call(self, name)
275 if not name in self._aeffs:
276 opts, kwargs = self._recipes[name]
--> 277 self._aeffs[name] = self._create(opts, **kwargs)
278 return self._aeffs[name]
279

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/factory.py in _create(self, opts, **kwargs)
260 else:
261 psi_bins = kwargs.pop("psi_bins")
--> 262 nu, mu = create_aeff(opts, psi_bins=psi_bins["tracks"], **kwargs)
263 aeffs["shadowed_tracks"] = (nu[0], mu[0])
264 aeffs["unshadowed_tracks"] = (nu[1], mu[1])

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/factory.py in create_aeff(opts, **kwargs)
115 )
116
--> 117 bundle_aeff = effective_areas.create_bundle_aeff(
118 energy_resolution=effective_areas.get_energy_resolution(
119 resolution_geometry, opts.spacing

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/effective_areas.py in create_bundle_aeff(energy_resolution, energy_threshold, veto_coverage, selection_efficiency, surface, cos_theta, **kwargs)
610 # avoids the mess of different E_true -> E_reco mappings for different
611 # detector geometries
--> 612 veto_suppression = 1 - energy_threshold.accept(
613 *numpy.meshgrid(center(e_mu), center(cos_theta), indexing="ij")
614 )

~/Dropbox/ICAnalyses/Gen2Factory/toise/toise/effective_areas.py in accept(self, e_mu, cos_theta)
233 return numpy.where(
234 cos_theta > 0.05,
--> 235 (e_mu > self.threshold) & (cos_theta >= self.max_inclination),
236 True,
237 )

TypeError: '>' not supported between instances of 'float' and 'NoneType'`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant