PyTransit 2.6.1__tar.gz → 2.6.4__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.
- {PyTransit-2.6.1 → pytransit-2.6.4}/MANIFEST.in +2 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/PKG-INFO +17 -44
- {PyTransit-2.6.1 → pytransit-2.6.4}/PyTransit.egg-info/PKG-INFO +17 -44
- {PyTransit-2.6.1 → pytransit-2.6.4}/PyTransit.egg-info/SOURCES.txt +5 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/PyTransit.egg-info/requires.txt +1 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/README.md +15 -43
- {PyTransit-2.6.1 → pytransit-2.6.4}/pyproject.toml +2 -6
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/__init__.py +3 -2
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/__init__.py +8 -1
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ldtkldm.py +15 -16
- pytransit-2.6.4/pytransit/models/numba/ldtkldm.py +91 -0
- pytransit-2.6.4/pytransit/models/roadrunner/ecintersection.py +137 -0
- pytransit-2.6.4/pytransit/models/roadrunner/model_trspec.py +169 -0
- pytransit-2.6.4/pytransit/models/roadrunner/opmodel.py +104 -0
- pytransit-2.6.4/pytransit/models/roadrunner/opmodel_full.py +245 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/rrmodel.py +38 -17
- pytransit-2.6.4/pytransit/models/roadrunner/rrmodel_cl.py +369 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/tsmodel.py +13 -4
- pytransit-2.6.4/pytransit/utils/io/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/keplerlc.py +2 -2
- PyTransit-2.6.1/pytransit/models/roadrunner/__init__.py +0 -1
- PyTransit-2.6.1/pytransit/models/roadrunner/model_trspec.py +0 -85
- {PyTransit-2.6.1 → pytransit-2.6.4}/LICENSE +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/PyTransit.egg-info/dependency_links.txt +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/PyTransit.egg-info/top_level.txt +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/contamination.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/data/spectra.h5 +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/data/transmission.nc +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/filter.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/instrument.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/contamination/plotting.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/limb_darkening.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/baselines/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/baselines/legendrebaseline.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/baselines/linearbaseline.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/cntlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/eclipselpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/celeriteloglikelihood.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/clloglikelihood.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/fmcloglikelihood.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/logisticloglikelihood.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/multiceleriteloglikelihood.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/loglikelihood/wnloglikelihood.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/logposteriorfunction.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/lpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/mclpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/mptlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/ocllpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/ocltdvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/oclttvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/phasecurvelpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/rvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tdvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tess/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tess/ctesslpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tess/tessttvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tess/tgclpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tess/tgcmplpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tess/tmpclpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tesslpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/tessoclttvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/transitanalysis.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/transitlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/lpf/ttvlpf.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/eclipse_model.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/gdmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/general.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ldmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/general.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/linear.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/nonlinear.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/power_2.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/quadratic.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/quadratic_tri.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/limb_darkening/uniform.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ma_chromosphere.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ma_quadratic.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ma_quadratic_cl.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ma_uniform.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/ma_uniform_cl.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/gdmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/general_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/ldmodels.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/ma_chromosphere_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/ma_quadratic_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/ma_uniform_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/phasecurves.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/qpower2_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/rrmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/spmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/numba/udmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/opencl/ma_quadratic.cl +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/opencl/ma_uniform.cl +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/opencl/orbits.cl +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/opencl/qpower2.cl +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/osmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/qpower2.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/qpower2_cl.py +0 -0
- {PyTransit-2.6.1/pytransit/utils/io → pytransit-2.6.4/pytransit/models/roadrunner}/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/common.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/model.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/model_full.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/model_simple.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/roadrunner/rrmodel.cl +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/transitmodel.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/models/uniform.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/orbits/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/orbits/orbits.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/orbits/orbits_py.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/orbits/taylor_z.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/param/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/param/parameter.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/param/prior.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/param/utilities.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/stars/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/stars/btsettl.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/stars/data/avg_bt_settl.fits +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/stars/data/avg_husser2013.fits +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/stars/husser2013.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/__init__.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/astrometry.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/constants.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/de.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/downsample.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/eclipses.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/io/lightcurvedata.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/mdwarfs.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/misc.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/mocklc.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/octasphere.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/phasecurves.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/physics.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/rv.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/utils/tess.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/pytransit/version.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/setup.cfg +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_contamination.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_ma_quadratic.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_ma_quadratic_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_qpower2_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_uniform_model.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_uniform_model_nb.py +0 -0
- {PyTransit-2.6.1 → pytransit-2.6.4}/tests/test_z.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyTransit
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.4
|
|
4
4
|
Summary: Fast and painless exoplanet transit light curve modelling.
|
|
5
5
|
Author-email: Hannu Parviainen <hpparvi@gmail.com>
|
|
6
6
|
License: GPLv2
|
|
@@ -30,6 +30,7 @@ Requires-Dist: deprecated
|
|
|
30
30
|
Requires-Dist: uncertainties
|
|
31
31
|
Requires-Dist: pyrr
|
|
32
32
|
Requires-Dist: seaborn
|
|
33
|
+
Requires-Dist: emcee
|
|
33
34
|
|
|
34
35
|
PyTransit
|
|
35
36
|
=========
|
|
@@ -40,14 +41,14 @@ PyTransit
|
|
|
40
41
|
[](http://ascl.net/1505.024)
|
|
41
42
|
[](https://zenodo.org/badge/latestdoi/5871/hpparvi/PyTransit)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
*PyTransit: fast and versatile exoplanet transit light curve modelling in Python.* PyTransit provides a set of optimised
|
|
45
|
+
transit models with a unified API that makes modelling complex sets of heterogeneous light curve (nearly) as easy as
|
|
46
|
+
modelling individual transit light curves. The models are optimised with Numba which allows for model evaluation speeds
|
|
47
|
+
paralleling Fortran and C-implementations but with hassle-free platform-independent multithreading.
|
|
48
|
+
|
|
49
|
+
The package has been under continuous development since 2009, and is described in [Parviainen (2015)](http://arxiv.org/abs/1504.07433),
|
|
50
|
+
[Parviainen (2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract), and [Parviainen (2020b)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P/abstract).
|
|
46
51
|
|
|
47
|
-
PyTransit makes transit model evaluation trivial whether modelling straightforward single-passband transit light curves or
|
|
48
|
-
more complex science-cases, such as transmission spectroscopy. Further, the model can be evaluated for a large set of
|
|
49
|
-
parameter sets simultaneously in parallel to optimize the evaluation speed with population-based MCMC samplers and
|
|
50
|
-
optimization methods, such as emcee and DE-MCMC.
|
|
51
52
|
|
|
52
53
|
```Python
|
|
53
54
|
from pytransit import RoadRunnerModel
|
|
@@ -57,9 +58,9 @@ tm.set_data(times)
|
|
|
57
58
|
|
|
58
59
|
tm.evaluate(k=0.1, ldc=[0.2, 0.1], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
59
60
|
|
|
60
|
-
tm.evaluate(k=[0.10, 0.12], ldc=[[0.2, 0.1, 0.5, 0.1]], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
61
|
+
tm.evaluate(k=[0.10, 0.12], ldc=[[0.2, 0.1], [0.5, 0.1]], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
61
62
|
|
|
62
|
-
tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1, 0.5, 0.1],[0.4, 0.2, 0.75, 0.1]],
|
|
63
|
+
tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1], [0.5, 0.1],[0.4, 0.2, 0.75, 0.1]],
|
|
63
64
|
t0=[0.0, 0.01], p=[1, 1], a=[3.0, 2.9], i=[.5*pi, .5*pi])
|
|
64
65
|
```
|
|
65
66
|
|
|
@@ -67,13 +68,15 @@ tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1, 0.5, 0.1],[0.4, 0.2,
|
|
|
67
68
|

|
|
68
69
|

|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
[Parviainen (2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract),
|
|
72
|
-
and [Parviainen (2020b)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P/abstract).
|
|
71
|
+
|
|
73
72
|
|
|
74
73
|
|
|
75
74
|
## Examples and tutorials
|
|
76
75
|
|
|
76
|
+
### EMAC Workshop introduction video
|
|
77
|
+
|
|
78
|
+
[](https://youtu.be/bLnxkFNrMDQ?si=OTjr4kUGK1kkhkLC)
|
|
79
|
+
|
|
77
80
|
### RoadRunner transit model
|
|
78
81
|
|
|
79
82
|
RoadRunner [(Parviainen, 2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract) is a fast exoplanet transit model that can use any radially symmetric function to model stellar limb darkening
|
|
@@ -98,36 +101,6 @@ transmission spectrum light curves.
|
|
|
98
101
|
|
|
99
102
|
Read the docs at [pytransit.readthedocs.io](https://pytransit.readthedocs.io).
|
|
100
103
|
|
|
101
|
-
## News
|
|
102
|
-
- **21.10.2020, version 2.5**
|
|
103
|
-
- Version 2.5 makes modelling of TTVs trivial with ``pytransit.RoadRunnerModel`` and ``pytransit.QuadraticModel``.
|
|
104
|
-
- See the [TTV modelling example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/ttv_model_example.ipynb) for an example of how to evaluate the models for a TTV analysis.
|
|
105
|
-
|
|
106
|
-
- **14.10.2020, version 2.4**
|
|
107
|
-
- Version 2.4 adds ``pytransit.EclipseModel`` to model secondary eclipses with as little hassle as possible.
|
|
108
|
-
- See the [secondary eclipse model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/example_eclipse_model.ipynb)
|
|
109
|
-
for an example of how to use it.
|
|
110
|
-
|
|
111
|
-
- **16.9.2020, Version 2.3**
|
|
112
|
-
- Version 2.3 adds ``OblateStarModel`` to model transits over gravity-darkened rapidly rotating star as presented by Barnes (2009).
|
|
113
|
-
- See the [oblate star model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/osmodel_example_1.ipynb)
|
|
114
|
-
for an example of usage.
|
|
115
|
-
|
|
116
|
-
- **13.9.2020, Version 2.2**
|
|
117
|
-
- Version 2.2 brings a significant speedup to the evaluation speed of all models. The normalised planet-star distances are
|
|
118
|
-
now calculated using a Taylor-series expansion of the planet's (x,y) sky-plane position. The method gives a 2-6 x speedup to the transit
|
|
119
|
-
model evaluation and is detailed in Parviainen & Korth (2020, submitted to MNRAS)
|
|
120
|
-
|
|
121
|
-
- **7.7.2020, Version 2.1**
|
|
122
|
-
- Version 2.1 introduces the *RoadRunner* transit model (Parviainen, submitted to MNRAS, 2020), a fast exoplanet transit model
|
|
123
|
-
that can use any radially symmetric function to model stellar limb darkening while still being faster to evaluate than
|
|
124
|
-
the analytical transit model for quadratic limb darkening.
|
|
125
|
-
- See the [basic example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_1.ipynb),
|
|
126
|
-
the [custom limb darkening notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_2.ipynb),
|
|
127
|
-
and the [LDTk limb darkening model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_3.ipynb).
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
104
|
Installation
|
|
132
105
|
------------
|
|
133
106
|
### PyPI
|
|
@@ -142,7 +115,7 @@ Clone the repository from github and do the normal python package installation
|
|
|
142
115
|
|
|
143
116
|
git clone https://github.com/hpparvi/PyTransit.git
|
|
144
117
|
cd PyTransit
|
|
145
|
-
|
|
118
|
+
pip install .
|
|
146
119
|
|
|
147
120
|
|
|
148
121
|
Citing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyTransit
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.4
|
|
4
4
|
Summary: Fast and painless exoplanet transit light curve modelling.
|
|
5
5
|
Author-email: Hannu Parviainen <hpparvi@gmail.com>
|
|
6
6
|
License: GPLv2
|
|
@@ -30,6 +30,7 @@ Requires-Dist: deprecated
|
|
|
30
30
|
Requires-Dist: uncertainties
|
|
31
31
|
Requires-Dist: pyrr
|
|
32
32
|
Requires-Dist: seaborn
|
|
33
|
+
Requires-Dist: emcee
|
|
33
34
|
|
|
34
35
|
PyTransit
|
|
35
36
|
=========
|
|
@@ -40,14 +41,14 @@ PyTransit
|
|
|
40
41
|
[](http://ascl.net/1505.024)
|
|
41
42
|
[](https://zenodo.org/badge/latestdoi/5871/hpparvi/PyTransit)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
*PyTransit: fast and versatile exoplanet transit light curve modelling in Python.* PyTransit provides a set of optimised
|
|
45
|
+
transit models with a unified API that makes modelling complex sets of heterogeneous light curve (nearly) as easy as
|
|
46
|
+
modelling individual transit light curves. The models are optimised with Numba which allows for model evaluation speeds
|
|
47
|
+
paralleling Fortran and C-implementations but with hassle-free platform-independent multithreading.
|
|
48
|
+
|
|
49
|
+
The package has been under continuous development since 2009, and is described in [Parviainen (2015)](http://arxiv.org/abs/1504.07433),
|
|
50
|
+
[Parviainen (2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract), and [Parviainen (2020b)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P/abstract).
|
|
46
51
|
|
|
47
|
-
PyTransit makes transit model evaluation trivial whether modelling straightforward single-passband transit light curves or
|
|
48
|
-
more complex science-cases, such as transmission spectroscopy. Further, the model can be evaluated for a large set of
|
|
49
|
-
parameter sets simultaneously in parallel to optimize the evaluation speed with population-based MCMC samplers and
|
|
50
|
-
optimization methods, such as emcee and DE-MCMC.
|
|
51
52
|
|
|
52
53
|
```Python
|
|
53
54
|
from pytransit import RoadRunnerModel
|
|
@@ -57,9 +58,9 @@ tm.set_data(times)
|
|
|
57
58
|
|
|
58
59
|
tm.evaluate(k=0.1, ldc=[0.2, 0.1], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
59
60
|
|
|
60
|
-
tm.evaluate(k=[0.10, 0.12], ldc=[[0.2, 0.1, 0.5, 0.1]], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
61
|
+
tm.evaluate(k=[0.10, 0.12], ldc=[[0.2, 0.1], [0.5, 0.1]], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
61
62
|
|
|
62
|
-
tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1, 0.5, 0.1],[0.4, 0.2, 0.75, 0.1]],
|
|
63
|
+
tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1], [0.5, 0.1],[0.4, 0.2, 0.75, 0.1]],
|
|
63
64
|
t0=[0.0, 0.01], p=[1, 1], a=[3.0, 2.9], i=[.5*pi, .5*pi])
|
|
64
65
|
```
|
|
65
66
|
|
|
@@ -67,13 +68,15 @@ tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1, 0.5, 0.1],[0.4, 0.2,
|
|
|
67
68
|

|
|
68
69
|

|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
[Parviainen (2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract),
|
|
72
|
-
and [Parviainen (2020b)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P/abstract).
|
|
71
|
+
|
|
73
72
|
|
|
74
73
|
|
|
75
74
|
## Examples and tutorials
|
|
76
75
|
|
|
76
|
+
### EMAC Workshop introduction video
|
|
77
|
+
|
|
78
|
+
[](https://youtu.be/bLnxkFNrMDQ?si=OTjr4kUGK1kkhkLC)
|
|
79
|
+
|
|
77
80
|
### RoadRunner transit model
|
|
78
81
|
|
|
79
82
|
RoadRunner [(Parviainen, 2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract) is a fast exoplanet transit model that can use any radially symmetric function to model stellar limb darkening
|
|
@@ -98,36 +101,6 @@ transmission spectrum light curves.
|
|
|
98
101
|
|
|
99
102
|
Read the docs at [pytransit.readthedocs.io](https://pytransit.readthedocs.io).
|
|
100
103
|
|
|
101
|
-
## News
|
|
102
|
-
- **21.10.2020, version 2.5**
|
|
103
|
-
- Version 2.5 makes modelling of TTVs trivial with ``pytransit.RoadRunnerModel`` and ``pytransit.QuadraticModel``.
|
|
104
|
-
- See the [TTV modelling example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/ttv_model_example.ipynb) for an example of how to evaluate the models for a TTV analysis.
|
|
105
|
-
|
|
106
|
-
- **14.10.2020, version 2.4**
|
|
107
|
-
- Version 2.4 adds ``pytransit.EclipseModel`` to model secondary eclipses with as little hassle as possible.
|
|
108
|
-
- See the [secondary eclipse model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/example_eclipse_model.ipynb)
|
|
109
|
-
for an example of how to use it.
|
|
110
|
-
|
|
111
|
-
- **16.9.2020, Version 2.3**
|
|
112
|
-
- Version 2.3 adds ``OblateStarModel`` to model transits over gravity-darkened rapidly rotating star as presented by Barnes (2009).
|
|
113
|
-
- See the [oblate star model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/osmodel_example_1.ipynb)
|
|
114
|
-
for an example of usage.
|
|
115
|
-
|
|
116
|
-
- **13.9.2020, Version 2.2**
|
|
117
|
-
- Version 2.2 brings a significant speedup to the evaluation speed of all models. The normalised planet-star distances are
|
|
118
|
-
now calculated using a Taylor-series expansion of the planet's (x,y) sky-plane position. The method gives a 2-6 x speedup to the transit
|
|
119
|
-
model evaluation and is detailed in Parviainen & Korth (2020, submitted to MNRAS)
|
|
120
|
-
|
|
121
|
-
- **7.7.2020, Version 2.1**
|
|
122
|
-
- Version 2.1 introduces the *RoadRunner* transit model (Parviainen, submitted to MNRAS, 2020), a fast exoplanet transit model
|
|
123
|
-
that can use any radially symmetric function to model stellar limb darkening while still being faster to evaluate than
|
|
124
|
-
the analytical transit model for quadratic limb darkening.
|
|
125
|
-
- See the [basic example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_1.ipynb),
|
|
126
|
-
the [custom limb darkening notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_2.ipynb),
|
|
127
|
-
and the [LDTk limb darkening model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_3.ipynb).
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
104
|
Installation
|
|
132
105
|
------------
|
|
133
106
|
### PyPI
|
|
@@ -142,7 +115,7 @@ Clone the repository from github and do the normal python package installation
|
|
|
142
115
|
|
|
143
116
|
git clone https://github.com/hpparvi/PyTransit.git
|
|
144
117
|
cd PyTransit
|
|
145
|
-
|
|
118
|
+
pip install .
|
|
146
119
|
|
|
147
120
|
|
|
148
121
|
Citing
|
|
@@ -79,6 +79,7 @@ pytransit/models/numba/__init__.py
|
|
|
79
79
|
pytransit/models/numba/gdmodel.py
|
|
80
80
|
pytransit/models/numba/general_nb.py
|
|
81
81
|
pytransit/models/numba/ldmodels.py
|
|
82
|
+
pytransit/models/numba/ldtkldm.py
|
|
82
83
|
pytransit/models/numba/ma_chromosphere_nb.py
|
|
83
84
|
pytransit/models/numba/ma_quadratic_nb.py
|
|
84
85
|
pytransit/models/numba/ma_uniform_nb.py
|
|
@@ -93,12 +94,16 @@ pytransit/models/opencl/orbits.cl
|
|
|
93
94
|
pytransit/models/opencl/qpower2.cl
|
|
94
95
|
pytransit/models/roadrunner/__init__.py
|
|
95
96
|
pytransit/models/roadrunner/common.py
|
|
97
|
+
pytransit/models/roadrunner/ecintersection.py
|
|
96
98
|
pytransit/models/roadrunner/model.py
|
|
97
99
|
pytransit/models/roadrunner/model_full.py
|
|
98
100
|
pytransit/models/roadrunner/model_simple.py
|
|
99
101
|
pytransit/models/roadrunner/model_trspec.py
|
|
102
|
+
pytransit/models/roadrunner/opmodel.py
|
|
103
|
+
pytransit/models/roadrunner/opmodel_full.py
|
|
100
104
|
pytransit/models/roadrunner/rrmodel.cl
|
|
101
105
|
pytransit/models/roadrunner/rrmodel.py
|
|
106
|
+
pytransit/models/roadrunner/rrmodel_cl.py
|
|
102
107
|
pytransit/models/roadrunner/tsmodel.py
|
|
103
108
|
pytransit/orbits/__init__.py
|
|
104
109
|
pytransit/orbits/orbits.py
|
|
@@ -7,14 +7,14 @@ PyTransit
|
|
|
7
7
|
[](http://ascl.net/1505.024)
|
|
8
8
|
[](https://zenodo.org/badge/latestdoi/5871/hpparvi/PyTransit)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
*PyTransit: fast and versatile exoplanet transit light curve modelling in Python.* PyTransit provides a set of optimised
|
|
11
|
+
transit models with a unified API that makes modelling complex sets of heterogeneous light curve (nearly) as easy as
|
|
12
|
+
modelling individual transit light curves. The models are optimised with Numba which allows for model evaluation speeds
|
|
13
|
+
paralleling Fortran and C-implementations but with hassle-free platform-independent multithreading.
|
|
14
|
+
|
|
15
|
+
The package has been under continuous development since 2009, and is described in [Parviainen (2015)](http://arxiv.org/abs/1504.07433),
|
|
16
|
+
[Parviainen (2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract), and [Parviainen (2020b)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P/abstract).
|
|
13
17
|
|
|
14
|
-
PyTransit makes transit model evaluation trivial whether modelling straightforward single-passband transit light curves or
|
|
15
|
-
more complex science-cases, such as transmission spectroscopy. Further, the model can be evaluated for a large set of
|
|
16
|
-
parameter sets simultaneously in parallel to optimize the evaluation speed with population-based MCMC samplers and
|
|
17
|
-
optimization methods, such as emcee and DE-MCMC.
|
|
18
18
|
|
|
19
19
|
```Python
|
|
20
20
|
from pytransit import RoadRunnerModel
|
|
@@ -24,9 +24,9 @@ tm.set_data(times)
|
|
|
24
24
|
|
|
25
25
|
tm.evaluate(k=0.1, ldc=[0.2, 0.1], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
26
26
|
|
|
27
|
-
tm.evaluate(k=[0.10, 0.12], ldc=[[0.2, 0.1, 0.5, 0.1]], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
27
|
+
tm.evaluate(k=[0.10, 0.12], ldc=[[0.2, 0.1], [0.5, 0.1]], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
|
|
28
28
|
|
|
29
|
-
tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1, 0.5, 0.1],[0.4, 0.2, 0.75, 0.1]],
|
|
29
|
+
tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1], [0.5, 0.1],[0.4, 0.2, 0.75, 0.1]],
|
|
30
30
|
t0=[0.0, 0.01], p=[1, 1], a=[3.0, 2.9], i=[.5*pi, .5*pi])
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -34,13 +34,15 @@ tm.evaluate(k=[[0.10, 0.12], [0.11, 0.13]], ldc=[[0.2, 0.1, 0.5, 0.1],[0.4, 0.2,
|
|
|
34
34
|

|
|
35
35
|

|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
[Parviainen (2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract),
|
|
39
|
-
and [Parviainen (2020b)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P/abstract).
|
|
37
|
+
|
|
40
38
|
|
|
41
39
|
|
|
42
40
|
## Examples and tutorials
|
|
43
41
|
|
|
42
|
+
### EMAC Workshop introduction video
|
|
43
|
+
|
|
44
|
+
[](https://youtu.be/bLnxkFNrMDQ?si=OTjr4kUGK1kkhkLC)
|
|
45
|
+
|
|
44
46
|
### RoadRunner transit model
|
|
45
47
|
|
|
46
48
|
RoadRunner [(Parviainen, 2020a)](https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.1633P/abstract) is a fast exoplanet transit model that can use any radially symmetric function to model stellar limb darkening
|
|
@@ -65,36 +67,6 @@ transmission spectrum light curves.
|
|
|
65
67
|
|
|
66
68
|
Read the docs at [pytransit.readthedocs.io](https://pytransit.readthedocs.io).
|
|
67
69
|
|
|
68
|
-
## News
|
|
69
|
-
- **21.10.2020, version 2.5**
|
|
70
|
-
- Version 2.5 makes modelling of TTVs trivial with ``pytransit.RoadRunnerModel`` and ``pytransit.QuadraticModel``.
|
|
71
|
-
- See the [TTV modelling example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/ttv_model_example.ipynb) for an example of how to evaluate the models for a TTV analysis.
|
|
72
|
-
|
|
73
|
-
- **14.10.2020, version 2.4**
|
|
74
|
-
- Version 2.4 adds ``pytransit.EclipseModel`` to model secondary eclipses with as little hassle as possible.
|
|
75
|
-
- See the [secondary eclipse model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/example_eclipse_model.ipynb)
|
|
76
|
-
for an example of how to use it.
|
|
77
|
-
|
|
78
|
-
- **16.9.2020, Version 2.3**
|
|
79
|
-
- Version 2.3 adds ``OblateStarModel`` to model transits over gravity-darkened rapidly rotating star as presented by Barnes (2009).
|
|
80
|
-
- See the [oblate star model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/osmodel_example_1.ipynb)
|
|
81
|
-
for an example of usage.
|
|
82
|
-
|
|
83
|
-
- **13.9.2020, Version 2.2**
|
|
84
|
-
- Version 2.2 brings a significant speedup to the evaluation speed of all models. The normalised planet-star distances are
|
|
85
|
-
now calculated using a Taylor-series expansion of the planet's (x,y) sky-plane position. The method gives a 2-6 x speedup to the transit
|
|
86
|
-
model evaluation and is detailed in Parviainen & Korth (2020, submitted to MNRAS)
|
|
87
|
-
|
|
88
|
-
- **7.7.2020, Version 2.1**
|
|
89
|
-
- Version 2.1 introduces the *RoadRunner* transit model (Parviainen, submitted to MNRAS, 2020), a fast exoplanet transit model
|
|
90
|
-
that can use any radially symmetric function to model stellar limb darkening while still being faster to evaluate than
|
|
91
|
-
the analytical transit model for quadratic limb darkening.
|
|
92
|
-
- See the [basic example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_1.ipynb),
|
|
93
|
-
the [custom limb darkening notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_2.ipynb),
|
|
94
|
-
and the [LDTk limb darkening model example notebook](https://github.com/hpparvi/PyTransit/blob/master/notebooks/roadrunner/roadrunner_model_example_3.ipynb).
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
70
|
Installation
|
|
99
71
|
------------
|
|
100
72
|
### PyPI
|
|
@@ -109,7 +81,7 @@ Clone the repository from github and do the normal python package installation
|
|
|
109
81
|
|
|
110
82
|
git clone https://github.com/hpparvi/PyTransit.git
|
|
111
83
|
cd PyTransit
|
|
112
|
-
|
|
84
|
+
pip install .
|
|
113
85
|
|
|
114
86
|
|
|
115
87
|
Citing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "PyTransit"
|
|
3
|
-
version = "2.6.
|
|
3
|
+
version = "2.6.4"
|
|
4
4
|
description = 'Fast and painless exoplanet transit light curve modelling.'
|
|
5
5
|
authors=[{name='Hannu Parviainen', email='hpparvi@gmail.com'}]
|
|
6
6
|
classifiers=[
|
|
@@ -14,7 +14,7 @@ classifiers=[
|
|
|
14
14
|
]
|
|
15
15
|
keywords = ['astronomy', 'astrophysics', 'exoplanets']
|
|
16
16
|
dependencies = ["numpy", "numba", "scipy", "pandas", "xarray", "tables", "meepmeep", "pyopencl", "ldtk",
|
|
17
|
-
"semantic_version", "deprecated", "uncertainties", "pyrr", "seaborn"]
|
|
17
|
+
"semantic_version", "deprecated", "uncertainties", "pyrr", "seaborn", "emcee"]
|
|
18
18
|
requires-python = ">= 3.8"
|
|
19
19
|
readme = "README.md"
|
|
20
20
|
license = {text = "GPLv2"}
|
|
@@ -32,7 +32,3 @@ include-package-data = true
|
|
|
32
32
|
[tool.setuptools.packages.find]
|
|
33
33
|
include = ["pytransit"]
|
|
34
34
|
namespaces = true
|
|
35
|
-
|
|
36
|
-
#[tool.setuptools.package-data]
|
|
37
|
-
#"pytransit.contamination.data" = ["*.nc"]
|
|
38
|
-
#"pytransit" = ["*.fits", "*.txt", "*.csv", "*.h5", "*.nc", "*.cl"]
|
|
@@ -64,12 +64,13 @@ with warnings.catch_warnings():
|
|
|
64
64
|
from .models.eclipse_model import EclipseModel
|
|
65
65
|
from .models.ma_chromosphere import ChromosphereModel
|
|
66
66
|
from .models.general import GeneralModel
|
|
67
|
-
from .models.roadrunner.rrmodel import RoadRunnerModel
|
|
68
|
-
from .models.roadrunner.tsmodel import TransmissionSpectroscopyModel
|
|
69
67
|
from .models.osmodel import OblateStarModel
|
|
70
68
|
from .models.gdmodel import GravityDarkenedModel
|
|
71
69
|
|
|
70
|
+
from .models import RoadRunnerModel, OblatePlanetModel, TransmissionSpectroscopyModel
|
|
71
|
+
|
|
72
72
|
TSModel = TransmissionSpectroscopyModel
|
|
73
|
+
OPModel = OblatePlanetModel
|
|
73
74
|
RRModel = RoadRunnerModel
|
|
74
75
|
|
|
75
76
|
# OpenCL models
|
|
@@ -14,4 +14,11 @@
|
|
|
14
14
|
# You should have received a copy of the GNU General Public License
|
|
15
15
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
|
|
17
|
-
from .transitmodel import TransitModel
|
|
17
|
+
from .transitmodel import TransitModel
|
|
18
|
+
from .roadrunner.rrmodel import RoadRunnerModel
|
|
19
|
+
from .roadrunner.opmodel import OblatePlanetModel
|
|
20
|
+
from .roadrunner.tsmodel import TransmissionSpectroscopyModel
|
|
21
|
+
|
|
22
|
+
RRModel = RoadRunnerModel
|
|
23
|
+
OPModel = OblatePlanetModel
|
|
24
|
+
TSModel = TransmissionSpectroscopyModel
|
|
@@ -22,6 +22,7 @@ from numpy import zeros, interp, pi, ndarray, linspace, meshgrid, transpose
|
|
|
22
22
|
from scipy.interpolate import interpn, interpnd, RegularGridInterpolator as RGI
|
|
23
23
|
|
|
24
24
|
from .ldmodel import LDModel
|
|
25
|
+
from .numba.ldtkldm import trilinear_interpolation_set, integrate_profiles_set
|
|
25
26
|
|
|
26
27
|
try:
|
|
27
28
|
from ldtk import LDPSetCreator
|
|
@@ -53,33 +54,31 @@ class LDTkLDModel(LDModel):
|
|
|
53
54
|
self.profiles = None
|
|
54
55
|
self.rgi = None
|
|
55
56
|
|
|
56
|
-
def _init_interpolation(self, mu
|
|
57
|
+
def _init_interpolation(self, mu):
|
|
57
58
|
self.mu = mu
|
|
58
59
|
self.nmu = mu.size
|
|
59
60
|
c = self.sc.client
|
|
60
61
|
|
|
61
|
-
teffs = linspace(*c.teffl, nteff)
|
|
62
|
-
loggs = linspace(*c.loggl, nlogg)
|
|
63
|
-
zs = linspace(*c.zl, nz)
|
|
62
|
+
teffs = linspace(*c.teffl, self.sc.client.nteff)
|
|
63
|
+
loggs = linspace(*c.loggl, self.sc.client.nlogg)
|
|
64
|
+
zs = linspace(*c.zl, self.sc.client.nz)
|
|
64
65
|
teffg, loggg, zg = meshgrid(teffs, loggs, zs)
|
|
66
|
+
self.teff0, self.dteff, self.nteff = teffs[0], teffs[1]-teffs[0], self.sc.client.nteff
|
|
67
|
+
self.logg0, self.dlogg, self.nlogg = loggs[0], loggs[1]-loggs[0], self.sc.client.nlogg
|
|
68
|
+
self.metal0, self.dmetal, self.nmetal = zs[0], zs[1]-zs[0], self.sc.client.nz
|
|
65
69
|
|
|
66
70
|
self.ps = self.sc.create_profiles(teff=teffg.ravel(), logg=loggg.ravel(), metal=zg.ravel())
|
|
67
71
|
self.ps.resample(mu=self.mu)
|
|
68
|
-
self.profiles = transpose(self.ps._ldps.copy(), axes=(1, 0, 2)).reshape((nteff, nlogg,
|
|
69
|
-
self.rgi = RGI((teffs, loggs, zs), self.profiles)
|
|
72
|
+
self.profiles = transpose(self.ps._ldps.copy(), axes=(1, 0, 2)).reshape((self.nteff, self.nlogg, self.nmetal, self.npb, self.nmu))
|
|
70
73
|
|
|
71
74
|
def __call__(self, mu: ndarray, x: ndarray) -> Tuple[ndarray, ndarray]:
|
|
72
75
|
if self.mu is None or id(mu) != id(self.mu):
|
|
73
|
-
self._init_interpolation(mu
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ldi =
|
|
79
|
-
for ipv in range(npv):
|
|
80
|
-
ldp[ipv] = self.rgi(x[ipv])
|
|
81
|
-
for ipb in range(self.npb):
|
|
82
|
-
ldi[ipv, ipb] = 2 * pi * ntrapz(z, z * ldp[ipv, ipb, :])
|
|
76
|
+
self._init_interpolation(mu)
|
|
77
|
+
ldp = trilinear_interpolation_set(self.profiles, x[:, 0, 0], x[:, 0, 1], x[:, 0, 2],
|
|
78
|
+
self.teff0, self.dteff, self.nteff,
|
|
79
|
+
self.logg0, self.dlogg, self.nlogg,
|
|
80
|
+
self.metal0, self.dmetal, self.nmetal)
|
|
81
|
+
ldi = integrate_profiles_set(self.mu, ldp)
|
|
83
82
|
return ldp, ldi
|
|
84
83
|
|
|
85
84
|
def _evaluate(self, mu: ndarray, x: ndarray) -> ndarray:
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from numba import njit, prange
|
|
2
|
+
from numpy import zeros, floor, sqrt, pi
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@njit
|
|
6
|
+
def trilinear_interpolation_unit_cube(data, x, y, z):
|
|
7
|
+
"""Trilinear interpolation inside a unit cube.
|
|
8
|
+
|
|
9
|
+
Implementation taken from Paul Bourke's notes
|
|
10
|
+
https://paulbourke.net/miscellaneous/interpolation
|
|
11
|
+
"""
|
|
12
|
+
n1 = data.shape[3]
|
|
13
|
+
n2 = data.shape[4]
|
|
14
|
+
ldp = zeros((n1, n2))
|
|
15
|
+
rx, ry, rz = (1.0 - x), (1.0 - y), (1.0 - z)
|
|
16
|
+
|
|
17
|
+
a1 = rx * ry * rz
|
|
18
|
+
a2 = x * ry * rz
|
|
19
|
+
b1 = rx * y * rz
|
|
20
|
+
b2 = rx * ry * z
|
|
21
|
+
c1 = x * ry * z
|
|
22
|
+
c2 = rx * y * z
|
|
23
|
+
d1 = x * y * rz
|
|
24
|
+
d2 = x * y * z
|
|
25
|
+
|
|
26
|
+
for i1 in range(n1):
|
|
27
|
+
for i2 in range(n2):
|
|
28
|
+
ldp[i1, i2] = (data[0, 0, 0, i1, i2] * a1 +
|
|
29
|
+
data[1, 0, 0, i1, i2] * a2 +
|
|
30
|
+
data[0, 1, 0, i1, i2] * b1 +
|
|
31
|
+
data[0, 0, 1, i1, i2] * b2 +
|
|
32
|
+
data[1, 0, 1, i1, i2] * c1 +
|
|
33
|
+
data[0, 1, 1, i1, i2] * c2 +
|
|
34
|
+
data[1, 1, 0, i1, i2] * d1 +
|
|
35
|
+
data[1, 1, 1, i1, i2] * d2)
|
|
36
|
+
return ldp
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@njit
|
|
40
|
+
def trilinear_interpolation_single(data, x, y, z, x0, dx, nx, y0, dy, ny, z0, dz, nz):
|
|
41
|
+
x = min(max(x, x0), x0 + nx * dx)
|
|
42
|
+
y = min(max(y, y0), y0 + ny * dy)
|
|
43
|
+
z = min(max(z, z0), z0 + nz * dz)
|
|
44
|
+
ix = int(floor((x - x0) / dx))
|
|
45
|
+
iy = int(floor((y - y0) / dy))
|
|
46
|
+
iz = int(floor((z - z0) / dz))
|
|
47
|
+
ax = (x - x0 - ix * dx) / dx
|
|
48
|
+
ay = (y - y0 - iy * dy) / dy
|
|
49
|
+
az = (z - z0 - iz * dz) / dz
|
|
50
|
+
return trilinear_interpolation_unit_cube(data[ix:ix + 2, iy:iy + 2, iz:iz + 2, :, :], ax, ay, az)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@njit(parallel=True)
|
|
54
|
+
def trilinear_interpolation_set(data, xs, ys, zs, x0, dx, nx, y0, dy, ny, z0, dz, nz):
|
|
55
|
+
npv = xs.shape[0]
|
|
56
|
+
ldp = zeros((npv, data.shape[3], data.shape[4]))
|
|
57
|
+
for ipv in prange(npv):
|
|
58
|
+
ldp[ipv, :, :] = trilinear_interpolation_single(data, xs[ipv], ys[ipv], zs[ipv], x0, dx, nx, y0, dy, ny, z0, dz,
|
|
59
|
+
nz)
|
|
60
|
+
return ldp
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@njit
|
|
64
|
+
def integrate_profiles_single(mu, ldp):
|
|
65
|
+
nmu = mu.size
|
|
66
|
+
npb = ldp.shape[0]
|
|
67
|
+
ldi = zeros(npb)
|
|
68
|
+
|
|
69
|
+
z = sqrt(1.0 - mu ** 2)
|
|
70
|
+
dz = z[1:] - z[:-1]
|
|
71
|
+
for ipb in range(npb):
|
|
72
|
+
for i in range(1, nmu):
|
|
73
|
+
ldi[ipb] += dz[i - 1] * 0.5 * (z[i] * ldp[ipb, i] + z[i - 1] * ldp[ipb, i - 1])
|
|
74
|
+
return 2.0 * pi * ldi
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@njit(parallel=True)
|
|
78
|
+
def integrate_profiles_set(mu, ldp):
|
|
79
|
+
nmu = mu.size
|
|
80
|
+
npv = ldp.shape[0]
|
|
81
|
+
npb = ldp.shape[1]
|
|
82
|
+
ldi = zeros((npv, npb))
|
|
83
|
+
|
|
84
|
+
z = sqrt(1.0 - mu ** 2)
|
|
85
|
+
dz = z[1:] - z[:-1]
|
|
86
|
+
for j in prange(npv * npb):
|
|
87
|
+
ipv = j // npb
|
|
88
|
+
ipb = j % npb
|
|
89
|
+
for i in range(1, nmu):
|
|
90
|
+
ldi[ipv, ipb] += dz[i - 1] * 0.5 * (z[i] * ldp[ipv, ipb, i] + z[i - 1] * ldp[ipv, ipb, i - 1])
|
|
91
|
+
return 2.0 * pi * ldi
|