PyTransit 2.7.1__tar.gz → 2.8.0__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.
Files changed (161) hide show
  1. {pytransit-2.7.1 → pytransit-2.8.0}/PKG-INFO +2 -2
  2. {pytransit-2.7.1 → pytransit-2.8.0}/PyTransit.egg-info/PKG-INFO +2 -2
  3. {pytransit-2.7.1 → pytransit-2.8.0}/PyTransit.egg-info/SOURCES.txt +0 -2
  4. {pytransit-2.7.1 → pytransit-2.8.0}/PyTransit.egg-info/requires.txt +1 -1
  5. {pytransit-2.7.1 → pytransit-2.8.0}/pyproject.toml +5 -0
  6. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/__init__.py +1 -1
  7. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/eclipse_model.py +1 -27
  8. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/gdmodel.py +8 -7
  9. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ma_chromosphere.py +1 -25
  10. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ma_quadratic.py +1 -34
  11. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ma_uniform.py +1 -25
  12. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/gdmodel.py +26 -28
  13. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/ma_chromosphere_nb.py +0 -32
  14. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/ma_quadratic_nb.py +13 -76
  15. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/ma_uniform_nb.py +20 -67
  16. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/qpower2_nb.py +13 -51
  17. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/udmodel.py +20 -43
  18. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/qpower2.py +1 -26
  19. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/model_eclipse.py +7 -9
  20. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/model_ecspec.py +13 -12
  21. pytransit-2.8.0/pytransit/models/roadrunner/model_full.py +100 -0
  22. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/model_simple.py +7 -8
  23. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/model_trspec.py +21 -20
  24. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/opmodel_full.py +17 -14
  25. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/rrmodel.py +16 -8
  26. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/uniform.py +45 -6
  27. {pytransit-2.7.1 → pytransit-2.8.0}/requirements.txt +1 -1
  28. {pytransit-2.7.1 → pytransit-2.8.0}/tests/test_contamination.py +3 -11
  29. {pytransit-2.7.1 → pytransit-2.8.0}/tests/test_jax_uniformdisk.py +2 -1
  30. {pytransit-2.7.1 → pytransit-2.8.0}/tests/test_limb_darkening.py +3 -0
  31. pytransit-2.8.0/tests/test_ma_quadratic.py +152 -0
  32. pytransit-2.8.0/tests/test_ma_quadratic_nb.py +62 -0
  33. pytransit-2.8.0/tests/test_qpower2_nb.py +51 -0
  34. {pytransit-2.7.1 → pytransit-2.8.0}/tests/test_roadrunner_eclipse.py +21 -13
  35. pytransit-2.8.0/tests/test_transitmodel_helpers.py +193 -0
  36. pytransit-2.8.0/tests/test_uniform_model.py +95 -0
  37. pytransit-2.8.0/tests/test_uniform_model_nb.py +82 -0
  38. pytransit-2.8.0/tests/test_z.py +68 -0
  39. pytransit-2.7.1/pytransit/models/numba/rrmodel.py +0 -633
  40. pytransit-2.7.1/pytransit/models/roadrunner/model.py +0 -21
  41. pytransit-2.7.1/pytransit/models/roadrunner/model_full.py +0 -215
  42. pytransit-2.7.1/tests/test_ma_quadratic.py +0 -175
  43. pytransit-2.7.1/tests/test_ma_quadratic_nb.py +0 -64
  44. pytransit-2.7.1/tests/test_qpower2_nb.py +0 -61
  45. pytransit-2.7.1/tests/test_transitmodel_helpers.py +0 -211
  46. pytransit-2.7.1/tests/test_uniform_model.py +0 -131
  47. pytransit-2.7.1/tests/test_uniform_model_nb.py +0 -87
  48. pytransit-2.7.1/tests/test_z.py +0 -77
  49. {pytransit-2.7.1 → pytransit-2.8.0}/LICENSE +0 -0
  50. {pytransit-2.7.1 → pytransit-2.8.0}/MANIFEST.in +0 -0
  51. {pytransit-2.7.1 → pytransit-2.8.0}/PyTransit.egg-info/dependency_links.txt +0 -0
  52. {pytransit-2.7.1 → pytransit-2.8.0}/PyTransit.egg-info/top_level.txt +0 -0
  53. {pytransit-2.7.1 → pytransit-2.8.0}/README.md +0 -0
  54. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/__init__.py +0 -0
  55. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/contamination.py +0 -0
  56. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/data/spectra.h5 +0 -0
  57. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/data/transmission.nc +0 -0
  58. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/filter.py +0 -0
  59. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/instrument.py +0 -0
  60. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/contamination/plotting.py +0 -0
  61. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/limb_darkening.py +0 -0
  62. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/__init__.py +0 -0
  63. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/baselines/__init__.py +0 -0
  64. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/baselines/legendrebaseline.py +0 -0
  65. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/baselines/linearbaseline.py +0 -0
  66. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/cntlpf.py +0 -0
  67. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/eclipselpf.py +0 -0
  68. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/__init__.py +0 -0
  69. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/celeriteloglikelihood.py +0 -0
  70. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/clloglikelihood.py +0 -0
  71. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/fmcloglikelihood.py +0 -0
  72. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/logisticloglikelihood.py +0 -0
  73. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/multiceleriteloglikelihood.py +0 -0
  74. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/loglikelihood/wnloglikelihood.py +0 -0
  75. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/logposteriorfunction.py +0 -0
  76. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/lpf.py +0 -0
  77. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/mclpf.py +0 -0
  78. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/mptlpf.py +0 -0
  79. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/ocllpf.py +0 -0
  80. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/ocltdvlpf.py +0 -0
  81. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/oclttvlpf.py +0 -0
  82. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/phasecurvelpf.py +0 -0
  83. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/rvlpf.py +0 -0
  84. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tdvlpf.py +0 -0
  85. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tess/__init__.py +0 -0
  86. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tess/ctesslpf.py +0 -0
  87. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tess/tessttvlpf.py +0 -0
  88. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tess/tgclpf.py +0 -0
  89. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tess/tgcmplpf.py +0 -0
  90. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tess/tmpclpf.py +0 -0
  91. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tesslpf.py +0 -0
  92. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/tessoclttvlpf.py +0 -0
  93. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/transitanalysis.py +0 -0
  94. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/transitlpf.py +0 -0
  95. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/lpf/ttvlpf.py +0 -0
  96. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/__init__.py +0 -0
  97. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/general.py +0 -0
  98. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ldmodel.py +0 -0
  99. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ldtkldm.py +0 -0
  100. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/__init__.py +0 -0
  101. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/general.py +0 -0
  102. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/linear.py +0 -0
  103. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/nonlinear.py +0 -0
  104. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/power_2.py +0 -0
  105. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/quadratic.py +0 -0
  106. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/quadratic_tri.py +0 -0
  107. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/limb_darkening/uniform.py +0 -0
  108. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ma_quadratic_cl.py +0 -0
  109. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/ma_uniform_cl.py +0 -0
  110. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/__init__.py +0 -0
  111. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/general_nb.py +0 -0
  112. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/ldmodels.py +0 -0
  113. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/ldtkldm.py +0 -0
  114. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/phasecurves.py +0 -0
  115. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/numba/spmodel.py +0 -0
  116. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/opencl/ma_quadratic.cl +0 -0
  117. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/opencl/ma_uniform.cl +0 -0
  118. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/opencl/orbits.cl +0 -0
  119. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/opencl/qpower2.cl +0 -0
  120. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/osmodel.py +0 -0
  121. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/qpower2_cl.py +0 -0
  122. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/__init__.py +0 -0
  123. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/common.py +0 -0
  124. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/ecintersection.py +0 -0
  125. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/esmodel.py +0 -0
  126. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/opmodel.py +0 -0
  127. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/rrmodel.cl +0 -0
  128. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/rrmodel_cl.py +0 -0
  129. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/roadrunner/tsmodel.py +0 -0
  130. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/models/transitmodel.py +0 -0
  131. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/orbits/__init__.py +0 -0
  132. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/orbits/orbits.py +0 -0
  133. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/orbits/orbits_py.py +0 -0
  134. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/orbits/taylor_z.py +0 -0
  135. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/param/__init__.py +0 -0
  136. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/param/parameter.py +0 -0
  137. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/param/prior.py +0 -0
  138. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/param/utilities.py +0 -0
  139. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/stars/__init__.py +0 -0
  140. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/stars/btsettl.py +0 -0
  141. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/stars/data/avg_bt_settl.fits +0 -0
  142. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/stars/data/avg_husser2013.fits +0 -0
  143. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/stars/husser2013.py +0 -0
  144. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/__init__.py +0 -0
  145. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/astrometry.py +0 -0
  146. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/constants.py +0 -0
  147. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/de.py +0 -0
  148. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/downsample.py +0 -0
  149. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/eclipses.py +0 -0
  150. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/io/__init__.py +0 -0
  151. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/io/lightcurvedata.py +0 -0
  152. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/keplerlc.py +0 -0
  153. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/mdwarfs.py +0 -0
  154. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/misc.py +0 -0
  155. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/mocklc.py +0 -0
  156. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/octasphere.py +0 -0
  157. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/phasecurves.py +0 -0
  158. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/physics.py +0 -0
  159. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/rv.py +0 -0
  160. {pytransit-2.7.1 → pytransit-2.8.0}/pytransit/utils/tess.py +0 -0
  161. {pytransit-2.7.1 → pytransit-2.8.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyTransit
3
- Version: 2.7.1
3
+ Version: 2.8.0
4
4
  Summary: Fast and painless exoplanet transit light curve modelling.
5
5
  Author-email: Hannu Parviainen <hpparvi@gmail.com>
6
6
  License: GPLv2
@@ -35,7 +35,7 @@ Requires-Dist: emcee
35
35
  Requires-Dist: pyopencl
36
36
  Requires-Dist: corner
37
37
  Requires-Dist: celerite
38
- Requires-Dist: meepmeep>=0.8.0
38
+ Requires-Dist: meepmeep>=1.0.0
39
39
  Dynamic: license-file
40
40
 
41
41
  PyTransit
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyTransit
3
- Version: 2.7.1
3
+ Version: 2.8.0
4
4
  Summary: Fast and painless exoplanet transit light curve modelling.
5
5
  Author-email: Hannu Parviainen <hpparvi@gmail.com>
6
6
  License: GPLv2
@@ -35,7 +35,7 @@ Requires-Dist: emcee
35
35
  Requires-Dist: pyopencl
36
36
  Requires-Dist: corner
37
37
  Requires-Dist: celerite
38
- Requires-Dist: meepmeep>=0.8.0
38
+ Requires-Dist: meepmeep>=1.0.0
39
39
  Dynamic: license-file
40
40
 
41
41
  PyTransit
@@ -85,7 +85,6 @@ pytransit/models/numba/ma_quadratic_nb.py
85
85
  pytransit/models/numba/ma_uniform_nb.py
86
86
  pytransit/models/numba/phasecurves.py
87
87
  pytransit/models/numba/qpower2_nb.py
88
- pytransit/models/numba/rrmodel.py
89
88
  pytransit/models/numba/spmodel.py
90
89
  pytransit/models/numba/udmodel.py
91
90
  pytransit/models/opencl/ma_quadratic.cl
@@ -96,7 +95,6 @@ pytransit/models/roadrunner/__init__.py
96
95
  pytransit/models/roadrunner/common.py
97
96
  pytransit/models/roadrunner/ecintersection.py
98
97
  pytransit/models/roadrunner/esmodel.py
99
- pytransit/models/roadrunner/model.py
100
98
  pytransit/models/roadrunner/model_eclipse.py
101
99
  pytransit/models/roadrunner/model_ecspec.py
102
100
  pytransit/models/roadrunner/model_full.py
@@ -17,4 +17,4 @@ emcee
17
17
  pyopencl
18
18
  corner
19
19
  celerite
20
- meepmeep>=0.8.0
20
+ meepmeep>=1.0.0
@@ -35,3 +35,8 @@ include-package-data = true
35
35
  [tool.setuptools.packages.find]
36
36
  include = ["pytransit"]
37
37
  namespaces = true
38
+
39
+ [tool.pytest.ini_options]
40
+ testpaths = ["tests"]
41
+ python_files = ["test_*.py"]
42
+ addopts = "-ra"
@@ -41,7 +41,7 @@ Date
41
41
 
42
42
  """
43
43
 
44
- __version__ = '2.7.1'
44
+ __version__ = '2.8.0'
45
45
 
46
46
  # Generic
47
47
  # -------
@@ -18,7 +18,7 @@ from typing import Union, Optional
18
18
 
19
19
  from numba import njit
20
20
  from numpy import ndarray, squeeze, zeros, asarray, ones
21
- from .numba.ma_uniform_nb import uniform_model_v, uniform_model_s, uniform_model_pv
21
+ from .numba.ma_uniform_nb import uniform_model_v, uniform_model_s
22
22
  from .transitmodel import TransitModel
23
23
 
24
24
  __all__ = ['EclipseModel']
@@ -140,29 +140,3 @@ class EclipseModel(TransitModel):
140
140
  if fr is not None:
141
141
  flux = 1.0 + (flux - 1.0) * fr
142
142
  return squeeze(flux)
143
-
144
- def evaluate_pv(self, pvp: ndarray, fr = None) -> ndarray:
145
- """Evaluate the transit model for a 2D parameter array.
146
-
147
- Parameters
148
- ----------
149
- pvp
150
- Parameter array with a shape `(npv, npar)` where `npv` is the number of parameter vectors, and each row
151
- contains a set of parameters `[k, t0, p, a, i, e, w]`. The radius ratios can also be given per passband,
152
- in which case the row should be structured as `[k_0, k_1, k_2, ..., k_npb, t0, p, a, i, e, w]`.
153
-
154
- Notes
155
- -----
156
- This version of the `evaluate` method is optimized for calculating several models in parallel, such as when
157
- using *emcee* for MCMC sampling.
158
-
159
- Returns
160
- -------
161
- ndarray
162
- Modelled flux either as a 1D or 2D ndarray.
163
- """
164
- assert self.time is not None, "Need to set the data before calling the transit model."
165
- flux = uniform_model_pv(self.time, pvp, self.lcids, self.pbids, self.nsamples, self.exptimes, zsign=-1.0)
166
- if fr is not None:
167
- flux = 1.0 + (flux - 1.0) * fr
168
- return squeeze(flux)
@@ -30,8 +30,9 @@ from .numba.gdmodel import create_star_xy, create_planet_xy, map_osm, xy_taylor_
30
30
  luminosity_v2, planck, create_star_luminosity
31
31
  from ..contamination.filter import Filter, DeltaFilter
32
32
  from ..stars import read_bt_settl_table, read_husser2013_table
33
+ from meepmeep.backends.numba.point2d import solve2d, find_contact_point
34
+
33
35
  from ..orbits import as_from_rhop, i_from_baew
34
- from ..orbits.taylor_z import vajs_from_paiew, find_contact_point
35
36
  from ..utils.octasphere import octasphere
36
37
 
37
38
 
@@ -214,15 +215,15 @@ class GravityDarkenedModel(TransitModel):
214
215
 
215
216
  # Plot the orbit
216
217
  # --------------
217
- y0, vx, vy, ax_, ay, jx, jy, sx, sy = vajs_from_paiew(p, a, inc, e, w)
218
- c1 = find_contact_point(k, 1, y0, vx, vy, ax_, ay, jx, jy, sx, sy)
219
- c4 = find_contact_point(k, 4, y0, vx, vy, ax_, ay, jx, jy, sx, sy)
218
+ cf = solve2d(0.0, p, a, inc, e, w)
219
+ c1 = find_contact_point(k, 1, cf)
220
+ c4 = find_contact_point(k, 4, cf)
220
221
  time = linspace(2 * c1, 2 * c4, 100)
221
222
 
222
- ox, oy = xy_taylor_vt(time, alpha, y0, vx, vy, ax_, ay, jx, jy, sx, sy)
223
+ ox, oy = xy_taylor_vt(time, alpha, cf)
223
224
  ax.plot(ox, oy, 'k')
224
225
 
225
- pxy = xy_taylor_vt(array([0.0]), alpha, y0, vx, vy, ax_, ay, jx, jy, sx, sy)
226
+ pxy = xy_taylor_vt(array([0.0]), alpha, cf)
226
227
  ax.add_artist(Circle(pxy, k, zorder=10, fc='k'))
227
228
 
228
229
  # Plot the info
@@ -314,7 +315,7 @@ class GravityDarkenedModel(TransitModel):
314
315
  st, sx, sy = create_star_xy(res)
315
316
  fstar = create_star_luminosity(res, sx, sy, mstar, self.rstar, ostar, tpole, gpole, f,
316
317
  sphi, cphi, beta, ldc, self._flux_table, self._teff0, self._dteff, self.accurate_mu)
317
- px, py = xy_taylor_vt(self.time - t0, l, *vajs_from_paiew(p, a, i, e, w))
318
+ px, py = xy_taylor_vt(self.time - t0, l, solve2d(0.0, p, a, i, e, w))
318
319
 
319
320
  if plot:
320
321
  fig, ax = subplots()
@@ -17,7 +17,7 @@ from typing import Union
17
17
 
18
18
  from numpy import ndarray, array, squeeze, asarray, zeros, isscalar
19
19
 
20
- from .numba.ma_chromosphere_nb import chromosphere_model_pv, chromosphere_model_v, chromosphere_model_s
20
+ from .numba.ma_chromosphere_nb import chromosphere_model_v, chromosphere_model_s
21
21
  from .transitmodel import TransitModel
22
22
 
23
23
  __all__ = ['ChromosphereModel']
@@ -120,27 +120,3 @@ class ChromosphereModel(TransitModel):
120
120
  self._es, self._ms, self._tae)
121
121
  return squeeze(flux)
122
122
 
123
- def evaluate_pv(self, pvp: ndarray) -> ndarray:
124
- """Evaluate the transit model for a 2D parameter array.
125
-
126
- Parameters
127
- ----------
128
- pvp
129
- Parameter array with a shape `(npv, npar)` where `npv` is the number of parameter vectors, and each row
130
- contains a set of parameters `[k, t0, p, a, i, e, w]`. The radius ratios can also be given per passband,
131
- in which case the row should be structured as `[k_0, k_1, k_2, ..., k_npb, t0, p, a, i, e, w]`.
132
-
133
- Notes
134
- -----
135
- This version of the `evaluate` method is optimized for calculating several models in parallel, such as when
136
- using *emcee* for MCMC sampling.
137
-
138
- Returns
139
- -------
140
- ndarray
141
- Modelled flux either as a 1D or 2D ndarray.
142
- """
143
- assert self.time is not None, "Need to set the data before calling the transit model."
144
- flux = chromosphere_model_pv(self.time, pvp, self.lcids, self.pbids, self.nsamples, self.exptimes, self._es,
145
- self._ms, self._tae)
146
- return squeeze(flux)
@@ -30,7 +30,7 @@ from typing import Union, Optional, List
30
30
 
31
31
  from numpy import ndarray, array, squeeze, atleast_2d, atleast_1d, zeros, asarray, inf, isscalar
32
32
 
33
- from .numba.ma_quadratic_nb import quadratic_model_pv, calculate_interpolation_tables, quadratic_model_v, quadratic_model_s
33
+ from .numba.ma_quadratic_nb import calculate_interpolation_tables, quadratic_model_v, quadratic_model_s
34
34
  from .transitmodel import TransitModel
35
35
 
36
36
  __all__ = ['QuadraticModel']
@@ -191,39 +191,6 @@ class QuadraticModel(TransitModel):
191
191
  self.ed, self.ld, self.le, self.kt, self.zt, self.interpolate)
192
192
  return squeeze(flux)
193
193
 
194
- def evaluate_pv(self, pvp: ndarray, ldc: ndarray, copy: bool = True) -> ndarray:
195
- """Evaluate the transit model for a 2D parameter array.
196
-
197
- Parameters
198
- ----------
199
- pvp: ndarray
200
- Parameter array with a shape `(npv, npar)` where `npv` is the number of parameter vectors, and each row
201
- contains a set of parameters `[k, t0, p, a, i, e, w]`. The radius ratios can also be given per passband,
202
- in which case the row should be structured as `[k_0, k_1, k_2, ..., k_npb, t0, p, a, b, e, w]`.
203
- ldc: ndarray
204
- Limb darkening coefficient array with shape `(npv, 2*npb)`, where `npv` is the number of parameter vectors
205
- and `npb` is the number of passbands.
206
-
207
- Notes
208
- -----
209
- This version of the `evaluate` method is optimized for calculating several models in parallel, such as when
210
- using *emcee* for MCMC sampling.
211
-
212
- Returns
213
- -------
214
- ndarray
215
- Modelled flux either as a 1D or 2D ndarray.
216
- """
217
-
218
- ldc = asarray(ldc)
219
- pvp = asarray(pvp)
220
-
221
- if self.time is None:
222
- raise ValueError("Need to set the data before calling the transit model.")
223
-
224
- flux = quadratic_model_pv(self.time, pvp, ldc, self.lcids, self.pbids, self.nsamples, self.exptimes,
225
- self.npb, self.ed, self.ld, self.le, self.kt, self.zt, self.interpolate)
226
- return squeeze(flux)
227
194
 
228
195
  def to_opencl(self):
229
196
  """Creates an OpenCL clone (`QuadraticModelCL`) of the transit model.
@@ -16,7 +16,7 @@
16
16
 
17
17
  from typing import Union
18
18
  from numpy import ndarray, squeeze, zeros, asarray, isscalar
19
- from .numba.ma_uniform_nb import uniform_model_v, uniform_model_s, uniform_model_pv
19
+ from .numba.ma_uniform_nb import uniform_model_v, uniform_model_s
20
20
  from .transitmodel import TransitModel
21
21
 
22
22
  __all__ = ['UniformModel']
@@ -122,27 +122,3 @@ class UniformModel(TransitModel):
122
122
  k = asarray(k)
123
123
  flux = uniform_model_s(self.time, k, t0, p, a, i, e, w, self.lcids, self.pbids, self.nsamples, self.exptimes, zsign=self._zsign)
124
124
  return squeeze(flux)
125
-
126
- def evaluate_pv(self, pvp: ndarray) -> ndarray:
127
- """Evaluate the transit model for a 2D parameter array.
128
-
129
- Parameters
130
- ----------
131
- pvp
132
- Parameter array with a shape `(npv, npar)` where `npv` is the number of parameter vectors, and each row
133
- contains a set of parameters `[k, t0, p, a, i, e, w]`. The radius ratios can also be given per passband,
134
- in which case the row should be structured as `[k_0, k_1, k_2, ..., k_npb, t0, p, a, i, e, w]`.
135
-
136
- Notes
137
- -----
138
- This version of the `evaluate` method is optimized for calculating several models in parallel, such as when
139
- using *emcee* for MCMC sampling.
140
-
141
- Returns
142
- -------
143
- ndarray
144
- Modelled flux either as a 1D or 2D ndarray.
145
- """
146
- assert self.time is not None, "Need to set the data before calling the transit model."
147
- flux = uniform_model_pv(self.time, pvp, self.lcids, self.pbids, self.nsamples, self.exptimes, zsign=self._zsign)
148
- return squeeze(flux)
@@ -19,8 +19,9 @@ from scipy.constants import G, k, h, c
19
19
  from numpy import exp, pi, sqrt, zeros, sin, cos, nan, inf, linspace, meshgrid, floor, isfinite, fmax, isnan, nanmean, \
20
20
  arange, zeros_like, atleast_2d, array, cross, sign
21
21
 
22
+ from meepmeep.backends.numba.point2d import solve2d, find_contact_point, bounding_box
23
+
22
24
  from ..roadrunner.common import circle_circle_intersection_area
23
- from ...orbits.taylor_z import vajs_from_paiew, find_contact_point, t14
24
25
 
25
26
  d2sec = 24.*60.*60.
26
27
 
@@ -397,18 +398,18 @@ def mean_luminosity_under_planet(x, y, mstar, rstar, ostar, tpole, gpole, f, sph
397
398
 
398
399
 
399
400
  @njit
400
- def calculate_luminosity_interpolation_table(res, k, xp, yp, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy,
401
+ def calculate_luminosity_interpolation_table(res, k, xp, yp, sa, ca, c,
401
402
  mstar, rstar, ostar, tpole, gpole, f, sphi, cphi, beta, ldc,
402
403
  ftable, t0, dt, accurate_mu):
403
- t1 = find_contact_point(k, 1, y0, vx, vy, ax, ay, jx, jy, sx, sy)
404
- t4 = find_contact_point(k, 4, y0, vx, vy, ax, ay, jx, jy, sx, sy)
404
+ t1 = find_contact_point(k, 1, c)
405
+ t4 = find_contact_point(k, 4, c)
405
406
  times = linspace(t1, t4, res)
406
407
 
407
408
  npb = ftable.shape[0]
408
409
  lt = zeros((npb, res))
409
410
  for ipb in range(npb):
410
411
  for i in range(lt.shape[1]):
411
- x, y = xy_taylor_st(times[i], sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy)
412
+ x, y = xy_taylor_st(times[i], sa, ca, c)
412
413
  xs = x + k * xp
413
414
  ys = y + k * yp
414
415
  lt[ipb, i] = mean_luminosity_under_planet(xs, ys, mstar, rstar, ostar, tpole, gpole, f, sphi, cphi, beta, ldc,
@@ -436,12 +437,9 @@ def calculate_luminosity_interpolation_table(res, k, xp, yp, sa, ca, y0, vx, vy,
436
437
 
437
438
 
438
439
  @njit(fastmath=True)
439
- def xy_taylor_st(t, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy):
440
- t2 = t*t
441
- t3 = t2*t
442
- t4 = t3*t
443
- px = vx*t + 0.5*ax*t2 + jx*t3/6.0 + sx*t4/24.
444
- py = y0 + vy*t + 0.5*ay*t2 + jy*t3/6.0 + sy*t4/24.
440
+ def xy_taylor_st(t, sa, ca, c):
441
+ px = c[0, 0] + t*(c[0, 1] + t*(c[0, 2] + t*(c[0, 3] + t*c[0, 4])))
442
+ py = c[1, 0] + t*(c[1, 1] + t*(c[1, 2] + t*(c[1, 3] + t*c[1, 4])))
445
443
 
446
444
  x = ca*px - sa*py
447
445
  y = ca*py + sa*px
@@ -450,18 +448,15 @@ def xy_taylor_st(t, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy):
450
448
 
451
449
 
452
450
  @njit(fastmath=True)
453
- def xy_taylor_vt(ts, a, y0, vx, vy, ax, ay, jx, jy, sx, sy):
451
+ def xy_taylor_vt(ts, a, c):
454
452
  npt = ts.size
455
453
  x, y = zeros(npt), zeros(npt)
456
454
  ca, sa = cos(a), sin(a)
457
455
 
458
456
  for i in range(npt):
459
457
  t = ts[i]
460
- t2 = t*t
461
- t3 = t2*t
462
- t4 = t3*t
463
- px = vx*t + 0.5*ax*t2 + jx*t3/6.0 + sx*t4/24.
464
- py = y0 + vy*t + 0.5*ay*t2 + jy*t3/6.0 + sy*t4/24.
458
+ px = c[0, 0] + t*(c[0, 1] + t*(c[0, 2] + t*(c[0, 3] + t*c[0, 4])))
459
+ py = c[1, 0] + t*(c[1, 1] + t*(c[1, 2] + t*(c[1, 3] + t*c[1, 4])))
465
460
 
466
461
  x[i] = ca*px - sa*py
467
462
  y[i] = ca*py + sa*px
@@ -470,7 +465,7 @@ def xy_taylor_vt(ts, a, y0, vx, vy, ax, ay, jx, jy, sx, sy):
470
465
 
471
466
 
472
467
  @njit
473
- def find_contact_point_2d(k: float, point: int, az, feff, y0, vx, vy, ax, ay, jx, jy, sx, sy):
468
+ def find_contact_point_2d(k: float, point: int, az, feff, c):
474
469
  if point == 1 or point == 2 or point == 12:
475
470
  s = -1.0
476
471
  else:
@@ -483,14 +478,16 @@ def find_contact_point_2d(k: float, point: int, az, feff, y0, vx, vy, ax, ay, jx
483
478
  else:
484
479
  zt = 1.0
485
480
 
481
+ vx = c[0, 1]
482
+
486
483
  t0 = 0.0
487
484
  t2 = s * 2.0 / vx
488
485
  t1 = 0.5 * t2
489
486
 
490
487
  sa, ca = sin(az), cos(az)
491
488
 
492
- x0, y0 = xy_taylor_st(t0, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy)
493
- x1, y1 = xy_taylor_st(t1, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy)
489
+ x0, y0 = xy_taylor_st(t0, sa, ca, c)
490
+ x1, y1 = xy_taylor_st(t1, sa, ca, c)
494
491
  z0 = sqrt(x0 ** 2 + (y0 / (1 - feff)) ** 2) - zt
495
492
  z1 = sqrt(x1 ** 2 + (y1 / (1 - feff)) ** 2) - zt
496
493
 
@@ -499,12 +496,12 @@ def find_contact_point_2d(k: float, point: int, az, feff, y0, vx, vy, ax, ay, jx
499
496
  if z0 * z1 < 0.0:
500
497
  t1, t2 = 0.5 * (t0 + t1), t1
501
498
  z2 = z1
502
- x1, y1 = xy_taylor_st(t1, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy)
499
+ x1, y1 = xy_taylor_st(t1, sa, ca, c)
503
500
  z1 = sqrt(x1 ** 2 + (y1 / (1 - feff)) ** 2) - zt
504
501
  else:
505
502
  t0, t1 = t1, 0.5 * (t1 + t2)
506
503
  z0 = z1
507
- x1, y1 = xy_taylor_st(t1, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy)
504
+ x1, y1 = xy_taylor_st(t1, sa, ca, c)
508
505
  z1 = sqrt(x1 ** 2 + (y1 / (1 - feff)) ** 2) - zt
509
506
  i += 1
510
507
  return t1
@@ -516,16 +513,17 @@ def oblate_model_s(t, k, t0, p, a, aa, i, e, w, ldc,
516
513
  f, feff, sphi, cphi, beta, ftable, teff0, dteff,
517
514
  tres, ts, xs, ys, xp, yp,
518
515
  lcids, pbids, nsamples, exptimes, npb, accurate_mu):
519
- y0, vx, vy, ax, ay, jx, jy, sx, sy = vajs_from_paiew(p, a, i, e, w)
516
+ c = solve2d(0.0, p, a, i, e, w)
520
517
  ldc = atleast_2d(ldc)
521
518
 
522
519
  sa, ca = sin(aa), cos(aa)
523
- half_window_width = 0.025 + 0.5 * t14(k[0], y0, vx, vy, ax, ay, jx, jy, sx, sy)
520
+ bt1, bt4 = bounding_box(k[0], c)
521
+ bt1 -= 0.025
522
+ bt4 += 0.025
524
523
 
525
524
  npt = t.size
526
525
  flux = zeros(npt)
527
- tp, lp = calculate_luminosity_interpolation_table(tres, k[0], xp, yp, sa, ca,
528
- y0, vx, vy, ax, ay, jx, jy, sx, sy,
526
+ tp, lp = calculate_luminosity_interpolation_table(tres, k[0], xp, yp, sa, ca, c,
529
527
  mstar, rstar, ostar, tpole, gpole, f,
530
528
  sphi, cphi, beta, ldc, ftable, teff0, dteff, accurate_mu)
531
529
  dtp = tp[1] - tp[0]
@@ -541,7 +539,7 @@ def oblate_model_s(t, k, t0, p, a, aa, i, e, w, ldc,
541
539
  for j in range(npt):
542
540
  epoch = floor((t[j] - t0 + 0.5*p)/p)
543
541
  tc = t[j] - (t0 + epoch*p)
544
- if abs(tc) > half_window_width:
542
+ if not (bt1 <= tc <= bt4):
545
543
  flux[j] = 1.0
546
544
  else:
547
545
  ilc = lcids[j]
@@ -570,7 +568,7 @@ def oblate_model_s(t, k, t0, p, a, aa, i, e, w, ldc,
570
568
  at = (to - tp[it]) / dtp
571
569
  ml = (1.0 - at) * lp[ipb, it] + at * lp[ipb, it + 1]
572
570
 
573
- x, y = xy_taylor_st(to, sa, ca, y0, vx, vy, ax, ay, jx, jy, sx, sy)
571
+ x, y = xy_taylor_st(to, sa, ca, c)
574
572
 
575
573
  b = sqrt(x**2 + (y / (1. - feff))**2)
576
574
  ia = circle_circle_intersection_area(1., _k, b)
@@ -213,35 +213,3 @@ def chromosphere_model_s(t, k, t0, p, a, i, e, w, lcids, pbids, nsamples, exptim
213
213
  flux[j] += chromosphere_z_s(z, _k)
214
214
  flux[j] /= nsamples[ilc]
215
215
  return flux
216
-
217
- @njit(parallel=True, fastmath=True)
218
- def chromosphere_model_pv(t, pvp, lcids, pbids, nsamples, exptimes, es, ms, tae):
219
- pvp = atleast_2d(pvp)
220
- npv = pvp.shape[0]
221
- npt = t.size
222
- nk = pvp.shape[1] - 6
223
-
224
- flux = zeros((npv, npt))
225
- for j in prange(npt):
226
- for ipv in range(npv):
227
- t0, p, a, i, e, w = pvp[ipv,nk:]
228
- ilc = lcids[j]
229
- ipb = pbids[ilc]
230
-
231
- if nk == 1:
232
- k = pvp[ipv, 0]
233
- else:
234
- if ipb < nk:
235
- k = pvp[ipv, ipb]
236
- else:
237
- k = nan
238
-
239
- for isample in range(1,nsamples[ilc]+1):
240
- time_offset = exptimes[ilc] * ((isample - 0.5) / nsamples[ilc] - 0.5)
241
- z = z_ip_s(t[j]+time_offset, t0, p, a, i, e, w, es, ms, tae)
242
- if z > 1.0+k:
243
- flux[ipv, j] += 1.
244
- else:
245
- flux[ipv, j] += chromosphere_z_s(z, k)
246
- flux[ipv, j] /= nsamples[ilc]
247
- return flux
@@ -45,7 +45,7 @@ from numba import njit, prange
45
45
  from numpy import pi, sqrt, arccos, abs, log, zeros, linspace, array, atleast_2d, floor, inf, isnan, atleast_1d, ndarray, nan, copysign, \
46
46
  fmax, any
47
47
 
48
- from ...orbits.taylor_z import vajs_from_paiew, z_taylor_st, t14
48
+ from meepmeep.backends.numba.point2d import solve2d, sep_c, bounding_box
49
49
 
50
50
  HALF_PI = 0.5 * pi
51
51
  FOUR_PI = 4.0 * pi
@@ -555,8 +555,10 @@ def quadratic_model_v(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
555
555
  flux[ipv, :] = inf
556
556
  continue
557
557
 
558
- y0, vx, vy, ax, ay, jx, jy, sx, sy = vajs_from_paiew(p[ipv], a[ipv], i[ipv], e[ipv], w[ipv])
559
- half_window_width = 0.025 + 0.5 * t14(k[ipv,0], y0, vx, vy, ax, ay, jx, jy, sx, sy)
558
+ c = solve2d(0.0, p[ipv], a[ipv], i[ipv], e[ipv], w[ipv])
559
+ bt1, bt4 = bounding_box(k[ipv, 0], c)
560
+ bt1 -= 0.025
561
+ bt4 += 0.025
560
562
 
561
563
  for j in range(npt):
562
564
  ilc = lcids[j]
@@ -565,7 +567,7 @@ def quadratic_model_v(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
565
567
  epoch = floor((t[j] - t0[ipv, iep] + 0.5 * p[ipv]) / p[ipv])
566
568
  tc = t[j] - (t0[ipv, iep] + epoch * p[ipv])
567
569
 
568
- if abs(tc) > half_window_width:
570
+ if not (bt1 <= tc <= bt4):
569
571
  flux[ipv, j] = 1.0
570
572
  else:
571
573
  ipb = pbids[ilc]
@@ -581,7 +583,7 @@ def quadratic_model_v(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
581
583
  else:
582
584
  for isample in range(1, nsamples[ilc] + 1):
583
585
  time_offset = exptimes[ilc] * ((isample - 0.5) / nsamples[ilc] - 0.5)
584
- z = z_taylor_st(tc + time_offset, y0, vx, vy, ax, ay, jx, jy, sx, sy)
586
+ z = sep_c(tc + time_offset, c)
585
587
  if z > 1.0 + _k:
586
588
  flux[ipv, j] += 1.
587
589
  else:
@@ -607,8 +609,10 @@ def quadratic_model_s(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
607
609
  if epids.max() != t0.size - 1:
608
610
  raise ValueError("The number of transit centers must equal to the number of individual epoch IDs.")
609
611
 
610
- y0, vx, vy, ax, ay, jx, jy, sx, sy = vajs_from_paiew(p, a, i, e, w)
611
- half_window_width = 0.025 + 0.5 * t14(k[0], y0, vx, vy, ax, ay, jx, jy, sx, sy)
612
+ c = solve2d(0.0, p, a, i, e, w)
613
+ bt1, bt4 = bounding_box(k[0], c)
614
+ bt1 -= 0.025
615
+ bt4 += 0.025
612
616
 
613
617
  npt = t.size
614
618
  flux = zeros(npt)
@@ -623,7 +627,7 @@ def quadratic_model_s(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
623
627
 
624
628
  epoch = floor((t[j] - t0[iep] + 0.5 * p) / p)
625
629
  tc = t[j] - (t0[iep] + epoch * p)
626
- if abs(tc) > half_window_width:
630
+ if not (bt1 <= tc <= bt4):
627
631
  flux[j] = 1.0
628
632
  else:
629
633
  ipb = pbids[ilc]
@@ -640,7 +644,7 @@ def quadratic_model_s(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
640
644
  else:
641
645
  for isample in range(1, nsamples[ilc] + 1):
642
646
  time_offset = exptimes[ilc] * ((isample - 0.5) / nsamples[ilc] - 0.5)
643
- z = z_taylor_st(tc + time_offset, y0, vx, vy, ax, ay, jx, jy, sx, sy)
647
+ z = sep_c(tc + time_offset, c)
644
648
  if z > 1.0 + _k:
645
649
  flux[j] += 1.
646
650
  else:
@@ -650,70 +654,3 @@ def quadratic_model_s(t, k, t0, p, a, i, e, w, ldc, lcids, pbids, epids, nsample
650
654
  flux[j] += eval_quad_z_s(z, _k, ld)
651
655
  flux[j] /= nsamples[ilc]
652
656
  return flux
653
-
654
-
655
- # Quadratic model for parameter array
656
- # -----------------------------------
657
- @njit(parallel=True, fastmath=False)
658
- def quadratic_model_pv(t, pvp, ldc, lcids, pbids, nsamples, exptimes, npb, edt, ldt, let, kt, zt, interpolate):
659
- pvp = atleast_2d(pvp)
660
- ldc = atleast_2d(ldc)
661
-
662
- if ldc.shape[1] != 2*npb:
663
- raise ValueError("The quadratic model needs two limb darkening coefficients per passband")
664
- if ldc.shape[0] != pvp.shape[0]:
665
- raise ValueError(
666
- 'The parameter array and the limb darkening coefficient array have mismatching shapes. The first dimension must match.')
667
-
668
- npv = pvp.shape[0]
669
- nk = pvp.shape[1] - 6
670
- npt = t.size
671
- flux = zeros((npv, npt))
672
-
673
- for ipv in prange(npv):
674
- t0, p, a, i, e, w = pvp[ipv, nk:]
675
- y0, vx, vy, ax, ay, jx, jy, sx, sy = vajs_from_paiew(p, a, i, e, w)
676
- half_window_width = 0.025 + 0.5 * t14(pvp[ipv, 0], y0, vx, vy, ax, ay, jx, jy, sx, sy)
677
-
678
- if interpolate and (any(pvp[ipv, :nk] < kt[0]) or any(pvp[ipv, :nk] > kt[-1])):
679
- flux[ipv, :] = inf
680
- continue
681
-
682
- if any(isnan(pvp[ipv, :nk])) or isnan(a):
683
- flux[ipv, :] = inf
684
- continue
685
-
686
- for j in prange(npt):
687
- epoch = floor((t[j] - t0 + 0.5 * p) / p)
688
- tc = t[j] - (t0 + epoch * p)
689
- if abs(tc) > half_window_width:
690
- flux[ipv, j] = 1.0
691
- else:
692
- ilc = lcids[j]
693
- ipb = pbids[ilc]
694
-
695
- if nk == 1:
696
- k = pvp[ipv, 0]
697
- else:
698
- if ipb < nk:
699
- k = pvp[ipv, ipb]
700
- else:
701
- k = nan
702
-
703
- ld = ldc[ipv, 2 * ipb:2 * (ipb + 1)]
704
- if isnan(ld[0]) or isnan(ld[1]):
705
- flux[ipv, j] = inf
706
- continue
707
-
708
- for isample in range(1, nsamples[ilc]+1):
709
- time_offset = exptimes[ilc] * ((isample - 0.5) / nsamples[ilc] - 0.5)
710
- z = z_taylor_st(tc + time_offset, y0, vx, vy, ax, ay, jx, jy, sx, sy)
711
- if z > 1.0+k:
712
- flux[ipv, j] += 1.
713
- else:
714
- if interpolate:
715
- flux[ipv, j] += quadratic_interpolated_z_s(z, k, ld, edt, ldt, let, kt, zt)
716
- else:
717
- flux[ipv, j] += eval_quad_z_s(z, k, ld)
718
- flux[ipv, j] /= nsamples[ilc]
719
- return flux