Lensing gravitational waves
Project description
调用方法1
import lgwwhu
import warnings warnings.filterwarnings("ignore", "Wswiglal-redir-stdio") import lal
from bilby.gw.conversion import redshift_to_luminosity_distance
from lgwwhu.main import gravitational_lens_with_amplification from lgwwhu.main import generate_waveform from lgwwhu.main import compute_lensed_waveform import matplotlib.pyplot as plt
计算距离
def lumDis(z): """ in Mpc """ return redshift_to_luminosity_distance(redshift=z)
生成 lens_params 参数
lens_params = { 'ml': 1e9, # 镜质量 (太阳质量) 'beta': 2.5e-5, # 入射角 (弧度) 'zs': 2.0, # 背景源红移 'zl': 1.0, # 镜红移 'lens_model': 'point-mass' # 透镜模型 }
生成 waveform_params 参数
waveform_params = { 'approximant': 'IMRPhenomD', # 波形近似模型 'mass1': 50000, # 第一个天体的质量 (太阳质量) 'mass2': 40000, # 第二个天体的质量 (太阳质量) 'distance': lumDis(lens_params['zs']), # 距离 (Mpc),使用 lens_params 的 zs 'inclination': 0 # 入射角 (弧度) }
计算放大后的波形
result = compute_lensed_waveform(waveform_params, lens_params)
绘制结果
frequencies = result["frequencies"] original_waveformhp = result["original_waveformhp"] lensed_waveformhp = result["lensed_waveformhp"] amplification = result["amplification"]
plt.figure(figsize=(10, 6)) plt.plot(frequencies, amplification.real, label="Original |hp(f)|", alpha=0.7) plt.xlabel("Frequency (Hz)") plt.ylabel("Amplitude") plt.title("Lensed vs Original Frequency Domain Waveform") plt.legend() plt.show()
plt.figure(figsize=(10, 6)) plt.plot(frequencies, original_waveformhp.real, label="Original |hp(f)|", alpha=0.7) plt.xlabel("Frequency (Hz)") plt.ylabel("Amplitude") plt.title("Lensed vs Original Frequency Domain Waveform") plt.legend() plt.show()
plt.figure(figsize=(10, 6)) plt.plot(frequencies, original_waveformhp.real, label="Original |hp(f)|", alpha=0.7) plt.plot(frequencies, lensed_waveformhp.real, label="Lensed |hp(f)|", alpha=0.7) plt.xlabel("Frequency (Hz)") plt.ylabel("Amplitude") plt.title("Lensed vs Original Frequency Domain Waveform") plt.legend() plt.show()
LIGO参数:
生成 lens_params 参数
lens_params = { 'ml': 1e6, # 镜质量 (太阳质量) 'beta': 2.5e-5, # 入射角 (弧度) 'zs': 2.0, # 背景源红移 'zl': 1.0, # 镜红移 'lens_model': 'point-mass' # 透镜模型 }
生成 waveform_params 参数
waveform_params = { 'approximant': 'IMRPhenomD', # 波形近似模型 'mass1': 30, # 第一个天体的质量 (太阳质量) 'mass2': 20, # 第二个天体的质量 (太阳质量) 'distance': lumDis(lens_params['zs']), # 距离 (Mpc),使用 lens_params 的 zs 'inclination': 0 # 入射角 (弧度) }
zrj 2024-12-12
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lgwwhu-3.0.0.tar.gz.
File metadata
- Download URL: lgwwhu-3.0.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79afcd1e2aee7fa34ac2f7cf06cdae538a15df47cea29a88421de5f84d649864
|
|
| MD5 |
745960625aaa652296620023a2eba6d3
|
|
| BLAKE2b-256 |
01a33796427163cfaec0a9b37e7b1d808207b0751b3ec4239a0ee35f9a0367c9
|
File details
Details for the file lgwwhu-3.0.0-py3-none-any.whl.
File metadata
- Download URL: lgwwhu-3.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
141259641663bb36cf6b8e53679da7be9ab70d2bea79fc4a40d7d8b2a9750335
|
|
| MD5 |
e94c2491867c50db773862fb7208c334
|
|
| BLAKE2b-256 |
df5b7eb8ded1ca429ce273502b9684443d896a51c2181a6d7ce72cac431ce96b
|