Skip to content

Commit

Permalink
add bases to decompose
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorBarbosaMartins committed Feb 6, 2024
1 parent fcfef12 commit be8873c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ctao_cosmic_ray_spectra/spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,16 @@ def derive_events_rate(self,
Minimum energy in the integration.
energy_max: astropy.units.Quantity[energy]
Maximum energy in the integration.
Returns
-------
float:
events rate integrated from the spectral distribution.
"""
spectrum_cone = self.integrate_cone(inner, outer)
spectrum_area = spectrum_cone.integrate_area(area)
return (spectrum_area.integrate_energy(energy_min, energy_max).decompose())
return (spectrum_area.integrate_energy(energy_min, energy_max).decompose(
bases=[u.m, u.TeV, u.s, u.sr]))

@u.quantity_input(inner=u.deg, outer=u.deg, obstime=u.s, area=u.cm**2, energy=u.TeV)
def derive_number_events(self,
Expand Down Expand Up @@ -322,7 +324,7 @@ def derive_number_events(self,
"""
spectrum_cone = self.derive_events_rate(inner, outer, area, energy)
spectrum_time = spectrum_cone.integrate_time(obs_time)
return spectrum_time.decompose()
return spectrum_time.decompose(bases=[u.m, u.TeV, u.s, u.sr])

class LogParabola:
r"""
Expand Down

0 comments on commit be8873c

Please sign in to comment.