BaseEmittersDistribution#

class jetset.jet_emitters.BaseEmittersDistribution(name, spectral_type, gamma_grid_size=200, log_values=False, emitters_type='electrons', skip_build=False, normalize=False)[source]#

Bases: object

Base implementation for emitter distribution parameterizations.

Notes

Defines common parameter handling, gamma-grid generation, normalization, numerical moment evaluation, and plotting helpers shared by electron and proton distribution subclasses.

Attributes Summary

name

Name.

spectral_type

Spectral type.

Methods Summary

add_par(*args, **kwargs)

Inner.

eval_N()

Evaluate n.

eval_U([gmin, gmax])

Evaluate u.

plot([p, y_min, y_max, x_min, x_max, ...])

Plot.

plot2p([p, y_min, y_max, x_min, x_max, ...])

Plot2p.

plot3p([p, y_min, y_max, x_min, x_max, ...])

Plot3p.

set_bounds(a, b[, log_val])

Set bounds.

set_distr_func(distr_func)

Set distr func.

set_grid()

Build logarithmic gamma grid from gmin and gmax.

spectral_types_obs_constrain()

Spectral types obs constrain.

update()

Refresh distribution arrays from current parameter values.

Attributes Documentation

name#

Name.

Returns:

Requested value.

Return type:

object

spectral_type#

Spectral type.

Returns:

Requested value.

Return type:

object

Methods Documentation

add_par(*args, **kwargs)[source]#

Inner.

Parameters:
  • ref (object) – Parameter controlling ref.

  • *args (tuple) – Additional positional arguments.

  • **kwargs (dict) – Additional keyword arguments.

Returns:

Computed result.

Return type:

object

eval_N()[source]#

Evaluate n.

Returns:

Computed value.

Return type:

object

eval_U(gmin=None, gmax=None)[source]#

Evaluate u.

Parameters:
  • gmin (object, optional) – Lower gamma bound.

  • gmax (object, optional) – Upper gamma bound.

Returns:

Computed value.

Return type:

object

plot(p=None, y_min=None, y_max=None, x_min=None, x_max=None, energy_unit='gamma', label=None, loglog=False)[source]#

Plot.

Parameters:
  • p (object, optional) – Spectral slope/shape parameter or input vector.

  • y_min (object, optional) – Minimum value for y.

  • y_max (object, optional) – Maximum value for y.

  • x_min (object, optional) – Minimum value for x.

  • x_max (object, optional) – Maximum value for x.

  • energy_unit (str, optional) – Energy unit used for plotting/output.

  • label (object, optional) – Label used in output or plots.

  • loglog (bool, optional) – If True, operate in log10 space.

Returns:

Computed value.

Return type:

object

plot2p(p=None, y_min=None, y_max=None, x_min=None, x_max=None, energy_unit='gamma', label=None, loglog=False)[source]#

Plot2p.

Parameters:
  • p (object, optional) – Spectral slope/shape parameter or input vector.

  • y_min (object, optional) – Minimum value for y.

  • y_max (object, optional) – Maximum value for y.

  • x_min (object, optional) – Minimum value for x.

  • x_max (object, optional) – Maximum value for x.

  • energy_unit (str, optional) – Energy unit used for plotting/output.

  • label (object, optional) – Label used in output or plots.

  • loglog (bool, optional) – If True, operate in log10 space.

Returns:

Computed value.

Return type:

object

plot3p(p=None, y_min=None, y_max=None, x_min=None, x_max=None, energy_unit='gamma', label=None, loglog=False)[source]#

Plot3p.

Parameters:
  • p (object, optional) – Spectral slope/shape parameter or input vector.

  • y_min (object, optional) – Minimum value for y.

  • y_max (object, optional) – Maximum value for y.

  • x_min (object, optional) – Minimum value for x.

  • x_max (object, optional) – Maximum value for x.

  • energy_unit (str, optional) – Energy unit used for plotting/output.

  • label (object, optional) – Label used in output or plots.

  • loglog (bool, optional) – If True, operate in log10 space.

Returns:

Computed value.

Return type:

object

set_bounds(a, b, log_val=False)[source]#

Set bounds.

Parameters:
  • a (object) – First shape/control parameter.

  • b (object) – Second shape/control parameter.

  • log_val (bool, optional) – If True, interpret bounds/values in log10 scale.

Returns:

Computed value.

Return type:

object

set_distr_func(distr_func)[source]#

Set distr func.

Parameters:

distr_func (object) – Distribution function used to evaluate emitters.

set_grid()[source]#

Build logarithmic gamma grid from gmin and gmax.

Notes

Grid size is controlled by self._gamma_grid_size.

static spectral_types_obs_constrain()[source]#

Spectral types obs constrain.

Returns:

Computed value.

Return type:

object

update()[source]#

Refresh distribution arrays from current parameter values.

Notes

Recomputes internal grids and distribution values via _fill.