gravelamps.models.isolated_point¶
Isolated Point Mass Lensing Implementation
These functions are wrappers around the C++ functions implemneted in gravelamps/models/isolated-point.h. These are able to compute the amplification factor in both the wave and geometric optics regimes.
- gravelamps.models.isolated_point.amplification()¶
Computes the amplification factor.
Will compute in the wave optics regime with the specified precision below the specified dimensionless frequency and in the geometric optics regime with standard double precision above it. Function adheres to numpy broadcasting rules.
- Parameters:
- dimensionless_frequency: float or ArrayLike
Dimensionless frequencies.
- source_position: float or ArrayLike
Dimensionless displacement from the optical axis.
- geo_switch: int, optional, default=1000
Dimensionless frequency above which to use geometric optics.
- precision: int, optional, default=1000
Number of bits of precision to use in the wave optics calculations.
- Returns:
- amp: complex or ArrayLike
Amplification factor values.
- Raises:
- RuntimeError
If arguments cannot be parsed.
- RuntimeWarning
If precision set greater than 50000—runtime length warning.
- gravelamps.models.isolated_point.generate_data()¶
Constructs interpolator data files for the isolated point mass model.
From the input files, the amplification factor files will be populated with a grid of amplification factor values corresponding to the dimensionless frequency and source position values in their respective files. This function will checkpoint the files and return 85 upon receiving a SIGALRM or SIGINT.
- Parameters:
- dimensionless_frequency_file: str
Path to file containing dimensionless frequency values.
- source_position_file: str
Path to file containing source position values.
- amplification_factor_real_file: str
Path to file containing real component of amplification factor values.
- amplification_factor_imag_file: str
Path to file containing imaginary component of amplification factor values.
- geo_switch: int, optional, default=1000
Dimensionless frequency above which to use geometric optics.
- precision: int, optional, default=1000
Number of bits of precision used for wave optics calculation.
- Returns:
- int
0 if completed successfully, 85 if received checkpoint instruction.
- Raises:
- RuntimeError
If arguments cannot be understood.
- RuntimeWarning
If precision greater than 50000—warns about length of time.
- gravelamps.models.isolated_point.geometric_amplification()¶
Computes the amplification factor in the geometric optics regime. Adheres to numpy broadcasting rules.
- Parameters:
- dimensionless_frequency: float or ArrayLike
Dimensionless frequencies.
- source_position: float or ArrayLike
Dimensionless displacement from optical axis.
- Returns:
- amp: complex or ArrayLike
Amplification factor values.
- Raises:
- RuntimeError
If arguments cannot be parsed.
- gravelamps.models.isolated_point.geometric_contribution()¶
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. Adheres to numpy broadcast rules.
- Parameters:
- dimensionless_frequnecy: float or ArrayLike
Dimensionless frequencies.
- source_position: float or ArrayLike
Dimensionless displacement from the optical axis.
- image: int
0 if first image. 1 if second.
- Returns:
- contrib: complex or ArrayLike
Contribution to amplification factor from specified image.
- Raises:
- RuntimeError
If arguments cannot be parsed.
- ValueError
Raised if image is not one of 0 or 1.
- gravelamps.models.isolated_point.magnification()¶
Computes the magnification in the geometric optics regime. Image specifies whether to compute for first or second image.
- Parameters:
- source_position: float or ArrayLike
Dimensionless displacement from the optical axis.
- image: int
0 for the first image, 1 for the second.
- Returns:
- float or ArrayLike
- Raises:
- RuntimeError
If arguments cannot be parsed.
- ValueError
If image is not 0 or 1.
- gravelamps.models.isolated_point.time_delay()¶
Computes the dimensionless time delay between the two signals in the geometric optics approximation.
- Parameters:
- source_position: float or ArrayLike
Dimensionless displacement from the optical axis
- Returns:
- float or ArrayLike
- gravelamps.models.isolated_point.wave_amplification()¶
Computes the amplification factor in the wave optics regime.
Computation is done with the specified precision. Adheres to numpy broadcasting rules.
- Parameters:
- dimensionless_frequency: float or ArrayLike
Dimensionless frequencies.
- source_position: float or ArrayLike
Dimensionless displacement from optical axis.
- precision: int, optional, default=1000
Number of bits of precision to use for calculation of amplification factor.
- Returns:
- amp: complex or ArrayLike
Amplification factor values.
- Raises:
- RuntimeError
If arguments cannot be parsed.
- RuntimeWarning
If precision set greater than 50000—runtime length warning.