Scheduled maintenance on Monday 2019-06-24 between 10:00-11:00 CEST

Commit e77b5d08 authored by Lukas Platz's avatar Lukas Platz

polishing a bit (docstrings, refactoring)

parent 81c7d4bf
Pipeline #44427 passed with stages
in 8 minutes and 39 seconds
......@@ -169,10 +169,11 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, za=None, zq=None,
iv : float
Prior standard deviation of y-intercept of power law.
za : float, optional
The alpha-parameter of the inverse-gamma distribution.
Setting the a seperate prior on the zeroGmode of the amplitude model.
Parameter of the optional zero mode prior (inverse-gamma): alpha
See :class:`InverseGammaOperator` for interpretation.
zq : float, optional
The q-parameter of the inverse-gamma distribution.
Parameter of the optional zero mode prior (inverse-gamma): q
See :class:`InverseGammaOperator` for interpretation.
Returns
-------
......@@ -192,6 +193,7 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, za=None, zq=None,
if za != None and zq != None:
separate_zero_mode_prior = True
za, zq = float(za), float(zq)
print(keys[2] + " mean: ", (zq/(1+za)))
else:
separate_zero_mode_prior = False
if za != None or zq != None:
......@@ -220,14 +222,13 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, za=None, zq=None,
return et @ loglog_ampl.exp()
else:
zero_mode = ValueInserter(et.target, (0,)*len(et.target.shape))
zero_mode = zero_mode @ InverseGammaOperator(
zero_mode.domain, za, zq) @ FieldAdapter(
zero_mode.domain, keys[2])
mask = np.ones(et.target.shape)
mask[(0,)*len(et.target.shape)] = 0.
mask = from_global_data(et.target, mask)
mask = DiagonalOperator(mask)
zero_mode = zero_mode @ InverseGammaOperator(
zero_mode.domain, za, zq) @ FieldAdapter(
zero_mode.domain, keys[2])
print(keys[2] + " mean: ", (zq/(1+za)))
return mask @ (et @ loglog_ampl.exp()) + zero_mode
return mask @ et @ loglog_ampl.exp() + zero_mode
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment