ler 0.2.3__py3-none-any.whl → 0.2.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ler might be problematic. Click here for more details.
- ler/source_population.py +5 -14
- ler-0.2.7.dist-info/LICENSE +21 -0
- ler-0.2.7.dist-info/METADATA +49 -0
- ler-0.2.7.dist-info/RECORD +11 -0
- {ler-0.2.3.dist-info → ler-0.2.7.dist-info}/WHEEL +1 -1
- ler-0.2.3.dist-info/METADATA +0 -48
- ler-0.2.3.dist-info/RECORD +0 -10
- {ler-0.2.3.dist-info → ler-0.2.7.dist-info}/top_level.txt +0 -0
ler/source_population.py
CHANGED
|
@@ -907,20 +907,11 @@ class CompactBinaryPopulation(SourceGalaxyPopulationModel):
|
|
|
907
907
|
for key, value in self.src_model_params.items():
|
|
908
908
|
if key in keys_:
|
|
909
909
|
param[key] = value
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
mass_2_source
|
|
913
|
-
while
|
|
914
|
-
|
|
915
|
-
m2 = np.random.normal(muL, sigmaL, size=size)
|
|
916
|
-
m1 = np.random.normal(muR, sigmaR, size=size)
|
|
917
|
-
# check if m1>m2
|
|
918
|
-
idx = m1>m2
|
|
919
|
-
mass_1_source+=list(m1[idx])
|
|
920
|
-
mass_2_source+=list(m2[idx])
|
|
921
|
-
|
|
922
|
-
mass_1_source = np.array(mass_1_source)[:size]
|
|
923
|
-
mass_2_source = np.array(mass_2_source)[:size]
|
|
910
|
+
|
|
911
|
+
model = p.mass_prior("BNS", None)
|
|
912
|
+
mass_1_source, mass_2_source = model.sample(Nsample=size)
|
|
913
|
+
while np.any(mass_2_source > mass_1_source):
|
|
914
|
+
mass_1_source, mass_2_source = model.sample(Nsample=size)
|
|
924
915
|
|
|
925
916
|
return (mass_1_source, mass_2_source)
|
|
926
917
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Phurailatpam Hemantakumar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ler
|
|
3
|
+
Version: 0.2.7
|
|
4
|
+
Summary: Gravitational waves Lensing Rates
|
|
5
|
+
Home-page: https://github.com/hemantaph/ler
|
|
6
|
+
Author: Hemantakumar
|
|
7
|
+
Author-email: hemantaphurailatpam@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: setuptools (>=67.8.0)
|
|
13
|
+
Requires-Dist: numpy (>=1.18)
|
|
14
|
+
Requires-Dist: numba (>=0.57.1)
|
|
15
|
+
Requires-Dist: bilby (>=1.0.2)
|
|
16
|
+
Requires-Dist: gwsnr (>=0.1)
|
|
17
|
+
Requires-Dist: scipy (>=1.9.0)
|
|
18
|
+
Requires-Dist: lenstronomy (>=1.10.4)
|
|
19
|
+
Requires-Dist: astropy (>=5.1)
|
|
20
|
+
Requires-Dist: tqdm (>=4.64.1)
|
|
21
|
+
Requires-Dist: pointpats (>=2.3)
|
|
22
|
+
Requires-Dist: shapely (>=2.0.1)
|
|
23
|
+
|
|
24
|
+
# LeR
|
|
25
|
+
[](https://zenodo.org/badge/latestdoi/626733473) [](https://badge.fury.io/py/ler) [](https://ler.readthedocs.io/en/latest/)
|
|
26
|
+
|
|
27
|
+
`LeR` is a statistical-based python package whose core function is designed for the computation of detectable rates pertaining to both lensed and unlensed gravitational wave (GW) events. This calculation intricately hinges upon the interplay of various components within the package, which can be categorized into three primary segments: 1. Sampling the properties of compact-binary sources, 2. Sampling characteristics of lens galaxies, and 3. Solving the lens equation to derive image attributes of the source. The holistic functionality of the package is built upon leveraging array operations and linear algebra from the numpy library, interpolation from scipy, and the `multiprocessing` capability inherent to Python. This design optimizes both speed and functionality while upholding user-friendliness. The architecture of the "LeR" API is deliberately organized such that each distinct functionality holds its own significance in scientific research. Simultaneously, these functionalities seamlessly integrate and can be employed collectively based on specific research requirements. Key features of `LeR` and its dependencies can be summarized as follows,
|
|
28
|
+
|
|
29
|
+
- Detectable merger rates:
|
|
30
|
+
* The calculation depends not only on simulated event properties but also on GW detector detectability. We compute optimal signal-to-noise ratios (SNRs) for simulated events, which can be computationally intensive. `LeR` mitigates this using [`gwsnr`](https://github.com/hemantaph/gwsnr) for efficient and rapid SNR calculation. `gwsnr` enables rate calculation for current and future detectors with customizable sensitivities.
|
|
31
|
+
* The merger rates of both the simulated unlensed and lensed events can be computed and subsequently compared.
|
|
32
|
+
- Sampling GW sources:
|
|
33
|
+
* The distribution of the source's red-shift is based on the merger rate density of compact binaries, including binary black hole (BBH), binary neutron star (BNS) etc. The code is meticulously structured to facilitate straightforward incorporation of future updates or additional distributions of such sources by users.
|
|
34
|
+
* The sampling of intrinsic and extrinsic parameters of gravitational wave sources is conducted employing the prior distributions encompassed within the `gwcosmo` and `bilby` Python packages. Prior to parameterizing the rate calculation, users retain the flexibility to manually substitute any relevant parameters as needed.
|
|
35
|
+
- Sampling of lens galaxies:
|
|
36
|
+
* The Lens distribution follows [(Oguri et al. 2018](https://arxiv.org/abs/1807.02584). It depends on the sampled source red-shifts and also on the optical depth.
|
|
37
|
+
* `LeR` employs the Elliptical Power Law model with the external shear (EPL+Shear) model for sampling other galaxy features, which is available in the `Lenstronomy` package.
|
|
38
|
+
* Rejection sampling is applied on the above samples on condition that whether the event is strongly lensed or not.
|
|
39
|
+
- Generation of image properties:
|
|
40
|
+
* Source position is sampled from the caustic in the source plane.
|
|
41
|
+
* Sampled lens properties and source position is fed in `Lenstronomy` to generate properties of the images.
|
|
42
|
+
* Properties like magnification and time delay are essential as it modifies the source signal strength, changing the SNR and detection ability.
|
|
43
|
+
* `LeR` can handle both super-threshold and sub-threshold events in picking detectable events and rate computation.
|
|
44
|
+
|
|
45
|
+
The `LeR` software has been developed to cater to the requirements of both the LIGO scientific collaboration and research scholars engaged in astrophysics studies. It is currently used in generating detectable lensing events and GW lensing rates with the available information on current and future detectors. The results will predict the feasibility of various detectors for detecting and studying such lensing events. Statistics generated from `LeR` will be used in event validation of the ongoing effort to detect lensed gravitational waves. Lastly, `LeR` was designed with upgradability in mind to include additional statistics as required by the related research.
|
|
46
|
+
|
|
47
|
+
# Installation
|
|
48
|
+
|
|
49
|
+
Follow the installation instruction at [ler.readthedoc](https://ler.readthedocs.io/en/latest/installation.html)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
ler/__init__.py,sha256=nUMMeFqWc6NR79ztnqptdyAVviJwuGUuWtXYmSSJ58I,313
|
|
2
|
+
ler/helperroutines.py,sha256=oWl0mnuKxyfVoQ-ovGnJueZPtOfrUyzuj2Fe5KxxBrk,6411
|
|
3
|
+
ler/lens_galaxy_population.py,sha256=bj0RR4EqWF5z6hcAjAKBfmZuz43aI-FxstJGBIC3lWo,44403
|
|
4
|
+
ler/ler.py,sha256=-QYE6jD72F_yjnqQPe-JbqX5jvMrh_-6Eqa8rOsVQ-M,69959
|
|
5
|
+
ler/multiprocessing_routine.py,sha256=xazcM5V0w_ACiqo6DuBqP1DkX4-B-rCuTKSXRexxNxA,16064
|
|
6
|
+
ler/source_population.py,sha256=MjjkJB_CgxLw7Dk4PR9zhZGy43ItwPaN84vnZrnedTU,37786
|
|
7
|
+
ler-0.2.7.dist-info/LICENSE,sha256=9LeXXC3WaHBpiUGhLVgOVnz0F12olPma1RX5zgpfp8Q,1081
|
|
8
|
+
ler-0.2.7.dist-info/METADATA,sha256=BJHMTmWPC5phG4iYfggGyc3GYjIxhFlJ8Hyc2Yz5uVM,5144
|
|
9
|
+
ler-0.2.7.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
10
|
+
ler-0.2.7.dist-info/top_level.txt,sha256=VWeWLF_gNMjzquGmqrLXqp2J5WegY86apTUimMTh68I,4
|
|
11
|
+
ler-0.2.7.dist-info/RECORD,,
|
ler-0.2.3.dist-info/METADATA
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: ler
|
|
3
|
-
Version: 0.2.3
|
|
4
|
-
Summary: Gravitational waves Lensing Rates
|
|
5
|
-
Home-page: https://github.com/hemantaph/ler
|
|
6
|
-
Author: Hemantakumar
|
|
7
|
-
Author-email: hemantaphurailatpam@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Requires-Python: >=3.10
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
Requires-Dist: setuptools >=67.8.0
|
|
12
|
-
Requires-Dist: numpy >=1.18
|
|
13
|
-
Requires-Dist: numba >=0.57.1
|
|
14
|
-
Requires-Dist: bilby >=1.0.2
|
|
15
|
-
Requires-Dist: gwsnr >=0.1
|
|
16
|
-
Requires-Dist: scipy >=1.9.0
|
|
17
|
-
Requires-Dist: lenstronomy >=1.10.4
|
|
18
|
-
Requires-Dist: astropy >=5.1
|
|
19
|
-
Requires-Dist: tqdm >=4.64.1
|
|
20
|
-
Requires-Dist: pointpats >=2.3
|
|
21
|
-
Requires-Dist: shapely >=2.0.1
|
|
22
|
-
|
|
23
|
-
# LeR
|
|
24
|
-
[](https://zenodo.org/badge/latestdoi/626733473)
|
|
25
|
-
|
|
26
|
-
`LeR` is a statistical-based python package whose core function is to calculate detectable rates of both lensing and unlensed GW events. This calculation is very much dependent on the other functionality of the package, which can be subdivided into three parts; 1. Sampling of compact-binary source properties, 2. Sampling of lens galaxy characteristics and 3. Solving the lens equation to get image properties of the source. The package as a whole relies on `numpy` array operation and linear algebra, `scipy` interpolation and `multiprocessing` functionality of python to increase speed and functionality without compromising on the ease of use. The API of `LeR` is structured such that each functionality mentioned stands in its own right for scientific research but also can be used together as needed. Key features of `LeR` and its dependencies can be summarized as follows,
|
|
27
|
-
|
|
28
|
-
- Detectable merger rates:
|
|
29
|
-
* Calculation not only relies on the properties of simulated events but also on detectability provided by the condition of the GW detectors. For this, the optimal signal-to-noise ratio (SNR) is calculated for each of the simulated events and it can be computationally expensive. This is mitigated because `LeR` relies on [`gwsnr`]{https://github.com/hemantaph/gwsnr/tree/main} for efficient and rapid calculation of SNRs. Due to the prowess of `gwsnr`, rate calculation can also be done both for present and future detectors with customizable sensitivities.
|
|
30
|
-
* Merger rates of both the simulated unlensed and lensed events can be calculated and compared.
|
|
31
|
-
- Sampling GW sources:
|
|
32
|
-
* Distribution of the source's red-shift is based on the merger rate density of compact binaries, which can be BBH, BNS, primordial black holes (PBHs) etc. The code is designed to accommodate easy updates or additions of such distribution by the users in the future.
|
|
33
|
-
* Sampling of BBH masses is done using `gwcosmo` following the powerlaw+peak model. Other related properties are sampled from available priors of `bilby`. The user can manually replace any before feeding the parameters in for rate computation.
|
|
34
|
-
- Sampling of lens galaxies:
|
|
35
|
-
* Lens distribution follows [(Oguri et al. 2018](https://arxiv.org/abs/1807.02584). It depends on the sampled source red-shifts and also on the optical depth.
|
|
36
|
-
* `LeR` employs the Elliptical Power Law model with the external shear (EPL+Shear) model for sampling other galaxy features, which is available in the `Lenstronomy` package.
|
|
37
|
-
* Rejection sampling is applied on the above samples on condition that whether the event is strongly lensed or not.
|
|
38
|
-
- Generation of image properties:
|
|
39
|
-
* Source position is sampled from the caustic in the source plane.
|
|
40
|
-
* Sampled lens properties and source position is fed in `Lenstronomy` to generate properties of the images.
|
|
41
|
-
* Properties like magnification and time delay are essential as it modifies the source signal strength, changing the SNR and detection ability.
|
|
42
|
-
* `LeR` can handle both super-threshold and sub-threshold events in picking detectable events and rate computation.
|
|
43
|
-
|
|
44
|
-
`LeR` was written to be used by both LIGO scientific collaboration and research students for related works in astrophysics. It is currently used in generating detectable lensing events and GW lensing rates with the available information on current and future detectors. The results will predict the feasibility of various detectors for detecting and studying such lensing events. Statistics generated from `LeR` will be used in event validation of the ongoing effort to detect lensed gravitational waves. Lastly, `LeR` was designed with upgradability in mind to include additional statistics as required by the related research.
|
|
45
|
-
|
|
46
|
-
# Installation
|
|
47
|
-
|
|
48
|
-
Follow the installation instruction at [ler.readthedoc](https://ler.readthedocs.io/en/latest/installation.html)
|
ler-0.2.3.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
ler/__init__.py,sha256=nUMMeFqWc6NR79ztnqptdyAVviJwuGUuWtXYmSSJ58I,313
|
|
2
|
-
ler/helperroutines.py,sha256=oWl0mnuKxyfVoQ-ovGnJueZPtOfrUyzuj2Fe5KxxBrk,6411
|
|
3
|
-
ler/lens_galaxy_population.py,sha256=bj0RR4EqWF5z6hcAjAKBfmZuz43aI-FxstJGBIC3lWo,44403
|
|
4
|
-
ler/ler.py,sha256=-QYE6jD72F_yjnqQPe-JbqX5jvMrh_-6Eqa8rOsVQ-M,69959
|
|
5
|
-
ler/multiprocessing_routine.py,sha256=xazcM5V0w_ACiqo6DuBqP1DkX4-B-rCuTKSXRexxNxA,16064
|
|
6
|
-
ler/source_population.py,sha256=ACTipyPZAKBEfY61mnqkIXhzACQlK1tqCHH5pa5RMx8,38054
|
|
7
|
-
ler-0.2.3.dist-info/METADATA,sha256=bYJUlvaPA3OyXwY-qp4J9lU3-wjYyWUdFbJZo4W7M1g,4564
|
|
8
|
-
ler-0.2.3.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
|
|
9
|
-
ler-0.2.3.dist-info/top_level.txt,sha256=VWeWLF_gNMjzquGmqrLXqp2J5WegY86apTUimMTh68I,4
|
|
10
|
-
ler-0.2.3.dist-info/RECORD,,
|
|
File without changes
|