gravelamps/models/singular-isothermal-sphere.h

Functions

void CheckpointSigHandler(int signum)

Sets checkpoint flag upon receiving singal

Sets checkpoint flag upon receiving signal

Parameters:
  • signum – Signal value

  • signum – Signal value

double MinimumPhase(double source_position)

Computes the phase required for the minimum time delay to be zero.

Parameters:

source_position – Dimensionless displacement from the optical axis

void PrefactorComponent(acb_t prefactor_component, double dimensionless_frequency, double source_position, slong preicision)

Computes prefactor component of the amplification factor in the wave optics regime. Exponentiation done with arbitrary precision.

Parameters:
  • prefactor_component – Arbitrary precision object to ccontain value

  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • precision – Number of bits of precision for exponentiation calculation

void GammaComponent(acb_t gamma_component, arb_t n_factorial, int n, slong precision)

Computes gamma component of the amplification factor in the wave optics regime. Gamma function and division calculated using arbitrary precision.

Parameters:
  • gamma_component – Arbitrary precision object to contain the value

  • n_factorial – Arbitrary precision object containing factorial of index

  • n – Summation index

  • precision – Number of bits of precision for calculations

void PowerComponent(acb_t power_component, double dimensionless_frequency, int n, slong precision)

Computes the index power component of the amplification factor in the wave optics regime. Calculation is in part performed with arbitrary precision.

Parameters:
  • power_component – Arbitrary precision object to contain the value

  • dimensionless_frequency – Dimensionless frequency

  • n – Summation index

  • precision – Number of bits of precision for calculation

void HyperComponent(acb_t hyper_component, double dimensionless_frequency, double source_position, int n, slong precision)

Computes the confluent hypergeometric component of the amplification factor in the wave optics regime. Hypergeometric function calculated using arbitrary precision.

Parameters:
  • hyper_component – Arbitrary precision object to contain the value

  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • n – Summation index

  • precision – Number of bits of precision for calculation

void WaveNContribution(acb_t contribution, arb_t factorial, double dimensionless_frequency, double source_position, int n, slong precision)

Computes the contribution to the amplification factor in the wave optics regime for the nth summation index. Calculation is in part performed with arbitrary precision.

Parameters:
  • contribution – Arbitrary precision object to contain the value

  • n_factorial – Arbitrary precision object containing factorial of index

  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • n – Summation index

  • precision – Number of bits of precision for calculations

void WaveAmplification(acb_t amplification_factor, double dimensionless_frequency, double source_position, slong summation_limit, slong precision)

Computes the amplification factor in the wave optics regime. Calculation is performed with arbitrary precision.

Parameters:
  • amplification_factor – Arbitrary precision object to contain the value

  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • summation_limit – Upper bound for summation

  • precision – Number of bits of precision for calculations

double Magnification(double source_position, int image)

Computes the magnification in the geometric optics regime. Computes for the first image if image is set to 0 and the second image if set to 1.

Computes the magnification in the geometric optics regime. Image flag specifies the first or second of the two signals

Parameters:
  • source_position – Dimensionless displacement from the optical axis

  • image – Compute for the first image if 0 and for the second if 1

  • source_position – Dimensionless displacement from the optical axis

  • image – 0 if first image, 1 if second

double TimeDelay(double source_position)

Computes the time delay in the geometric optics regime

Computes the dimensionless time delay between the two signals in the geometric optics approximation

Parameters:
  • source_position – Dimensionless displacement from the optical axis

  • source_position – Dimensionless displacement from the optical axis

std::complex<double> GeometricAmplificationSingle(double dimensionless_frequency, double source_position, int image)

Computes the contribution to the amplification factor in the geometric optics regime for the specified image. image flag specifies the first or second of the two signals.

Computes the contribution to the amplification factor in the geometric optics regime for the specified image. Image flag specifies the first or second of the two signals

Parameters:
  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • image – Compute for the first image if 0 and for the second if 1

  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • image – 0 if first image, 1 if second

std::complex<double> GeometricAmplification(double dimensionless_frequency, double source_position)

Computes the total amplification factor in the geometric optics regime.

Computes the total amplification factor in the geometric optics regime

Parameters:
  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

double *AmplificationFactor(double dimensionless_frequency, double source_position, slong geo_switch, slong summation_limit, slong precision)

Computes the amplification factor.

Will use WaveAmplification if dimensionless_frequency is equal to or less than geo_switch. precision and summation_limit used only in this case. Otherwise will use GeometricAmplification.

Parameters:
  • dimensionless_frequency – Dimensionless frequency

  • source_position – Dimensionless displacement from the optical axis

  • geo_switch – Dimensionless frequency above which to use geometric optics

  • summation_limit – Upper bound of summation to use for wave optics

  • precision – Number of bits of precision used for wave optics calculations

int GenerateLensData(char *dimensionless_frequency_file, char *source_position_file, char *amplification_factor_real_file, char *amplification_factor_imag_file, slong geo_switch, slong summation_limit, slong precision)

Constructs Gravelamps interpolator data for the singular isothermal sphere model.

Takes input files, and constructs completed matrices 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.

Parameters:
  • dimensionless_frequency_file – Path to file containing dimensionless frequency values.

  • source_position_file – Path to file containing source position values.

  • amplification_factor_real_file – Path to file containing real component of amplification factor values.

  • amplification_factor_imag_file – Path to file containing imaginary component of amplification factor values.

  • geo_switch – Dimensionless frequency above which to use geometric optics

  • summation_limit – Upper bound of summation to use for wave optics

  • precision – Number of bits of precision used for wave optics calculations.