C version - Base object
- class glow.freq_domain_c.FwGeneral_C(It, p_prec={})
Base class for the amplification factor.
- Parameters:
- ItItGeneral subclass
Time-domain integral object.
- p_precdict, optional
Precision parameters.
- Attributes:
- lensPsiGeneral subclass
Lens object.
- ItItGeneral subclass
Time-domain integral object.
- p_precdict
Default precision parameters updated with the input. Default keys:
C_prec
(dict) – Optional dictionary to change the precision parameters in the C code.interp_fill_value
– Behaviour of the interpolation function outside the interpolation range. Options:None: Raise an error if extrapolation is attempted.
float: Extrapolate with a constant value.
'extrapolate'
: Linear extrapolation.
interp_kind
(str) – Interpolation method. Any kind recognized by Scipy is allowed. In particular:'linear'
'cubic'
reg_stage
(int) – Regularization of \(I(\tau)\). Possible values:0
: No regularization performed.1
: Initial step function at \(\tau=0\), saddle points and local minima/maxima regularized.2
: All of the above, plus regularization of the long-tails, assuming \(I(\tau\to\infty)\sim A_2/\tau^{\sigma_2}\). It can be computed analytically if we have enough information about the lens, otherwise it is obtained with a numerical fit.3
: All of the above, plus regularization of the initial slope at \(\tau=0\) and the second order tails, assuming \(I(\tau\to\infty)\sim A_2/\tau^{\sigma_2} + A_3/\tau^{\sigma_3}\). Both are obtained by fitting \(I(\tau)\).
- reg_schdict
Regularization scheme. Keys:
stage
(int) – Regularization stage computed. The regularization stage that will be actually used is the value set inp_prec['reg_stage']
.p_crits
(dict) – Critical points. Content ofIt.p_crits
.slope
(float) – Slope at \(\tau=0\).amp
(list) – Asymptotic amplitudes \(A_2\) and \(A_3\).index
(list) – Asymptotic indices \(\sigma_2\) and \(\sigma_3\).
- namestr
(subclass defined) Name of the method.
- w_grid, Fw_gridarray
(subclass defined) Grid of points where \(F(w)\) has been computed.
- eval_Fwfunc(float or array) -> complex or array
(subclass defined) Final function to evaluate \(F(w)\).
- eval_Fw_regfunc(float or array) -> complex or array
(subclass defined) Evaluate the regular part of \(F(w)\), i.e. \(F_\text{reg}=F-F_\text{sing}\).
- eval_It_regfunc(float or array) -> float or array
(subclass defined) Evaluate the regular part of \(I(\tau)\), i.e. \(I_\text{reg}=I-I_\text{sing}\).
Methods
__call__
(w)Call
eval_Fw()
.Check the input upon initialization.
(subclass defined, optional) Check the input of the implementation.
Fill the default parameters.
(subclass defined) Initialize the default parameters.
Print the C precision parameters in human-readable form.
Print internal information in human-readable form.
eval_Fw_sing
(w[, stage, parallel])Singular contribution to \(F(w)\).
eval_It_sing
(tau[, stage, parallel])Singular contribution to \(I(\tau)\).
Get the precision parameters currently used in the C code.
interpolate
(xs, ys)Construct an interpolation function using the options in
p_prec
.- default_general_params()
Fill the default parameters.
Update the precision parameters common for all methods and then call
default_params()
(subclass defined).- Returns:
- p_precdict
Default precision parameters.
- check_general_input()
Check the input upon initialization.
It first calls
check_input()
(subclass defined) to perform any checks that the user desires. It then checks that the input only updates existing keys inp_prec
, otherwise throws a warning.The idea is that we do not use a wrong name that is then ignored.
- Warns:
- TimeDomainWarning
Warning
If the subclass will add a new parameter without an entry in
default_params()
, it must be manually added toself.p_prec_default_keys
incheck_input()
withself.p_prec_default_keys.add(new_key)
.
- display_info()
Print internal information in human-readable form.
- get_Cprec()
Get the precision parameters currently used in the C code.
- Returns:
- Cprecdict
Precision parameters.
- display_Cprec()
Print the C precision parameters in human-readable form.
- interpolate(xs, ys)
Construct an interpolation function using the options in
p_prec
.- Parameters:
- xs, ysfloat, complex or array
Values to interpolate.
- Returns:
- interp_funcfunc(array) -> array
Interpolation function.
- eval_It_sing(tau, stage=None, parallel=False)
Singular contribution to \(I(\tau)\).
- Parameters:
- taufloat or array
\(\tau\).
- stageint or None
- parallelbool
- Returns:
- Itfloat or array
\(I_\text{sing}(\tau)\).
- eval_Fw_sing(w, stage=None, parallel=False)
Singular contribution to \(F(w)\).
- Parameters:
- wfloat or array
\(w\).
- stageint or None
- parallelbool
- Returns:
- Fwfloat or array
\(F_\text{sing}(w)\).
- check_input()
(subclass defined, optional) Check the input of the implementation.
- default_params()
(subclass defined) Initialize the default parameters.