ler 0.3.8__tar.gz → 0.3.9__tar.gz
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-0.3.8 → ler-0.3.9}/PKG-INFO +1 -15
- {ler-0.3.8 → ler-0.3.9}/ler/__init__.py +1 -1
- {ler-0.3.8 → ler-0.3.9}/ler/gw_source_population/cbc_source_parameter_distribution.py +18 -24
- {ler-0.3.8 → ler-0.3.9}/ler/image_properties/image_properties.py +8 -8
- {ler-0.3.8 → ler-0.3.9}/ler/lens_galaxy_population/lens_galaxy_parameter_distribution.py +4 -4
- {ler-0.3.8 → ler-0.3.9}/ler/lens_galaxy_population/optical_depth.py +4 -3
- {ler-0.3.8 → ler-0.3.9}/ler/rates/gwrates.py +593 -208
- ler-0.3.8/ler/rates/ler.py → ler-0.3.9/ler/rates/ler copy.py +333 -113
- ler-0.3.9/ler/rates/ler.py +2228 -0
- ler-0.3.9/ler/utils/plots.py +402 -0
- {ler-0.3.8 → ler-0.3.9}/ler/utils/utils.py +24 -2
- {ler-0.3.8 → ler-0.3.9}/ler.egg-info/PKG-INFO +1 -15
- {ler-0.3.8 → ler-0.3.9}/ler.egg-info/SOURCES.txt +1 -0
- {ler-0.3.8 → ler-0.3.9}/setup.py +1 -1
- ler-0.3.8/ler/utils/plots.py +0 -359
- {ler-0.3.8 → ler-0.3.9}/LICENSE +0 -0
- {ler-0.3.8 → ler-0.3.9}/README.md +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/gw_source_population/__init__.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/gw_source_population/cbc_source_redshift_distribution.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/gw_source_population/jit_functions.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/image_properties/__init__.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/image_properties/multiprocessing_routine.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/lens_galaxy_population/__init__.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/lens_galaxy_population/jit_functions.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/lens_galaxy_population/mp.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/rates/__init__.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler/utils/__init__.py +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler.egg-info/dependency_links.txt +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler.egg-info/requires.txt +0 -0
- {ler-0.3.8 → ler-0.3.9}/ler.egg-info/top_level.txt +0 -0
- {ler-0.3.8 → ler-0.3.9}/setup.cfg +0 -0
{ler-0.3.8 → ler-0.3.9}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ler
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: Gravitational waves Lensing Rates
|
|
5
5
|
Home-page: https://github.com/hemantaph/ler
|
|
6
6
|
Author: Hemantakumar
|
|
@@ -9,20 +9,6 @@ License: MIT
|
|
|
9
9
|
Requires-Python: >=3.10
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist: setuptools>=65.5.0
|
|
13
|
-
Requires-Dist: matplotlib>=3.4.2
|
|
14
|
-
Requires-Dist: pycbc>=1.18.0
|
|
15
|
-
Requires-Dist: numpy>=1.18
|
|
16
|
-
Requires-Dist: numba>=0.57.1
|
|
17
|
-
Requires-Dist: bilby>=1.0.2
|
|
18
|
-
Requires-Dist: gwsnr>=0.2.0
|
|
19
|
-
Requires-Dist: scipy<1.14.0
|
|
20
|
-
Requires-Dist: lenstronomy>=1.10.4
|
|
21
|
-
Requires-Dist: astropy>=5.1
|
|
22
|
-
Requires-Dist: tqdm>=4.64.1
|
|
23
|
-
Requires-Dist: pointpats>=2.3
|
|
24
|
-
Requires-Dist: shapely>=2.0.1
|
|
25
|
-
Requires-Dist: gwcosmo
|
|
26
12
|
|
|
27
13
|
# LeR
|
|
28
14
|
[](https://zenodo.org/badge/latestdoi/626733473) [](https://badge.fury.io/py/ler) [](https://ler.readthedocs.io/en/latest/)
|
|
@@ -269,9 +269,9 @@ class CBCSourceParameterDistribution(CBCSourceRedshiftDistribution):
|
|
|
269
269
|
self.directory = directory
|
|
270
270
|
# initialize the interpolator's parameters
|
|
271
271
|
self.create_new_interpolator = dict(
|
|
272
|
-
redshift_distribution=dict(create_new=False, resolution=
|
|
273
|
-
z_to_luminosity_distance=dict(create_new=False, resolution=
|
|
274
|
-
differential_comoving_volume=dict(create_new=False, resolution=
|
|
272
|
+
redshift_distribution=dict(create_new=False, resolution=1000),
|
|
273
|
+
z_to_luminosity_distance=dict(create_new=False, resolution=1000),
|
|
274
|
+
differential_comoving_volume=dict(create_new=False, resolution=1000),
|
|
275
275
|
)
|
|
276
276
|
if isinstance(create_new_interpolator, dict):
|
|
277
277
|
self.create_new_interpolator.update(create_new_interpolator)
|
|
@@ -291,27 +291,21 @@ class CBCSourceParameterDistribution(CBCSourceRedshiftDistribution):
|
|
|
291
291
|
event_type, source_priors, source_priors_params
|
|
292
292
|
)
|
|
293
293
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
)
|
|
310
|
-
else:
|
|
311
|
-
# if you already have the redshift distribution function, you can pass it in.
|
|
312
|
-
# super class will not be initialized anymore,
|
|
313
|
-
# get z_to_luminosity_distance
|
|
314
|
-
self.lookup_table_luminosity_distance(z_min, z_max, directory)
|
|
294
|
+
# initialize the SourceGalaxyPopulationModel mother class
|
|
295
|
+
# for redshift distribution
|
|
296
|
+
# instance attribute sample_source_redshift is initialized here
|
|
297
|
+
super().__init__(
|
|
298
|
+
z_min=z_min,
|
|
299
|
+
z_max=z_max,
|
|
300
|
+
event_type=event_type,
|
|
301
|
+
merger_rate_density=self.gw_param_samplers["merger_rate_density"],
|
|
302
|
+
merger_rate_density_param=self.gw_param_samplers_params[
|
|
303
|
+
"merger_rate_density"
|
|
304
|
+
],
|
|
305
|
+
cosmology=cosmology,
|
|
306
|
+
directory=directory,
|
|
307
|
+
create_new_interpolator=self.create_new_interpolator,
|
|
308
|
+
)
|
|
315
309
|
|
|
316
310
|
# initializing samplers
|
|
317
311
|
# it goes through the setter functions and assign the sampler functions
|
|
@@ -67,7 +67,7 @@ class ImageProperties():
|
|
|
67
67
|
default: "./interpolator_pickle"
|
|
68
68
|
create_new_interpolator : `dict`
|
|
69
69
|
dictionary to create new interpolator pickle files
|
|
70
|
-
default: dict(
|
|
70
|
+
default: dict(luminosity_distance_to_z=dict(create_new=False, resolution=1000))
|
|
71
71
|
|
|
72
72
|
Examples
|
|
73
73
|
--------
|
|
@@ -140,22 +140,22 @@ class ImageProperties():
|
|
|
140
140
|
|
|
141
141
|
# initialize the interpolator's parameters
|
|
142
142
|
self.create_new_interpolator = dict(
|
|
143
|
-
|
|
143
|
+
luminosity_distance_to_z=dict(create_new=False, resolution=1000),
|
|
144
144
|
)
|
|
145
145
|
if isinstance(create_new_interpolator, dict):
|
|
146
146
|
self.create_new_interpolator.update(create_new_interpolator)
|
|
147
147
|
elif create_new_interpolator is True:
|
|
148
148
|
self.create_new_interpolator = dict(
|
|
149
|
-
|
|
149
|
+
luminosity_distance_to_z=dict(create_new=True, resolution=1000)
|
|
150
150
|
)
|
|
151
151
|
|
|
152
|
-
resolution = self.create_new_interpolator["
|
|
153
|
-
create_new = self.create_new_interpolator["
|
|
152
|
+
resolution = self.create_new_interpolator["luminosity_distance_to_z"]["resolution"]
|
|
153
|
+
create_new = self.create_new_interpolator["luminosity_distance_to_z"]["create_new"]
|
|
154
154
|
spline1 = interpolator_from_pickle(
|
|
155
155
|
param_dict_given= dict(z_min=z_min, z_max=z_max, cosmology=self.cosmo, resolution=resolution),
|
|
156
156
|
directory=directory,
|
|
157
|
-
sub_directory="
|
|
158
|
-
name="
|
|
157
|
+
sub_directory="luminosity_distance_to_z",
|
|
158
|
+
name="luminosity_distance_to_z",
|
|
159
159
|
x = np.linspace(z_min, z_max, resolution),
|
|
160
160
|
pdf_func= lambda z_: cosmo.luminosity_distance(z_).value,
|
|
161
161
|
conditioned_y=None,
|
|
@@ -163,7 +163,7 @@ class ImageProperties():
|
|
|
163
163
|
category="function_inverse",
|
|
164
164
|
create_new=create_new,
|
|
165
165
|
)
|
|
166
|
-
self.
|
|
166
|
+
self.luminosity_distance_to_z = njit(lambda z_: cubic_spline_interpolator(z_, spline1[0], spline1[1]))
|
|
167
167
|
|
|
168
168
|
def image_properties(
|
|
169
169
|
self,
|
|
@@ -237,12 +237,12 @@ class LensGalaxyParameterDistribution(CBCSourceParameterDistribution, ImagePrope
|
|
|
237
237
|
z_to_luminosity_distance=dict(create_new=False, resolution=1000),
|
|
238
238
|
velocity_dispersion=dict(create_new=False, resolution=1000),
|
|
239
239
|
axis_ratio=dict(create_new=False, resolution=1000),
|
|
240
|
-
optical_depth=dict(create_new=False, resolution=
|
|
240
|
+
optical_depth=dict(create_new=False, resolution=200),
|
|
241
241
|
z_to_Dc=dict(create_new=False, resolution=1000),
|
|
242
242
|
Dc_to_z=dict(create_new=False, resolution=1000),
|
|
243
243
|
angular_diameter_distance=dict(create_new=False, resolution=1000),
|
|
244
244
|
differential_comoving_volume=dict(create_new=False, resolution=1000),
|
|
245
|
-
|
|
245
|
+
luminosity_distance_to_z=dict(create_new=False, resolution=1000),
|
|
246
246
|
)
|
|
247
247
|
if isinstance(create_new_interpolator, dict):
|
|
248
248
|
self.create_new_interpolator.update(create_new_interpolator)
|
|
@@ -252,12 +252,12 @@ class LensGalaxyParameterDistribution(CBCSourceParameterDistribution, ImagePrope
|
|
|
252
252
|
z_to_luminosity_distance=dict(create_new=True, resolution=1000),
|
|
253
253
|
velocity_dispersion=dict(create_new=True, resolution=1000),
|
|
254
254
|
axis_ratio=dict(create_new=True, resolution=1000),
|
|
255
|
-
optical_depth=dict(create_new=True, resolution=
|
|
255
|
+
optical_depth=dict(create_new=True, resolution=200),
|
|
256
256
|
z_to_Dc=dict(create_new=True, resolution=1000),
|
|
257
257
|
Dc_to_z=dict(create_new=True, resolution=1000),
|
|
258
258
|
angular_diameter_distance=dict(create_new=True, resolution=1000),
|
|
259
259
|
differential_comoving_volume=dict(create_new=True, resolution=1000),
|
|
260
|
-
|
|
260
|
+
luminosity_distance_to_z=dict(create_new=True, resolution=1000),
|
|
261
261
|
)
|
|
262
262
|
|
|
263
263
|
# dealing with prior functions and categorization
|
|
@@ -176,7 +176,7 @@ class OpticalDepth():
|
|
|
176
176
|
if sampler_priors:
|
|
177
177
|
self.sampler_priors.update(sampler_priors)
|
|
178
178
|
self.sampler_priors_params = dict(
|
|
179
|
-
velocity_dispersion=dict(vd_min=0., vd_max=
|
|
179
|
+
velocity_dispersion=dict(vd_min=0., vd_max=350.),
|
|
180
180
|
axis_ratio=dict(q_min=0.2, q_max=1.),
|
|
181
181
|
)
|
|
182
182
|
if sampler_priors_params:
|
|
@@ -188,7 +188,7 @@ class OpticalDepth():
|
|
|
188
188
|
self.c_n_i = dict(
|
|
189
189
|
velocity_dispersion=dict(create_new=False, resolution=1000),
|
|
190
190
|
axis_ratio=dict(create_new=False, resolution=1000),
|
|
191
|
-
optical_depth=dict(create_new=False, resolution=
|
|
191
|
+
optical_depth=dict(create_new=False, resolution=200),
|
|
192
192
|
z_to_Dc=dict(create_new=False, resolution=1000),
|
|
193
193
|
Dc_to_z=dict(create_new=False, resolution=1000),
|
|
194
194
|
angular_diameter_distance=dict(create_new=False, resolution=1000),
|
|
@@ -200,7 +200,7 @@ class OpticalDepth():
|
|
|
200
200
|
self.c_n_i = dict(
|
|
201
201
|
velocity_dispersion=dict(create_new=True, resolution=1000),
|
|
202
202
|
axis_ratio=dict(create_new=True, resolution=1000),
|
|
203
|
-
optical_depth=dict(create_new=True, resolution=
|
|
203
|
+
optical_depth=dict(create_new=True, resolution=200),
|
|
204
204
|
z_to_Dc=dict(create_new=True, resolution=1000),
|
|
205
205
|
Dc_to_z=dict(create_new=True, resolution=1000),
|
|
206
206
|
angular_diameter_distance=dict(create_new=True, resolution=1000),
|
|
@@ -239,6 +239,7 @@ class OpticalDepth():
|
|
|
239
239
|
except:
|
|
240
240
|
self.vd_min = 10.
|
|
241
241
|
self.vd_max = 350.
|
|
242
|
+
self.sampler_priors_params['velocity_dispersion']=dict(vd_min=self.vd_min, vd_max=self.vd_max)
|
|
242
243
|
|
|
243
244
|
# generating inverse cdf interpolator for velocity dispersion
|
|
244
245
|
param_dict_given_ = dict(z_min=self.z_min, z_max=self.z_max, vd_min=self.vd_min, vd_max=self.vd_max, cosmology=self.cosmo, name=vd_name, resolution=self.c_n_i["velocity_dispersion"]["resolution"])
|