gravelamps/models/navarro-frenk-white.h¶
Functions
-
std::complex<double> LensingPotential(std::complex<double> image_position, double scaling_constant)¶
Computes the lensing potential
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> TimeDelay(double image_position, double source_position, double scaling_constant, double min_phase)¶
Computes the dimensionless time delay
- Parameters:
image_position – Dimensionless displacement of the image
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
min_phase – Phase required to have minimal time delay of zero
-
std::complex<double> MinimumPhase(double source_position, double scaling_constant)¶
Computes the phase required for the minimum time delay to be zero
- Parameters:
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
-
void KFunctionSourceExp(acb_t source_exp, double dimensionless_frequency, double source_position, double minimum_phase, slong precision)¶
Computes the source position component of the K function used in the calculation of the amplification factor in the wave optics regime. Exponentiation is done using arbitrary precision
- Parameters:
source_exp – Arbitrary precision object to hold the value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
minimum_phase – Phase required for minimal time delay of zero
precision – Number of bits of precision to use for calculation
-
void KFunctionBessel(acb_t bessel, double dimensionless_frequency, double source_position, std::complex<double> modified_image_position, slong precision)¶
Computes the bessel function component of the K function used in the calculation of the amplification factor in the wave optics regime. Bessel function is calculated using arbitrary precision
- Parameters:
bessel – Arbitrary precision object to hold the value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
modified_image_position – Modified dimensionless displacement of the image. Given by sqrt(2*image_position).
precision – Number of bits of precision to use for calculation
-
void KFunctionPotentialExp(acb_t potential_exp, double dimensionless_frequency, std::complex<double> modified_image_position, double scaling_constant, slong precision)¶
Computes the lensing potential component of the K function used in the calculation of the amplification factor in the wave optics regime. Exponentiation is done using arbitrary precision.
- Parameters:
potential_exp – Arbitrary precision object to hold the value
dimensionless_frequency – Dimensionless frequency
modified_image_position – Modified dimensionless displacement 2of the image. Given by sqrt(2*image_position).
scaling_constant – Scale factor for the NFW profile
precision – Number of bits of precision to use for calculation
-
void KFunction(acb_t k_func, double dimensionless_frequency, double source_position, std::complex<double> modified_image_position, double scaling_constant, double minimum_phase, slong precision)¶
Computes the K function used in the calculation of the amplification factor in the wave optics regime. Calculation is in part done using arbitrary precision.
- Parameters:
k_func – Arbitrary precision object to hold the value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
modified_image_position – Modified dimensionless displacement of the image. Given by sqrt(2*image_position).
scaling_constant – Scale factor for the NFW profile
minimum_phase – Phase required for minimal time delay of zero
precision – Number of bits of precision to use for calculation
-
int Integrand(acb_ptr integrand, const acb_t integration_parameter, void *parameter_set, slong order, slong precision)¶
Computes integrand used in the calculation of the amplification factor in the wave optics regime. Calculation is in part done using arbitrary precision.
- Parameters:
integrand – Pointer to arbitrary precision object containing value
integration_parameter – Arbitrary precision object containing integration parameter
parameter_set – Additional variable data for the function
order – Unused but required to fill requirements for arbitrary precision integration
precision – Number of bits of precision to use for calculation
-
void WaveAmpIntegration(acb_t integral, double dimensionless_frequency, double source_position, double scaling_constant, double integration_limit, double minimum_phase, slong precision)¶
Computes the integration that is the primary term of the amplification factor in the wave optics regime. Calculation is in part done using arbitrary precision
- Parameters:
integral – Arbitrary precision object containing value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
integration_limit – Upper limit on the integration
minimum_phase – Phase required for minimal time delay to be zero
precision – Number of bits of precision to use for calculation
-
void FirstCorrection(acb_t correction, double dimensionless_frequency, double source_position, double integration_limit, double scaling_contant, double minimum_phase, slong precision)¶
Computes the first correction term of the amplification factor in the wave optics regime. Calculation is in part done using arbitrary precision
- Parameters:
correction – Arbitrary precision object to contain value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
integration_limit – Upper limit of the integration
scaling_constant – Scale factor for the NFW profile
minimum_phase – Phase required for minimal time delay to be zero
precision – Number of bits of precision to use for calculation
-
void SecondCorrection(acb_t correction, double dimensionless_frequency, double source_position, double integration_limit, double scaling_constant, double minimum_phase, slong precision)¶
Computes the second correction term of the amplification factor in the wave optics regime. Calculation is in part done using arbitrary precision
- Parameters:
correction – Arbitrary precision object to contain value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
integration_limit – Upper limit of the integration
scaling_constant – Scale factor for the NFW profile
minimum_phase – Phase required for minimal time delay to be zero
precision – Number of bits of precision to use for calculation
-
void WaveAmplification(acb_t amplification_factor, double dimensionless_frequency, double source_position, double scaling_constant, double integration_limit, slong precision)¶
Computes the amplification factor for the Navarro, Frenk, and White lens profile in the wave optics regime. Calculation is in part done using arbitrary precision
- Parameters:
amplification_factor – Arbitrary precision object to contain value
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
integration_limit – Upper limit of the integration
precision – Number of bits of precision to use for calculation
-
double DifLensEq(double image_position, double source_position, double scaling_constant)¶
Computes the value of the differential of the lens equation
- Parameters:
image_position – Dimensionless displacement of the image
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
-
std::vector<double> ImagePositions(double source_position, double scaling_constant)¶
Computes the values of the image positions in the geometric optics approximation. Above the critical value of source position there will be three returned values, below there will only be one.
- Parameters:
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> Mass(double image_position, double scaling_constant)¶
Computes the value of the enclosed mass in the geometric optics approximation.
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> SurfaceDensity(std::complex<double> image_position, double scaling_constant)¶
Computes the surface density in the geometric optics approximation.
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> TangentialCaustic(double image_position, double scaling_constant)¶
Computes the tangential caustic in the geometric optics approximation.
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> RadialCaustic(double image_position, double scaling_constant)¶
Computes the radial caustic in the geometric optics approximation.
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constnant – Scale factor for the NFW profile
-
std::complex<double> Magnification(double image_position, double scaling_constant)¶
Computes the magnification in the geometric optics approximation.
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constant – Scale factor for the NFW profile
-
double MorseFactor(double image_position, double scaling_constant)¶
Computes the morse index in the geometric optics approximation.
- Parameters:
image_position – Dimensionless displacement of the image
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> GeometricAmplificationSingle(double dimensionless_frequency, double image_position, double source_position, double scaling_constant, double min_phase)¶
Computes the contribution to the amplification factor in the geometric optics regime for the image at the specified position.
- Parameters:
dimensionless_frequency – Dimensionless frequency
image_position – Dimensionless displacement of the image
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
min_phase – Phase required for minimal time delay of zero
-
std::complex<double> GeometricAmplification(double dimensionless_frequency, double source_position, double scaling_constant)¶
Computes the total amplification factor in the geometric optics regime with the minimal possible information.
- Parameters:
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
-
std::complex<double> GeometricAmplification(double dimensionless_frequency, double source_position, double scaling_constant, std::vector<double> image_positions, double minimum_phase)¶
Computes the total amplification factor in the geometric optics regime. Sped up by precomputing the image positions and minimum phase.
- Parameters:
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
image_positions – Dimensionless displacements of the images
minimum_phase – Phase required for minimal time delay of zero
-
double *AmplificationFactor(double dimensionless_frequency, double source_position, double scaling_constant, double integration_limit, slong geo_switch, slong precision)¶
Computes the amplification factor.
Will use WaveAmplification if
dimensionless_frequencyis equal to or less thangeo_switch.precisionused only in this case. Otherwise will use GeometricAmplification. Will calculate the image positions and minimum phase.- Parameters:
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
scaling_constant – Scale factor for the NFW profile
integration_limit – Upper limit of the integration
geo_switch – Dimensionless frequency above which to use geometric optics
precision – Number of bits of precision used for wave optics calculation
-
double *AmplificationFactor(double dimensionless_frequency, double source_position, double scaling_constant, double integration_limit, slong geo_switch, slong precision, std::vector<double> image_positions, double minimum_phase)¶
Computes the amplification factor.
Will use WaveAmplification if
dimensionless_frequencyis equal to or less thangeo_switch.precisionused only in this case. Otherwise will use GeometricAmplification. Supplied image positions and minimum phase will be used to speed up calculation.- Parameters:
dimensionless_frequency – Dimensionless frequency
source_position – Dimensionless displacement of the source
sclaing_constant – Scale factor for the NFW profile
integration_limit – Upper limit of the integration
geo_switch – Dimensionless frequency above which to use geometric optics
precision – Number of bits of precision used for wave optics calculation
image_positions – Dimensionless displacements of the images
minimum_phase – Phase required for minimal time delay of zero
-
int GenerateLensData(char *dimensionless_frequency_file, char *source_position_file, char *amplification_factor_real_file, char *amplification_factor_imag_file, double scaling_constant, double integration_limit, slong geo_switch, slong precision)¶
Constructs Gravelamps interpolator data for the Navarro Frenk White model.
Takes input files, and constructs completed matrics of the amplification factor covering the space of dimensionless frequency and source position given in the relevant files. Will checkpoint upon receiving SIGINT or SIGALRM. Will precompute the image positions and minimum phase for each value of source position to speed calculations.
- Parameters:
dimensionless_frequency_file – Path to file containing dimensionless frequency values.
source_position_file – Path to file containing source position values. @parma amplification_factor_real_file Path to file containing real component of amplificaiton factor values
amplification_factor_imag_file – Path to file containing imaginary component of amplification factor values
scaling_constant – Scale factor for the NFW profile
integration_limit – Upper limit of integration
geo_switch – Dimensionless frequenyc above which to use geometric optics
precision – Number of bits of precision used for wave optics calculation