magnus.globaldefs
globaldefs.py
Contains physical constants and unit-conversion constants.
This module contains values of physical constants and unit-conversion
factors used by the various modules of Magnus: unit conversions (km,
cm, GeV, etc., to natural units of eV), fundamental constants (G_F,
particle masses, Avogadro’s number), Earth/Sun radii and reference
densities, flavor index constants (NUE, NUMU, NUTAU, NUS), predefined
oscillation/NSI/LIV parameter sets (e.g., NuFIT 6.1, the default), and ANSI terminal
color codes (class cstyle) used to format warning/error messages.
Routine listings
cstyle - ANSI terminal color-code constants
- set_color_output - Enables or disables ANSI color in the warning
and error message prefixes
- load_nufit_params - Loads one NuFIT release/ordering/category as a
dict of standard oscillation parameters, in whichever
anglesconvention is asked for
The remaining module-level names are physical constants, unit-conversion factors, the ANGLE_CONVENTIONS tuple and the three warning classes defined here – MixingAngleConventionWarning, BaselineUnitWarning and SterileMatterCompositionWarning – not routines; see the module source for the full list.
Attributes
The values the |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Module-level constant |
|
Exceptions
A parameter set is very probably not in the |
|
A baseline was passed that looks like kilometers rather than eV-1. |
|
A caller's scalar builds the sterile matter entry from a different medium than the |
Classes
ANSI escape-code constants for colored/styled terminal output. |
Functions
|
Enables or disables ANSI color in the warning/error/tolerance message prefixes. |
|
Load standard three-flavor mixing parameters from a NuFIT global fit. |
Module Contents
- class magnus.globaldefs.cstyle[source]
ANSI escape-code constants for colored/styled terminal output.
Used to format the warning/error/tolerance messages printed by
oscprob.py(e.g.,gd.WARNING_MSG_IN_COLOR,gd.ERROR_MSG_IN_COLOR). Has no effect on Windows terminals unlessos.system("")has been called first, which this module does at import time.Added in version 1.0.0.
- magnus.globaldefs.ANGLE_CONVENTIONS = ('sin', 'sin2', 'rad', 'deg')[source]
The values the
angleskeyword accepts, in the order they are documented.'sin'(the default everywhere) is the sine of the mixing angle,'sin2'its square – which is what global fits report –'rad'the angle itself in radians, and'deg'in degrees. Under'deg'the CP phases are read as degrees too; under the other three they stay in radians, a sine being no way to state a phase.Defined here rather than in
magnus.hamiltoniansbecause the conversion itself lives in a private module, and a name users are told to filter or compare against has to be documented somewhere public.Added in version 1.0.0.
- Type:
- exception magnus.globaldefs.MixingAngleConventionWarning[source]
Bases:
UserWarningA parameter set is very probably not in the
anglesconvention it declared.Raised only where the mistake is diagnosable from the values themselves: sines handed to
angles='deg'are about fifty times too small to be angles, and the call would otherwise return a converged, unitary, entirely wrong probability rather than an error. A warning rather than an exception, for the same reason asmagnus.matter.DensityUnitWarning: the threshold reflects the mixing people currently study, not a law.Its own class so it can be silenced or promoted on its own:
import warnings import magnus.globaldefs as gd warnings.filterwarnings('error', category=gd.MixingAngleConventionWarning)
Added in version 1.0.0.
- exception magnus.globaldefs.BaselineUnitWarning[source]
Bases:
UserWarningA baseline was passed that looks like kilometers rather than eV-1.
Every length crossing this API is in natural units, so a baseline is \(L_{\rm km} \times\)
CONV_KM_TO_INV_EV, some 5.07e9 per kilometer. Passing the raw kilometer value does not fail: the call returns a converged, exactly unitary probability for a baseline a few meters long, which looks like an ordinary answer rather than a wrong one. Measured on the Sun, the radius in kilometres passed raw returns 1.000 at 20 MeV where the correct value is 0.29, and the survival probability comes out rising with energy, which is backwards for an MSW resonance.The threshold is
IMPLAUSIBLE_BASELINE_NATURAL_UNITS, about two meters in natural units, so a genuinely short baseline is still reachable without tripping it.Its own class so it can be silenced deliberately:
import warnings import magnus.globaldefs as gd warnings.filterwarnings('ignore', category=gd.BaselineUnitWarning)
Added in version 1.0.5.
- exception magnus.globaldefs.SterileMatterCompositionWarning[source]
Bases:
UserWarningA caller’s scalar builds the sterile matter entry from a different medium than the density.
An Earth chord takes its neutron-to-proton ratio from \(Y_e\) layer by layer for the density, and – by default – for the sterile states’ entry in the matter projector too, so out of the box the two describe the same medium and this warning has nothing to say. It fires when a caller passes a scalar
ratio_number_neutrons_to_protonsover layered composition: no scalar describes a chord that crosses iron and rock – near the sterile matter resonance the mismatch reaches ~0.4 in probability at 3+1 on a core-crossing chord, and the best possible scalar still leaves ~7e-3 – and it does so silently in the physics, since nothing else about the call looks wrong. With a uniformelectron_fractionoverride it fires only when the scalar contradicts the ratio that override implies.Its own class so it can be silenced once the choice has been made deliberately:
import warnings import magnus.globaldefs as gd warnings.filterwarnings('ignore', category=gd.SterileMatterCompositionWarning)
Three flavors never raise it: the projector’s sterile block is empty.
Added in version 1.0.0.
Changed in version 1.1.0: The default no longer warns – the projector follows the composition, which is the fix for the mismatch this class used to report. A scalar over layered \(Y_e\) now warns unconditionally: the old 2% threshold on \(r\) was measured to pass chords whose error matched the very figure the warning quoted.
- magnus.globaldefs.set_color_output(enabled: bool) None[source]
Enables or disables ANSI color in the warning/error/tolerance message prefixes.
The
*_IN_COLORconstants above wrap their text in ANSI escape codes, which read correctly in a terminal but appear as literal escape-code noise anywhere that does not interpret them – a captured log file, a Jupyter notebook rendered to HTML, or thejupyter-executecells in this package’s own documentation. Calling this function withFalserebinds every*_IN_COLORconstant to its plain-text counterpart, so the existing call sites (which all reference the*_IN_COLORnames) print unadorned text with no further change. Calling it withTruerestores the colored versions.Added in version 1.0.0.
- Parameters:
enabled (bool) – True to emit ANSI-colored message prefixes (the default at import time), False to emit plain text.
- Return type:
None
Examples
import magnus.globaldefs as gd gd.set_color_output(False) gd.WARNING_MSG_IN_COLOR
'Warning:'
- magnus.globaldefs.MAGNUS_MAX_PREDEFINED_NUM_FLAVORS = 5[source]
Module-level constant
Maximum number of flavors for which we have hard-coded routines in the oscprob module. Units: [Adimensional]
- Type:
- magnus.globaldefs.CONV_KM_TO_INV_EV = 5067730000.0[source]
Module-level constant
Multiplicative conversion factor from km to \(\text{eV}^{-1}\). Units: [\(\text{km}^{-1}~\text{eV}^{-1}\)].
- Type:
- magnus.globaldefs.UNIT_KM = 5067730000.0[source]
Module-level constant
Multiplicative conversion factor from km to \(\text{eV}^{-1}\). Alias for CONV_KM_TO_INV_EV. Units: [\(\text{km}^{-1}~\text{eV}^{-1}\)].
- Type:
- magnus.globaldefs.CONV_CM_TO_INV_EV = 50677.3[source]
Module-level constant
Multiplicative conversion factor from cm to \(\text{eV}^{-1}\). Units: [\(\text{cm}^{-1}~\text{eV}^{-1}\)]
- Type:
- magnus.globaldefs.UNIT_CM = 50677.3[source]
Module-level constant
Multiplicative conversion factor from cm to \(\text{eV}^{-1}\). Alias for CONV_CM_TO_INV_EV. Units: [\(\text{cm}^{-1}~\text{eV}^{-1}\)]
- Type:
- magnus.globaldefs.CONV_CM3_TO_INV_EV3[source]
Module-level constant
Multiplicative conversion factor from \(\text{cm}^{3}\) to \(\text{eV}^{-3}\). Units: [\(\text{cm}^{-3}~\text{eV}^{-3}\)]
- Type:
- magnus.globaldefs.UNIT_CM3[source]
Module-level constant
Multiplicative conversion factor from \(\text{cm}^{3}\) to \(\text{eV}^{-3}\). Alias for CONV_CM3_TO_INV_EV3. Units: [\(\text{cm}^{-3}~\text{eV}^{-3}\)]
- Type:
- magnus.globaldefs.CONV_INV_EV_TO_CM = 1.9732700834495916e-05[source]
Module-level constant
Multiplicative conversion factor from \(\text{eV}^{-1}\) to cm. Units: [eV cm]
- Type:
- magnus.globaldefs.UNIT_PER_CM3[source]
Module-level constant
Multiplicative conversion factor from \(\text{cm}^{-3}\) to \(\text{eV}^{3}\). Units: [\(\text{cm}^{3}~\text{eV}^{3}\)]
- Type:
- magnus.globaldefs.CONV_EV_TO_G = 1.783e-33[source]
Module-level constant
Multiplicative conversion factor from eV to grams: the mass equivalent of one eV. Units: [\(\text{g eV}^{-1}\)]
- Type:
- magnus.globaldefs.CONV_G_TO_EV = 5.608524957936063e+32[source]
Module-level constant
Multiplicative conversion factor from grams to eV, as a mass. Units: [\(\text{eV g}^{-1}\)]
- Type:
- magnus.globaldefs.UNIT_G_PER_CM3[source]
Module-level constant
Multiplicative conversion factor from \(\text{g cm}^{-3}\) to \(\text{eV}^{4}\). Units: [\(\text{g}^{-1}~\text{cm}^{3}~\text{eV}^{4}\)]
- Type:
- magnus.globaldefs.SQRT_OF_2[source]
Module-level constant
Square root of 2. Units: [Adimensional]
- Type:
- magnus.globaldefs.GF = 1.1663787e-23[source]
Module-level constant
Fermi constant. Units: [\(\text{eV}^{-2}\)]
- Type:
- magnus.globaldefs.MASS_ELECTRON = 510998.9461[source]
Module-level constant
Electron mass. Units: [eV]
- Type:
- magnus.globaldefs.MASS_PROTON = 938272046.0[source]
Module-level constant
Proton mass. Units: [eV]
- Type:
- magnus.globaldefs.MASS_NEUTRON = 939565379.0[source]
Module-level constant
Neutron mass. Units: [eV]
- Type:
- magnus.globaldefs.ELECTRON_FRACTION_EARTH_CRUST = 0.5[source]
Module-level constant
Electron fraction in the Earth’s crust. Units: [Adimensional]
- Type:
- magnus.globaldefs.DENSITY_MATTER_CRUST_G_PER_CM3 = 3.0[source]
Module-level constant
Average matter density in the Earth’s crust. Units: [\(\text{g cm}^{-3}\)]
- Type:
- magnus.globaldefs.N_AV = 6.02214076e+23[source]
Module-level constant
Avogadro constant Units: [\(\text{mol}^{-1}\)]
- Type:
- magnus.globaldefs.NUM_DENSITY_E_EARTH_CRUST[source]
Module-level constant
Electron number density in the Earth’s crust. The mean nucleon mass is taken as \((m_p + m_n)/2\), not the atomic mass unit, which puts this about 0.8% below the textbook \(\rho N_A Y_e\);
VCC_EARTH_CRUSTinherits the same convention. Units: [\(\text{eV}^{3}\)]- Type:
- magnus.globaldefs.VCC_EARTH_CRUST[source]
Module-level constant
Charged-current matter potential in the Earth’s crust. Units: [eV]
- Type:
- magnus.globaldefs.EARTH_RADIUS = 6371.0[source]
Module-level constant
Average Earth radius. Units: [km]
- Type:
- magnus.globaldefs.SUN_RADIUS = 695700.0[source]
Module-level constant
Nominal solar radius, IAU 2015 Resolution B3.
L_SCALE_SUNis derived from it, so every solar scale height and baseline in the package follows it. Units: [km]- Type:
- magnus.globaldefs.NUM_DENSITY_E_SUN_CENTRAL[source]
Module-level constant
Normalization of the standard exponential fit to the solar electron number density, \(n_e(r) = 245\,N_A\,\exp(-10.54\,r/R_\odot)\ \text{cm}^{-3}\).
This is the \(r \to 0\) intercept of that fit, not the central density of a solar model. The two differ by more than a factor of two: the BS2005-AGS,OP table gives \(n_e = 102.7\,N_A\ \text{cm}^{-3}\) at its innermost point \(r = 0.0016\,R_\odot\), against the fit’s 245, because the real profile flattens towards the center while an exponential does not. Measured against that table across the whole star:
\(r/R_\odot\)
largest departure from it
0.00 – 0.05
fit high by 2.4x
0.05 – 0.10
fit high by 1.6x
0.10 – 0.20
21 %
0.20 – 0.30
2.5 %
0.30 – 0.70
11 %
0.70 – 1.00
up to 89 %
So the fit is a few-percent description only in a band around \(0.2\,R_\odot\), and the scale height
L_SCALE_SUN– the span the package’s own diagnostics use as a trajectory – lies at \(0.095\,R_\odot\), where the fit is high by about 30 %. It is still the right constant for the exponential profile it normalizes; what would be wrong is reading it as a measurement of the Sun’s central density, or the exponential as a stand-in for a tabulated model in the core.Units: [\(\text{eV}^{3}\)]
- Type:
- magnus.globaldefs.L_SCALE_SUN = 334499028557874.75[source]
Module-level constant
Scale height of the solar electron number density, \(R_\odot/10.54\), the decay length of the exponential fit normalized by
NUM_DENSITY_E_SUN_CENTRAL.Units: [\(\text{eV}^{-1}\)]
- Type:
- magnus.globaldefs.NUE = 0[source]
Module-level constant
Index used to denote nu_e flavor when computing probabilities. Units: [Adimensional]
- Type:
- magnus.globaldefs.NUMU = 1[source]
Module-level constant
Index used to denote nu_mu flavor when computing probabilities. Units: [Adimensional]
- Type:
- magnus.globaldefs.NUTAU = 2[source]
Module-level constant
Index used to denote nu_tau flavor when computing probabilities. Units: [Adimensional]
- Type:
- magnus.globaldefs.NUS = 3[source]
Module-level constant
Index used to denote the sterile flavor when computing four-neutrino (3+1) probabilities. Units: [Adimensional]
- Type:
- magnus.globaldefs.NUS1 = 3[source]
Module-level constant
Index used to denote the first sterile flavor when computing five-neutrino (3+2) probabilities. Units: [Adimensional]
- Type:
- magnus.globaldefs.NUS2 = 4[source]
Module-level constant
Index used to denote the second sterile flavor when computing five-neutrino (3+2) probabilities. Units: [Adimensional]
- Type:
- magnus.globaldefs.UNIT_KEV = 1000.0[source]
Module-level constant
One keV, in eV. Multiply by it to turn a number of keV into the eV every entry point expects:
1.0*gd.UNIT_KEVis one keV. Units: [\(\text{eV keV}^{-1}\)]- Type:
- magnus.globaldefs.UNIT_MEV = 1000000.0[source]
Module-level constant
One MeV, in eV. Multiply by it to turn a number of MeV into the eV every entry point expects:
1.0*gd.UNIT_MEVis one MeV. Units: [\(\text{eV MeV}^{-1}\)]- Type:
- magnus.globaldefs.UNIT_GEV = 1000000000.0[source]
Module-level constant
One GeV, in eV. Multiply by it to turn a number of GeV into the eV every entry point expects:
1.0*gd.UNIT_GEVis one GeV. Units: [\(\text{eV GeV}^{-1}\)]- Type:
- magnus.globaldefs.UNIT_TEV = 1000000000000.0[source]
Module-level constant
One TeV, in eV. Multiply by it to turn a number of TeV into the eV every entry point expects:
1.0*gd.UNIT_TEVis one TeV. Units: [\(\text{eV TeV}^{-1}\)]- Type:
- magnus.globaldefs.UNIT_PEV = 1000000000000000.0[source]
Module-level constant
One PeV, in eV. Multiply by it to turn a number of PeV into the eV every entry point expects:
1.0*gd.UNIT_PEVis one PeV. Units: [\(\text{eV PeV}^{-1}\)]- Type:
- magnus.globaldefs.UNIT_EEV = 1e+18[source]
Module-level constant
One EeV, in eV. Multiply by it to turn a number of EeV into the eV every entry point expects:
1.0*gd.UNIT_EEVis one EeV. Units: [\(\text{eV EeV}^{-1}\)]- Type:
- magnus.globaldefs.S12_NO_BF_NUFIT_6_0[source]
Module-level constant
Lepton mixing angle \(\sin\theta_{12}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [Adimensional]
- Type:
- magnus.globaldefs.S23_NO_BF_NUFIT_6_0[source]
Module-level constant
Lepton mixing angle \(\sin\theta_{23}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [Adimensional]
- Type:
- magnus.globaldefs.S13_NO_BF_NUFIT_6_0[source]
Module-level constant
Lepton mixing angle \(\sin\theta_{13}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [Adimensional]
- Type:
- magnus.globaldefs.DCP_NO_BF_NUFIT_6_0[source]
Module-level constant
Lepton CP-violation phase \(\delta_\text{CP}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [radian]
- Type:
- magnus.globaldefs.D21_NO_BF_NUFIT_6_0 = 7.49e-05[source]
Module-level constant
Mass-squared difference \(\Delta m_{21}^2\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]
- Type:
- magnus.globaldefs.D31_NO_BF_NUFIT_6_0 = 0.002513[source]
Module-level constant
Mass-squared difference \(\Delta m_{31}^2\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]
- Type:
- magnus.globaldefs.S12_IO_BF_NUFIT_6_0[source]
Module-level constant
Lepton mixing angle \(\sin\theta_{12}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [Adimensional]
- Type:
- magnus.globaldefs.S23_IO_BF_NUFIT_6_0[source]
Module-level constant
Lepton mixing angle \(\sin\theta_{23}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [Adimensional]
- Type:
- magnus.globaldefs.S13_IO_BF_NUFIT_6_0[source]
Module-level constant
Lepton mixing angle \(\sin\theta_{13}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [Adimensional]
- Type:
- magnus.globaldefs.DCP_IO_BF_NUFIT_6_0[source]
Module-level constant
Lepton CP-violation phase \(\delta_\text{CP}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [radian]
- Type:
- magnus.globaldefs.D21_IO_BF_NUFIT_6_0 = 7.49e-05[source]
Module-level constant
Mass-squared difference \(\Delta m_{21}^2\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]
- Type:
- magnus.globaldefs.D32_IO_BF_NUFIT_6_0 = -0.002484[source]
Module-level constant
Mass-squared difference \(\Delta m_{32}^2\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]
- Type:
- magnus.globaldefs.D31_IO_BF_NUFIT_6_0 = -0.0024091[source]
Module-level constant
Mass-squared difference \(\Delta m_{31}^2\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]
- Type:
- magnus.globaldefs.EPS_EE = 0.06[source]
Module-level constant
Total NSI strength parameter eps_ee computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]
- Type:
- magnus.globaldefs.EPS_EM = -0.06[source]
Module-level constant
Total NSI strength parameter eps_em computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]
- Type:
- magnus.globaldefs.EPS_ET = 0.0[source]
Module-level constant
Total NSI strength parameter eps_et computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]
- Type:
- magnus.globaldefs.EPS_MM = 1.2[source]
Module-level constant
Total NSI strength parameter eps_mm computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]
- Type:
- magnus.globaldefs.EPS_MT = 0.0[source]
Module-level constant
Total NSI strength parameter eps_mt computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]
- Type:
- magnus.globaldefs.EPS_TT = 0.0[source]
Module-level constant
Total NSI strength parameter eps_tt computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]
- Type:
- magnus.globaldefs.EPS_2[source]
Module-level constant
Vector of total NSI strength parameters for two-neutrino oscillations. Units: [Adimensional]
- magnus.globaldefs.EPS_3[source]
Module-level constant
Vector of total NSI strength parameters for three-neutrino oscillations. Units: [Adimensional]
- magnus.globaldefs.SXI12 = 0.0[source]
Module-level constant
LIV lepton mixing angle sin(xi_12). Units: [Adimensional]
- Type:
- magnus.globaldefs.SXI23 = 0.0[source]
Module-level constant
LIV lepton mixing angle sin(xi_23). Units: [Adimensional]
- Type:
- magnus.globaldefs.SXI13 = 0.0[source]
Module-level constant
LIV lepton mixing angle sin(xi_13). Units: [Adimensional]
- Type:
- magnus.globaldefs.DXICP = 0.0[source]
Module-level constant
LIV CP-violation phase. Units: [radian]
- Type:
- magnus.globaldefs.LAMBDA = 1000000000000.0[source]
Module-level constant
LIV energy scale Lambda. Units: [eV]
- Type:
- magnus.globaldefs.load_nufit_params(version='NuFIT 6.1', ordering='NO', category=None, angles='sin')[source]
Load standard three-flavor mixing parameters from a NuFIT global fit.
Looks up
NUFIT_GLOBAL_FITSfor the requested release, mass ordering, and (release-specific) secondary category, and returns them as a plain dict with the same parameter names used throughout Magnus (s12,s23,s13,dCP,D21,D31), so the result can be passed directly as keyword arguments to anyosc_prob_3nu_*function (or to the builders inmagnus.hamiltonians.hamiltonians3nuand other functions that take the same standard-oscillation parameter names).- Parameters:
version (str, optional) – NuFIT release to load, e.g.
'NuFIT 6.1','NuFIT 5.2','NuFIT 1.0'. SeeNUFIT_GLOBAL_FITS.keys()for the full list of available releases (v1.0 through v6.1). Default:'NuFIT 6.1'(the latest release at the time of writing).ordering (str, optional) – Neutrino mass ordering:
'NO'(normal) or'IO'(inverted). Default:'NO'.category (str or None, optional) – Release-specific secondary category (e.g.
'with_SK'/'without_SK'for v4.0+,'LEM'/'LID'for v2.1,'free_fluxes_rsbl'/'huber_fluxes_no_rsbl'for v1.0-v1.3). IfNone(default), the release’s preferred/primary category is used (for releases with awith_SK/without_SKsplit, this is'with_SK'). SeeNUFIT_GLOBAL_FITS[version]['categories'].keys()for the categories available for a given release. Default: None.angles (str, optional) –
Convention the three mixing angles are returned in:
'sin'(default) their sines,'sin2'their sines squared – which is the form NuFIT itself reports –'rad'the angles in radians, or'deg'in degrees. Under'deg'dCPis converted too.Pass the same value here that you pass to the probability function. The two are one setting in two places:
osc_prob_3nu_earth(E, **load_nufit_params(), angles='deg')reads perfectly and is silently wrong, because the loader’s sines (0.15 to 0.85) are then interpreted as degrees, about fifty times too small. The result is a converged, unitary, entirely wrong probability. The guard inmagnus.hamiltonians.hamiltonians3nu.hamiltonian_3nu_vacuum_energy_independent()catches that particular pairing, but the reliable fix is to state the convention once and use it on both calls.
- Returns:
Dict with keys
s12,s23,s13,dCP,D21andD31. The three angles are in whichever conventionanglesnames – by default their sines, adimensional – anddCPis in radians unlessangles='deg', which puts it in degrees.D21andD31are always \(\text{eV}^{2}\).- Return type:
- Raises:
ValueError – If
versionis not a known NuFIT release, iforderingis not'NO'or'IO', ifcategoryis not one of the categories available forversion, or ifanglesis not one ofANGLE_CONVENTIONS.
Examples
Load a release and feed it straight into a probability function (the code below runs when these docs are built, so the output shown is always current):
import magnus.globaldefs as gd import magnus.oscprob as oscprob params = gd.load_nufit_params('NuFIT 6.1', ordering='NO') sorted(params.keys())
['D21', 'D31', 'dCP', 's12', 's13', 's23']
oscprob.osc_prob_3nu_vacuum(1.0 * gd.UNIT_GEV, 100.0 * gd.UNIT_KM, **params)
array([[0.99147795, 0.00323398, 0.00528806], [0.0034939 , 0.90719742, 0.08930869], [0.00502815, 0.0895686 , 0.90540325]])Comparing normal- and inverted-ordering best fits from an older release:
no = gd.load_nufit_params('NuFIT 4.0', ordering='NO', category='with_SK') io = gd.load_nufit_params('NuFIT 4.0', ordering='IO', category='with_SK') no['D31'] > 0 and io['D31'] < 0
True
Added in version 1.0.0.