Printing variables¶
Recursive variable list may be printed to the terminal by the gna.parameters.printer
module. The
print_parameters(ns)
function accepts the namespace to print:
from gna.parameters.printer import print_parameters
print_parameters( env.globalns )
The example output from the tests/bundle/detector_dbchain.py
(line 98):
Variables in namespace ''
weight_nominal = 1 │ [fixed]
weight_pull0 = 0 │ 0± 1
weight_pull1 = 0 │ 0± 1
weight_pull2 = 0 │ 0± 1
weight_pull3 = 0 │ 0± 1
Eres_a = 0.014764 │ 0.014764± 0.0044292 [ 30%]
Eres_b = 0.0869 │ 0.0869± 0.02607 [ 30%]
Eres_c = 0.0271 │ 0.0271± 0.00813 [ 30%]
Variables in namespace 'AD11'
OffdiagScale = 1 │ 1± 0.04 [ 4%]
escale = 1 │ 1± 0.002 [ 0.2%]
Variables in namespace 'AD21'
OffdiagScale = 1 │ 1± 0.04 [ 4%]
escale = 1 │ 1± 0.002 [ 0.2%]
Variables in namespace 'AD31'
OffdiagScale = 1 │ 1± 0.04 [ 4%]
escale = 1 │ 1± 0.002 [ 0.2%]
- This example prints the variables of the bundlechain_v01 bundle:
- Global namespace with
5 energy scale parameters: 1 fixed and 4 correction weights,
3 energy resolution parameters.
- Three nested namespaces for the detectors
AD11
,AD21
andAD31
with IAV off-diagonal scale parameter,
Linear scale correction.
- Three nested namespaces for the detectors
- The following columns are printed:
Variable name.
Current value.
Central value or
[fixed]
.Standard deviation.
Relative deviation if central value is nonzero.