API for the glworia.amp.amplification_factor
module
amplification_computation_for_interpolation(T_funcs, helper_funcs, crit_funcs, y, lens_params, **kwargs)
Compute the contour integral for constructing interpolation tables of the time domain amplification factor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
T_funcs |
Dict[str, Callable]
|
A dictionary of functions derived from the Fermat potential needed for computing the amplification factor. |
required |
helper_funcs |
Dict[str, Callable]
|
A dictionary of helper functions needed for the numerical implementation. |
required |
crit_funcs |
Dict[str, Callable]
|
A dictionary of functions for computing the caustic curve. |
required |
y |
ndarray
|
The 2D impact parameter. For now the second component is not used. |
required |
lens_params |
ndarray
|
The lens model parameter. For now only one parameter is supported. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
im_x_init_low |
float
|
The lower bound for the initial guess of the image position. |
im_x_init_high |
float
|
The upper bound for the initial guess of the image position. |
im_x_init_num |
int
|
The number of initial guesses of the image position. |
im_screen_round_decimal |
int
|
The number of decimal places to round the image position. |
T0_max |
float
|
The maximum value of the time delay to compute the time domain amplification up to. |
crit_run |
bool
|
Whether the run corresponds to a run on the caustic. |
N |
int
|
The number of interpolation node in time in each segment. |
return_all |
bool
|
Whether to return all the computed values for debugging. |
singular |
bool
|
Whether the center of the lens is singular, i.e. a cusp or a pole in the time delay function. |
origin_type |
Callable
|
A function that returns the origin type of the lens model (cusp, pole or regular). |
y_crit_override |
Callable
|
A function that overrides the computed values of the caustic curve. |
x_im_nan_sub |
Callable
|
A function that substitutes |
add_to_strong |
Callable
|
A function decides whether to add certain points to the strong lensing regime. |
T_vir_low_bound |
float
|
The lower bound in time delay when searching for the maximum point of the time domain amplification. |
Returns:
Name | Type | Description |
---|---|---|
contour_int |
contour_integral
|
The contour integral object. |
T0_min_out_segs |
list[ndarray]
|
The corresponding time delays of the interpolation nodes for contour lines around the minimum. Each element of the list corresponds to a segment. |
T0_arr_sad_max |
ndarray
|
The corresponding time delays of the interpolation nodes for contour lines around the maximum point. |
x_im |
ndarray
|
The image positions. |
T_val_max |
float
|
The time delay at the maximum value of the time domain amplification. |
amplification_computation_prep(Psi, **kwargs)
Constructs the functions needed for computing the amplification factor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Psi |
Callable
|
The Fermat potential of the lens model. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
h |
float
|
The step size for numerical differentiation. |
newt_tol |
float
|
The tolerance for the Newton's method. |
newt_max_iter |
int
|
The maximum number of iterations for the Newton's method. |
bisect_tol |
float
|
The tolerance for the bisection method. |
Returns:
Name | Type | Description |
---|---|---|
T_funcs |
Dict[str, Callable]
|
A dictionary of functions needed for computing the amplification factor. |
helper_funcs |
Dict[str, Callable]
|
A dictionary of helper functions needed for computing the amplification factor. |
chev_first_half(a, b, n)
Returns the first n points out of 2*n Chebyshev points, with the n points covering the interval [a, b].
chev_points(a, b, n)
Returns n Chebyshev points in the interval [a, b].
compute_F(w_interp, y, lens_params, T_funcs, helper_funcs, crit_funcs, N, T0_max, crit_run=False, singular=False, origin='regular', **kwargs)
Compute the amplification factor in the frequency domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
w_interp |
ndarray
|
The frequencies to compute the amplification factor. |
required |
y |
ndarray
|
The 2D impact parameter. For now the second component is not used. |
required |
lens_params |
ndarray
|
The lens model parameter. For now only one parameter is supported. |
required |
T_funcs |
Dict[str, Callable]
|
A dictionary of functions derived from the Fermat potential needed for computing the amplification factor. |
required |
helper_funcs |
Dict[str, Callable]
|
A dictionary of helper functions needed for the numerical implementation. |
required |
crit_funcs |
Dict[str, Callable]
|
A dictionary of functions for computing the caustic curve. |
required |
N |
int
|
The number of interpolation node in time in each segment. |
required |
T0_max |
float
|
The maximum value of the time delay to compute the time domain amplification up to. |
required |
crit_run |
bool
|
Whether the run corresponds to a run on the caustic. |
False
|
singular |
bool
|
Whether the center of the lens is singular, i.e. a cusp or a pole in the time delay function. |
False
|
origin |
str
|
The origin type of the lens model (cusp, pole or regular). |
'regular'
|
Other Parameters:
Name | Type | Description |
---|---|---|
N_fft |
int
|
The number of points in the Fast Fourier Transform. |
t_fft_short_max_fac |
float
|
The factor determining the maximum value of the time delay to compute the amplification factor in the short time regime. |
t_fft_long_max_fac |
float
|
The factor determining the maximum value of the time delay to compute the amplification factor in the long time regime. |
w_trans_weak_fac |
List[float]
|
The transition frequencies between different FFT regimes and geometrical optics for the weak lensing regime. |
w_trans_strong_fac |
List[float]
|
The transition frequencies between different FFT regimes and geometrical optics for the strong lensing regime. |
sig_fac |
float
|
The width of the transition region. |
**kwargs |
Additional keyword arguments passed to |
Returns:
Name | Type | Description |
---|---|---|
F_interp |
ndarray
|
The interpolated amplification factor. |
F_interp_raw |
List[ndarray]
|
A list of the amplification factor from the different FFT regimes, for debugging. |
contour_obj |
contour_integral
|
The contour integral object. |
partitions |
ndarray
|
The transition frequencies. |