gravelamps.lensing.nfw

Navarro, Frenk, White (NFW) Lensing Functions

Following are functions performing calculations for a Navarro, Frenk, White lens mass density profile model. The module backend is based in libnfw.

Written by Mick Wright 2022

Globals

_cdllctypes.CDLL

Library of C++ functions necessary for calculations

_additional_argumentslist of str

Additional arguments required to construct interpolator data

_additional_argument_typeslist of types

Types of the arguments that are given above

_lens_parameterslist of str

Parameters used for the model

_SCALINGfloat

Scaling constant used in the NFW profile

_CRITICAL_VALUEfloat

Critical value of source position for scale.

_phase_interpolatorCallable[[float], ArrayLike]

Interpolating function to calculate morse phase for source position

_image_position_interpolatorCallable[[float], ArrayLike]

Interpolating function to calculate the image position for source position

_amplification_factor_interpolatorCallable[[float], ArrayLike]

Interpolating function for the region of amplification factor that is a single value i.e. above the critical value of source position

Routines

__calculate_critical_value__

Calculates critical value of source position

__generate_phase_interpolator__

Generate interpolator for phase required for zero minimum time delay

__genrate_image_position_interpolator__

Generate interpolator for the image value. Valid only below the critical value

__generate_amplification_factor_interpolator__

Generate interpolator for the amplification factor in the single value regime. Valid only above the critical value of the source position.

set_scaling

Set the value of _SCALING and regenerate the critical value and the interpolator functions

find_image_positions

Calculates the position of the lensed images

min_time_delay_phase

Calculats the value of the phase required for zero minimum time delay

complete_amplification_factor

Calculates geometric optics amplification factor with no additional information

amplification_factor

Calculates geometric optics amplification factor using the pregenerated interpolators where possible

generate_interpolator_data

Generates the amplification factor data files for use in interpolator generation

Functions

set_scaling(scaling_constant)

Set the value of _SCALING and regenerate the critical value and interpolator functions.

find_image_positions(source_position)

Calculates the position of the lensed images

min_time_delay_phase(source_position)

Calculates the value of the phase required for zero minimum time delay

complete_amplification_factor(dimensionless_frequency, ...)

Calculates geometric optics amplification factor with no additional information

amplification_factor(dimensionless_frequency_array, ...)

Calculates geometric optics amplification factor using the pregenerated information where

generate_interpolator_data(config, args, file_dict)

Generates the amplification factor data files for use in interpolator generation

Module Contents

gravelamps.lensing.nfw.set_scaling(scaling_constant: float)

Set the value of _SCALING and regenerate the critical value and interpolator functions.

Parameters:
scaling_constantfloat

Value to set the scaling constant to

gravelamps.lensing.nfw.find_image_positions(source_position)

Calculates the position of the lensed images

This calculation is done using the C++ function ImagePositionArray within libnfw. That function solves the lens equation to yield the positions of the lensed images.

Parameters:
source_positionfloat

Dimensionless displacement from the optical axis

Returns:
position_arrayArray of floats

Positions of the images resulting from the lens equation

gravelamps.lensing.nfw.min_time_delay_phase(source_position)

Calculates the value of the phase required for zero minimum time delay

This calculation is done using the C++ function MinTimeDelayPhaseReal within libnfw which calculates the real value of the phase required for a minimum time delay of zero for the given scaling.

Parameters:
source_positionfloat

Dimensionless displacement from the optical axis

Returns:
phasefloat

Phase required for zero minimum time delay

gravelamps.lensing.nfw.complete_amplification_factor(dimensionless_frequency, source_position)

Calculates geometric optics amplification factor with no additional information

The calculation is done using the C++ function AFGRealOnly within libnfw. This calculation does not require additional information beyond of a value of _SCALING. As a consequence it is always complete, but is not as computationally efficient compared to amplification_factor.

Parameters:
dimensionless_frquencyfloat

Dimensionless form of the frequency of interest

source_positionfloat

Dimensionless displacement from the optical axis

Returns:
amplification_valuecomplex

Amplification of signal produced by lensing

gravelamps.lensing.nfw.amplification_factor(dimensionless_frequency_array, source_position)

Calculates geometric optics amplification factor using the pregenerated information where possible.

This calculation has been designed to be more efficient than complete_amplification_factor by using the pregnenerated interpolating functions. Above a source position of _CRITICAL_VALUE it will use the single value _amplification_factor_interpolator. Below, it will use the C++ function SimpleAmpFac which will take in the image positions and phase computed from the relevant interpolators.

Parameters:
dimensionless_frquency_arrayArray of floats

Dimensionless form of the frequencies of interest

source_positionfloat

Dimensionless displacement from the optical axis

Returns:
amplification_arrayArray of complex

Amplification of signal produced by lensing over specified grid

gravelamps.lensing.nfw.generate_interpolator_data(config, args, file_dict)

Generates the amplification factor data files for use in interpolator generation

This is done via the C++ GenerateLensData function within libnfw. It will read in the specified grid files and fill the data files with the appropraite values of amplification factor. This can be done in wave and geometric optics.

Parameters:
configconfigparser.ConfigParser

Object containing settings from user INI file

argsargparse.Namespace

Object containing commandline arguments to program

file_dictdict

Contains paths to the interpolator grid and data files to fill