HErmes.analysis package

Submodules

HErmes.analysis.calculus module

Common calculations

HErmes.analysis.calculus.opening_angle(reco_zen, reco_azi, true_zen, true_azi)[source]

Calculate the opening angle between two vectors, described by azimuth and zenith in some coordinate system. Can be useful for estimatiion of angular uncertainty for some reconstruction. Zenith and Azimuth in radians.

Parameters:
  • reco_zen (float) – zenith of vector A
  • reco_azi (float) – azimuth of vector A
  • true_zen (float) – zenith of vector B
  • true_azi (float) – azimuth of vector B
Returns:

Opening angle in degree

Return type:

float

HErmes.analysis.fluxes module

Models for particle fluxes. These are just examples, for specific cosmic ray modelss have a look at e.g. https://github.com/afedynitch/CRFluxModels.git

class HErmes.analysis.fluxes.Constant[source]

Bases: object

static identity(x)[source]
class HErmes.analysis.fluxes.PowerLawFlux(emin, emax, phi0, gamma)[source]

Bases: object

A flux only dependent on the energy of a particle, following a power law. Defined in an energy interval [emin, emax] with fluence phi0 and spectral index gamma

static E2_1E8(energy)[source]

A flux with fixed parameters, spectral index E**-2 and normalization 1E-8 Usefull for automatic weighting.

Parameters:energy
fluxsum()[source]

The integrated flux

Returns:float

HErmes.analysis.tasks module

Multi-step operations which might be ultimatly performed on variables in a dataset

HErmes.analysis.tasks.construct_slices(name, bins)[source]

Prepare a set of cuts for the variable with name “name” in the dataset This will just create the bins. This has then to be handed over to the HErmes.cut.Cut class for further application on a dataset.

Parameters:
  • name (str) – The name of the variable in the dataset
  • bins (array) – bincenters of the slices
Returns:

tuple (list of strings, list of cuttuples)

Module contents

Some snippets/functions which might help wirh reocurring analysis tools and common tasks