gravelamps.models.microlensing_o3

Functions handling the O3 point mass microlensing model.

Deprecation Notice: This model may be removed in an upcoming version of Gravelamps.

Warning: To be used, the user must specify a location for the lookuptable.h5 file that may be downloaded at https://git.ligo.org/eungwang.seo/bilby_pmlens/-/blob/master/src/lookuptable.h5

class gravelamps.models.microlensing_o3.LookUpTable(table_fp: str)

Bases: object

Handles the loading and retrieving of the look up table for the amplification factor calculation.

Parameters:
table_fp: str

Filepath to the lookuptable.h5 file.

Attributes:
frequency_step

Gets the step in dimensionless frequency.

higher_source_array

Gets the higher source position data array.

higher_source_step

Gets the step in source position of the higher data array.

lower_source_array

Gets the lower source position data array.

lower_source_step

Gets the step in source position of the lower data array.

Methods

get_array(column_name)

Retrieves array from the look up table file.

property frequency_step: float

Gets the step in dimensionless frequency.

get_array(column_name: str) Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Retrieves array from the look up table file.

Parameters:
column_name: str

Name of the column to retrieve from the H5 file.

Returns:
arr: ArrayLike

Column from the H5 file as numpy array.

property higher_source_array: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Gets the higher source position data array.

property higher_source_step: float

Gets the step in source position of the higher data array.

property lower_source_array: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Gets the lower source position data array.

property lower_source_step: float

Gets the step in source position of the lower data array.

gravelamps.models.microlensing_o3.amplification(dimensionless_frequency: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], source_position: float, lookup_table: LookUpTable = None) Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Computes the amplification factor.

Parameters:
dimensionless_frequency: ArrayLike

Dimensionless frequencies

source_position: float

Dimensionless displacement from the optical axis

lookup_table: LookUpTable, optional

Look up table information

Raises:
ValueError

If lookup_table is empty when wave optics is needed

gravelamps.models.microlensing_o3.frequency_to_dimensionless_frequency(frequency_array: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], log_redshifted_lens_mass: float) Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Converts from frequency to dimensionless frequency using the GCSM.

Parameters:
frequency_array: ArrayLike

Frequencies to be converted.

log_redshifted_lens_mass: float

Log10 of the Redshifted Lens Mass.

Returns:
dim_freq_array: ArrayLike

Converted dimensionless frequencies.

gravelamps.models.microlensing_o3.geometric_amplification(dimensionless_frequency: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], source_position: float) Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Computes the amplification factor in the geometric optics regime.

Parameters:
dimensionless_frequency: ArrayLike

Dimensionless frequencies.

source_position: float

Dimensionless displacement from the optical axis.

Returns:
amp: complex or ArrayLike

Amplification factor values.

gravelamps.models.microlensing_o3.magnification(source_position: float, image: int) float

Computes the magnification in the geometric optics regime for the point mass model.

Parameters:
source_position: float

Dimensionless displacement from the optical axis.

image: int

0 for the first image, 1 for the second

Returns:
mag: float

Magnification for specifie dimage.

Raises:
ValueError

If image not set to 0 or 1

gravelamps.models.microlensing_o3.time_delay(source_position: float) float

Computes the dimensionless time delay for the point mass model.

Parameters:
source_position: float

Dimensionless displacement from the optical axis.

Returns:
delay: float

Dimensionless time delay.

gravelamps.models.microlensing_o3.wave_amplification(dimensionless_frequency: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], source_position: float, lookup_table: LookUpTable) Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]

Computes the amplification factor in the wave optics regime.

Parameters:
dimensionless_frequency: ArrayLike

Dimensonless frequencies.

source_position: float

Dimensoinless displacement of the optical axis.

lookup_table: LookUpTable

Look up table information.

Returns:
amp: ArrayLike

Amplification factor values.

gravelamps.models.microlensing_o3.wave_amplification_single(dimensionless_frequency: float, source_position: float, position_step: float, frequency_step: float, data_array: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) complex

Computes the amplification factor in the wave optics regime using the look up table to correct the geometric optics result.

Parameters:
dimensionless_frequency: float

Dimensionless frequency.

source_position: float

Dimensionless displaement from the optical axis.

position_step: float

Step size for the source position.

frequency_step: float

Step size for the dimensionless frequency.

data_array: ArrayLike

Data for the amplification factor calculation.

Returns:
amp: complex

Amplification factor value.