PyTransit 2.10.0__tar.gz → 2.10.1__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.10.0 → pytransit-2.10.1}/CHANGELOG.md +18 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/PKG-INFO +1 -1
- {pytransit-2.10.0 → pytransit-2.10.1}/PyTransit.egg-info/PKG-INFO +1 -1
- {pytransit-2.10.0 → pytransit-2.10.1}/PyTransit.egg-info/SOURCES.txt +6 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/PyTransit.egg-info/scm_file_list.json +6 -0
- pytransit-2.10.1/PyTransit.egg-info/scm_version.json +8 -0
- pytransit-2.10.1/docs/source/_figures/chromosphere.py +129 -0
- pytransit-2.10.1/docs/source/_figures/gdmodel.py +126 -0
- pytransit-2.10.1/docs/source/_figures/opmodel.py +204 -0
- pytransit-2.10.1/docs/source/_figures/rr_benchmark.py +114 -0
- pytransit-2.10.1/docs/source/features/chromosphere.rst +82 -0
- pytransit-2.10.1/docs/source/features/gdmodel.rst +113 -0
- pytransit-2.10.1/docs/source/features/opmodel.rst +137 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/features/roadrunner.rst +35 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/chromosphere.rst +8 -6
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/gdmodel.rst +43 -15
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/opmodel.rst +5 -2
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/roadrunner.rst +80 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/_version.py +3 -3
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/gdmodel.py +64 -12
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/gdmodel.py +24 -3
- pytransit-2.10.1/tests/test_chromosphere_model.py +102 -0
- pytransit-2.10.1/tests/test_gdmodel.py +119 -0
- pytransit-2.10.0/PyTransit.egg-info/scm_version.json +0 -8
- pytransit-2.10.0/docs/source/features/chromosphere.rst +0 -35
- pytransit-2.10.0/docs/source/features/gdmodel.rst +0 -40
- pytransit-2.10.0/docs/source/features/opmodel.rst +0 -37
- {pytransit-2.10.0 → pytransit-2.10.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/.github/workflows/python-package.yml +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/.github/workflows/python-publish.yml +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/.gitignore +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/.readthedocs.yaml +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/.travis.yml +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/CITATIONS.bib +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/CODE_OF_CONDUCT.md +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/LICENSE +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/MANIFEST.in +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/PyTransit.egg-info/dependency_links.txt +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/PyTransit.egg-info/requires.txt +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/PyTransit.egg-info/top_level.txt +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/README.md +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/_config.yml +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/Makefile +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/requirements.txt +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/_figures/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/_figures/dataset_arrays.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/_figures/highlights.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/_figures/roadrunner.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/_figures/tsmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/_static/.gitkeep +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/api/deprecated.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/api/index.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/api/limb_darkening.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/api/transitmodel.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/basic_example_1.png +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/basic_example_1.svg +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/basic_example_2.png +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/basic_example_2.svg +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/basic_example_3.png +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/basic_example_3.svg +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/conf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/contamination.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/features/index.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/features/tsmodel.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/guide/data_setup.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/guide/evaluation.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/guide/index.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/guide/interface.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/guide/limb_darkening.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/guide/opencl.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/highlights.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/index.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/installation.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/io.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/eclipse.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/general.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/index.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/opencl.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/qpower2.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/quadratic.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/tsmodel.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/models/uniform.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/notebooks/models/roadrunner/common.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/notebooks/models/roadrunner/roadrunner_model_example_1.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/notebooks/models/roadrunner/roadrunner_model_example_2.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/notebooks/models/roadrunner/roadrunner_model_example_3.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/notebooks/models/roadrunner/roadrunner_model_theory.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/notebooks/quickstart.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/docs/source/stars.rst +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/001_simple_broadband_parameter_estimation.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/01_broadband_parameter_estimation.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/A1_impact_parameter_accuracy.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/A2_Supersampling.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/2024_m_dwarf_host_example_plots.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/2024_m_dwarf_host_example_simulations.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/contamination_1_black_body_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/contamination_2_physical_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/contamination_3_comparison.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/example_1a.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/example_1b.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/example_2a.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/example_2b.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/src/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/src/blendlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/src/core.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/src/mocklc.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/contamination/src/plotting.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/core.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/data/obs_data.fits +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/example_chromosphere_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/example_eclipse_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/example_qpower2_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/example_qpower2_opencl_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/example_quadratic_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/example_uniform_model.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/model_example_1.png +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/oblate_planet_example/figures.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/oblate_planet_example/opmodel_example_1.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/oblate_planet_example/opmodel_geometry.pdf +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/osmodel_1.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/osmodel_example_1.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/osmodel_visualization_example.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/roadrunner/common.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/roadrunner/tsmodel_example_1.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/tess_examples/WASP-4b.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/tess_examples/data/tess2018234235059-s0002-0000000402026209-0121-s_lc.fits +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/tess_examples/data/tess2019032160000-s0008-0000000413248763-0136-s_lc.fits +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/tess_examples/data/wasp_4b_transit_times.csv +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/tsmodel/test_accuracy.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notebooks/ttv_model_example.ipynb +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/notes/opencl-rrmodel-pt3-migration.md +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pyproject.toml +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/contamination.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/data/spectra.h5 +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/data/transmission.nc +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/filter.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/instrument.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/contamination/plotting.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/limb_darkening.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/baselines/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/baselines/legendrebaseline.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/baselines/linearbaseline.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/baselines/lstsqbaseline.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/cntlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/eclipselpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/celeriteloglikelihood.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/clloglikelihood.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/fmcloglikelihood.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/logisticloglikelihood.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/multiceleriteloglikelihood.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/loglikelihood/wnloglikelihood.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/logposteriorfunction.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/lpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/mclpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/mptlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/ocllpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/ocltdvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/oclttvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/phasecurvelpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/rvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tdvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tess/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tess/ctesslpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tess/tessttvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tess/tgclpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tess/tgcmplpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tess/tmpclpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tesslpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/tessoclttvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/transitanalysis.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/transitlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/lpf/ttvlpf.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/_deprecation.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/eclipse_model.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/general.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ldmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ldtkldm.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/evaluation.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/exponential.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/general.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/linear.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/logarithmic.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/nonlinear.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/power_2.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/quadratic.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/quadratic_tri.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/square_root.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/limb_darkening/uniform.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ma_chromosphere.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ma_quadratic.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ma_quadratic_cl.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ma_uniform.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/ma_uniform_cl.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/new_eclipse_model.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/general_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/ldmodels.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/ldtkldm.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/ma_chromosphere_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/ma_quadratic_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/ma_uniform_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/phasecurves.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/qpower2_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/spmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/numba/udmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/opencl/ma_quadratic.cl +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/opencl/ma_uniform.cl +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/opencl/orbits.cl +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/opencl/qpower2.cl +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/opencltransitmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/osmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/qpower2.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/qpower2_cl.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/common.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/ecintersection.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/esmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/model_eclipse.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/model_ecspec.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/model_full.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/model_simple.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/model_trspec.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/opmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/opmodel_full.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/rrmodel.cl +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/rrmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/rrmodel_cl.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/roadrunner/tsmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/transitmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/models/uniform.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/orbits/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/orbits/orbits.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/orbits/orbits_py.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/orbits/taylor_z.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/param/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/param/parameter.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/param/prior.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/param/utilities.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/stars/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/stars/btsettl.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/stars/data/avg_bt_settl.fits +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/stars/data/avg_husser2013.fits +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/stars/husser2013.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/astrometry.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/constants.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/de.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/downsample.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/eclipses.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/io/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/io/base.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/io/lcdata.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/io/rvdata.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/keplerlc.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/mdwarfs.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/misc.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/mocklc.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/octasphere.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/phasecurves.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/physics.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/rv.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/pytransit/utils/tess.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/requirements.txt +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/setup.cfg +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/__init__.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/conftest.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/reference_flux.npz +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_contamination.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_ecintersection.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_lcdata.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_limb_darkening.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_lpf_plotting.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_lpf_pool.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_lstsqbaseline.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_ma_quadratic.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_ma_quadratic_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_opencl_kernels.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_opencl_set_data.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_opmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_qpower2_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_roadrunner_eclipse.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_rrmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_rrmodel_cl.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_rrmodel_population.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_rrmodel_quadrature.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_rvdata.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_tsmodel.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_uniform_model.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_uniform_model_nb.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_z.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/tests/test_zgrid.py +0 -0
- {pytransit-2.10.0 → pytransit-2.10.1}/video1.png +0 -0
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.10.1] - 2026-10-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `GravityDarkenedModel.evaluate`, the supported replacement for the deprecated `evaluate_ps`. It also accepts a
|
|
8
|
+
scalar `k` and a list `ldc`.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Breaking**: The `GravityDarkenedModel` default resolution is now `sres=160, pres=20` (was `sres=80, pres=5`),
|
|
13
|
+
reducing the model error from about 165 ppm to 30-50 ppm at about five times the cost.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `GravityDarkenedModel` computing the planet-star overlap as if the flattened star were circular, which delayed the
|
|
18
|
+
contacts of paths crossing near the stellar poles and gave errors of up to ~300 ppm for misaligned orbits.
|
|
19
|
+
- `GravityDarkenedModel.evaluate_brute(plot=True)` drawing the star upside down relative to the planet's path.
|
|
20
|
+
|
|
3
21
|
## [2.10.0] - 2026-10-19
|
|
4
22
|
|
|
5
23
|
### Changed
|
|
@@ -38,9 +38,13 @@ docs/source/installation.rst
|
|
|
38
38
|
docs/source/io.rst
|
|
39
39
|
docs/source/stars.rst
|
|
40
40
|
docs/source/_figures/__init__.py
|
|
41
|
+
docs/source/_figures/chromosphere.py
|
|
41
42
|
docs/source/_figures/dataset_arrays.py
|
|
43
|
+
docs/source/_figures/gdmodel.py
|
|
42
44
|
docs/source/_figures/highlights.py
|
|
45
|
+
docs/source/_figures/opmodel.py
|
|
43
46
|
docs/source/_figures/roadrunner.py
|
|
47
|
+
docs/source/_figures/rr_benchmark.py
|
|
44
48
|
docs/source/_figures/tsmodel.py
|
|
45
49
|
docs/source/_static/.gitkeep
|
|
46
50
|
docs/source/api/deprecated.rst
|
|
@@ -261,8 +265,10 @@ pytransit/utils/io/rvdata.py
|
|
|
261
265
|
tests/__init__.py
|
|
262
266
|
tests/conftest.py
|
|
263
267
|
tests/reference_flux.npz
|
|
268
|
+
tests/test_chromosphere_model.py
|
|
264
269
|
tests/test_contamination.py
|
|
265
270
|
tests/test_ecintersection.py
|
|
271
|
+
tests/test_gdmodel.py
|
|
266
272
|
tests/test_lcdata.py
|
|
267
273
|
tests/test_limb_darkening.py
|
|
268
274
|
tests/test_lpf_plotting.py
|
|
@@ -17,9 +17,13 @@
|
|
|
17
17
|
"docs/Makefile",
|
|
18
18
|
"docs/requirements.txt",
|
|
19
19
|
"docs/source/_figures/__init__.py",
|
|
20
|
+
"docs/source/_figures/chromosphere.py",
|
|
20
21
|
"docs/source/_figures/dataset_arrays.py",
|
|
22
|
+
"docs/source/_figures/gdmodel.py",
|
|
21
23
|
"docs/source/_figures/highlights.py",
|
|
24
|
+
"docs/source/_figures/opmodel.py",
|
|
22
25
|
"docs/source/_figures/roadrunner.py",
|
|
26
|
+
"docs/source/_figures/rr_benchmark.py",
|
|
23
27
|
"docs/source/_figures/tsmodel.py",
|
|
24
28
|
"docs/source/_static/.gitkeep",
|
|
25
29
|
"docs/source/api/deprecated.rst",
|
|
@@ -254,8 +258,10 @@
|
|
|
254
258
|
"tests/__init__.py",
|
|
255
259
|
"tests/conftest.py",
|
|
256
260
|
"tests/reference_flux.npz",
|
|
261
|
+
"tests/test_chromosphere_model.py",
|
|
257
262
|
"tests/test_contamination.py",
|
|
258
263
|
"tests/test_ecintersection.py",
|
|
264
|
+
"tests/test_gdmodel.py",
|
|
259
265
|
"tests/test_lcdata.py",
|
|
260
266
|
"tests/test_limb_darkening.py",
|
|
261
267
|
"tests/test_lpf_plotting.py",
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# PyTransit: fast and easy exoplanet transit modelling in Python.
|
|
2
|
+
# Copyright (C) 2010-2026 Hannu Parviainen
|
|
3
|
+
#
|
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
|
|
17
|
+
"""Plotting helpers for the chromosphere feature page.
|
|
18
|
+
|
|
19
|
+
The page is about a limb-brightened stellar disk, so the figures show its intensity profile beside
|
|
20
|
+
the transit it produces, and how far the best limb darkening laws fall from reproducing it.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from matplotlib.pyplot import subplots, setp
|
|
24
|
+
from numpy import arccos, linspace, sqrt
|
|
25
|
+
from scipy.optimize import least_squares
|
|
26
|
+
|
|
27
|
+
from pytransit import RoadRunnerModel
|
|
28
|
+
|
|
29
|
+
__all__ = ['plot_profiles_and_transits', 'plot_limb_darkening_fits']
|
|
30
|
+
|
|
31
|
+
P, A = 4.0, 13.0
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _despine(ax):
|
|
35
|
+
ax.spines['top'].set_visible(False)
|
|
36
|
+
ax.spines['right'].set_visible(False)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def plot_profiles_and_transits(time, fluxes, ldc):
|
|
40
|
+
"""Draw the shell, uniform, and quadratic intensity profiles beside the transits they produce.
|
|
41
|
+
|
|
42
|
+
The profiles are normalised to the same disk-integrated flux, so that they compare the
|
|
43
|
+
distribution of the light rather than its total.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
time : ndarray
|
|
48
|
+
The mid-exposure times the fluxes were computed for.
|
|
49
|
+
fluxes : dict
|
|
50
|
+
The fluxes for the keys 'shell', 'uniform', and 'quadratic'.
|
|
51
|
+
ldc : list
|
|
52
|
+
The quadratic limb darkening coefficients the quadratic flux was computed with.
|
|
53
|
+
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
matplotlib.figure.Figure
|
|
57
|
+
"""
|
|
58
|
+
r = linspace(0.0, 0.995, 500)
|
|
59
|
+
mu = sqrt(1.0 - r ** 2)
|
|
60
|
+
u1, u2 = ldc
|
|
61
|
+
profiles = {'shell': 0.5 / mu,
|
|
62
|
+
'uniform': 1.0 + 0.0 * mu,
|
|
63
|
+
'quadratic': ((1.0 - u1 * (1.0 - mu) - u2 * (1.0 - mu) ** 2)
|
|
64
|
+
/ (1.0 - u1 / 3.0 - u2 / 6.0))}
|
|
65
|
+
labels = {'shell': 'Optically thin shell', 'uniform': 'Uniform disk',
|
|
66
|
+
'quadratic': 'Limb-darkened photosphere'}
|
|
67
|
+
styles = {'shell': dict(c='k'), 'uniform': dict(c='0.6', ls=':'),
|
|
68
|
+
'quadratic': dict(c='C0', ls='--')}
|
|
69
|
+
|
|
70
|
+
fig, (al, ar) = subplots(1, 2, figsize=(9, 3.6))
|
|
71
|
+
for key in ('shell', 'uniform', 'quadratic'):
|
|
72
|
+
al.plot(r, profiles[key], label=labels[key], **styles[key])
|
|
73
|
+
ar.plot(24 * time, fluxes[key], label=labels[key], **styles[key])
|
|
74
|
+
setp(al, xlabel='Distance from disk centre $z$ [$R_\\star$]', ylabel='Relative intensity',
|
|
75
|
+
ylim=(0, 3),
|
|
76
|
+
title='Intensity profile')
|
|
77
|
+
setp(ar, xlabel='Time - $t_c$ [h]', ylabel='Normalised flux', title='Resulting transit')
|
|
78
|
+
ar.autoscale(axis='x', tight=True)
|
|
79
|
+
al.legend(fontsize='small', frameon=False, loc='upper left')
|
|
80
|
+
_despine(al)
|
|
81
|
+
_despine(ar)
|
|
82
|
+
fig.tight_layout()
|
|
83
|
+
return fig
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _best_fit(time, flux, law, ldc0):
|
|
87
|
+
"""The best fit of a limb-darkened transit to `flux`, with every parameter free.
|
|
88
|
+
|
|
89
|
+
The limb darkening coefficients have wide bounds, so a law is free to brighten towards the limb
|
|
90
|
+
as far as its functional form allows.
|
|
91
|
+
"""
|
|
92
|
+
tm = RoadRunnerModel(law)
|
|
93
|
+
tm.set_data(time)
|
|
94
|
+
n = len(ldc0)
|
|
95
|
+
|
|
96
|
+
def residuals(x):
|
|
97
|
+
k, a, b, t0 = x[:4]
|
|
98
|
+
return tm.evaluate(k, x[4:], t0, P, a, arccos(b / a)) - flux
|
|
99
|
+
|
|
100
|
+
bounds = ([0.03, 3.0, 0.0, -0.01] + [-50.0] * n, [0.3, 40.0, 0.95, 0.01] + [50.0] * n)
|
|
101
|
+
best = None
|
|
102
|
+
for bs in (0.05, 0.3, 0.5):
|
|
103
|
+
fit = least_squares(residuals, [0.1, A, bs, 0.0] + list(ldc0), bounds=bounds, x_scale='jac',
|
|
104
|
+
xtol=1e-14, ftol=1e-14)
|
|
105
|
+
if best is None or fit.cost < best.cost:
|
|
106
|
+
best = fit
|
|
107
|
+
return best.fun
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def plot_limb_darkening_fits(time, flux):
|
|
111
|
+
"""Draw the residuals left when limb darkening laws are fitted to a limb-brightened transit.
|
|
112
|
+
|
|
113
|
+
Returns
|
|
114
|
+
-------
|
|
115
|
+
matplotlib.figure.Figure
|
|
116
|
+
"""
|
|
117
|
+
laws = {'quadratic': [-0.3, 0.0], 'power-2': [-0.5, 1.0], 'nonlinear': [0.0, 0.0, 0.0, -0.5]}
|
|
118
|
+
fig, ax = subplots(figsize=(9, 3.4))
|
|
119
|
+
for law, ldc0 in laws.items():
|
|
120
|
+
residual = -_best_fit(time, flux, law, ldc0) # data minus model
|
|
121
|
+
ax.plot(24 * time, 1e6 * residual, label=f"'{law}'")
|
|
122
|
+
ax.axhline(0.0, c='0.8', lw=0.5, zorder=-1)
|
|
123
|
+
setp(ax, xlabel='Time - $t_c$ [h]', ylabel='Shell - best fit [ppm]',
|
|
124
|
+
title='Residuals of the best-fitting limb-darkened transits')
|
|
125
|
+
ax.autoscale(axis='x', tight=True)
|
|
126
|
+
ax.legend(fontsize='small', frameon=False, loc='lower center', ncols=3)
|
|
127
|
+
_despine(ax)
|
|
128
|
+
fig.tight_layout()
|
|
129
|
+
return fig
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# PyTransit: fast and easy exoplanet transit modelling in Python.
|
|
2
|
+
# Copyright (C) 2010-2026 Hannu Parviainen
|
|
3
|
+
#
|
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
|
|
17
|
+
"""Plotting helpers for the gravity-darkened star feature page.
|
|
18
|
+
|
|
19
|
+
The page is about what a gravity-darkened star does to a transit that an ordinary limb-darkened
|
|
20
|
+
star cannot. The figure therefore shows the stellar disk with the planet's path beside the
|
|
21
|
+
residuals left after fitting a standard transit model.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from math import cos, sin
|
|
25
|
+
|
|
26
|
+
from matplotlib.pyplot import subplots, setp
|
|
27
|
+
from numpy import arccos, atleast_2d, degrees, nanmax
|
|
28
|
+
from scipy.optimize import least_squares
|
|
29
|
+
|
|
30
|
+
from meepmeep.backends.numba.point2d import solve2d
|
|
31
|
+
|
|
32
|
+
from pytransit import RoadRunnerModel
|
|
33
|
+
from pytransit.models.numba.gdmodel import create_star_luminosity, create_star_xy, map_osm, xy_taylor_vt
|
|
34
|
+
|
|
35
|
+
__all__ = ['plot_gravity_darkening_signal']
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _despine(ax):
|
|
39
|
+
ax.spines['top'].set_visible(False)
|
|
40
|
+
ax.spines['right'].set_visible(False)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _standard_fit(time, flux, p, a0):
|
|
44
|
+
"""The light curve of the best-fitting spherical, limb-darkened star.
|
|
45
|
+
|
|
46
|
+
The radius ratio, scaled semi-major axis, impact parameter, transit centre, and quadratic limb
|
|
47
|
+
darkening coefficients are all free, so whatever remains is what gravity darkening adds.
|
|
48
|
+
"""
|
|
49
|
+
tm = RoadRunnerModel('quadratic')
|
|
50
|
+
tm.set_data(time)
|
|
51
|
+
|
|
52
|
+
def residuals(x):
|
|
53
|
+
k, a, b, t0, u1, u2 = x
|
|
54
|
+
return tm.evaluate(k, [u1, u2], t0, p, a, arccos(b / a)) - flux
|
|
55
|
+
|
|
56
|
+
bounds = ([0.03, 2.0, 0.0, -0.01, -1.0, -1.0], [0.3, 20.0, 0.95, 0.01, 2.0, 2.0])
|
|
57
|
+
best = None
|
|
58
|
+
for bs in (0.05, 0.3, 0.5, 0.7):
|
|
59
|
+
fit = least_squares(residuals, [0.1, a0, bs, 0.0, 0.3, 0.2], bounds=bounds, x_scale='jac',
|
|
60
|
+
xtol=1e-14, ftol=1e-14)
|
|
61
|
+
if best is None or fit.cost < best.cost:
|
|
62
|
+
best = fit
|
|
63
|
+
return flux + best.fun # `fun` is the model minus the data
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _draw_star(ax, tm, time, rho, rperiod, tpole, phi, beta, ldc, t0, p, a, i, l, res=300):
|
|
67
|
+
"""Draw the gravity-darkened stellar disk and the planet's path, as `evaluate` sees them."""
|
|
68
|
+
mstar, ostar, gpole, f, feff = map_osm(tm.rstar, rho, rperiod, phi)
|
|
69
|
+
st, sx, sy = create_star_xy(res)
|
|
70
|
+
image = create_star_luminosity(res, sx, sy, mstar, tm.rstar, ostar, tpole, gpole, f, sin(phi),
|
|
71
|
+
cos(phi), beta, atleast_2d(ldc), tm._flux_table, tm._teff0,
|
|
72
|
+
tm._dteff, tm.accurate_mu)[0]
|
|
73
|
+
ax.imshow(image / nanmax(image), extent=(-1, 1, -1, 1), origin='lower', cmap='inferno',
|
|
74
|
+
vmin=0.4, vmax=1.0)
|
|
75
|
+
px, py = xy_taylor_vt(time - t0, l, solve2d(0.0, p, a, i, 0.0, 0.0))
|
|
76
|
+
ax.plot(px, py, c='w', lw=1, ls='--')
|
|
77
|
+
# An arrowhead where the path leaves the star shows the direction of motion.
|
|
78
|
+
j = max(n for n in range(px.size) if px[n] ** 2 + py[n] ** 2 < 1.0)
|
|
79
|
+
ax.annotate('', xy=(px[j], py[j]), xytext=(px[j - 15], py[j - 15]),
|
|
80
|
+
arrowprops=dict(arrowstyle='-|>', color='w', lw=1))
|
|
81
|
+
setp(ax, xlim=(-1.15, 1.15), ylim=(-1.15, 1.15))
|
|
82
|
+
ax.set_aspect('equal')
|
|
83
|
+
ax.axis('off')
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def plot_gravity_darkening_signal(time, fluxes, models, rho, rperiod, tpole, phi, beta, ldc,
|
|
87
|
+
t0, p, a, i):
|
|
88
|
+
"""Draw the stellar disk and the residuals of a standard transit model fit for several orbits.
|
|
89
|
+
|
|
90
|
+
Parameters
|
|
91
|
+
----------
|
|
92
|
+
time : ndarray
|
|
93
|
+
The mid-exposure times the fluxes were computed for.
|
|
94
|
+
fluxes : dict
|
|
95
|
+
Mapping from ``(band, l)`` to the modelled flux, where `band` names a passband and `l` is
|
|
96
|
+
the projected spin-orbit angle in radians.
|
|
97
|
+
models : dict
|
|
98
|
+
Mapping from the passband names to the `GravityDarkenedModel` instances used. The stellar
|
|
99
|
+
disk is drawn in the first passband.
|
|
100
|
+
rho, rperiod, tpole, phi, beta, ldc, t0, p, a, i
|
|
101
|
+
The parameters the fluxes were computed with.
|
|
102
|
+
|
|
103
|
+
Returns
|
|
104
|
+
-------
|
|
105
|
+
matplotlib.figure.Figure
|
|
106
|
+
"""
|
|
107
|
+
bands = list(models)
|
|
108
|
+
ls = sorted({l for _, l in fluxes})
|
|
109
|
+
colours = {'blue': 'C0', 'red': 'C3'}
|
|
110
|
+
|
|
111
|
+
fig, axs = subplots(2, len(ls), figsize=(9, 5.4), height_ratios=(2, 3), sharey='row')
|
|
112
|
+
for l, at, ab in zip(ls, axs[0], axs[1]):
|
|
113
|
+
_draw_star(at, models[bands[0]], time, rho, rperiod, tpole, phi, beta, ldc, t0, p, a, i, l)
|
|
114
|
+
at.set_title(f'$\\lambda$ = {degrees(l):.0f}°')
|
|
115
|
+
for band in bands:
|
|
116
|
+
flux = fluxes[band, l]
|
|
117
|
+
residual = flux - _standard_fit(time, flux, p, a)
|
|
118
|
+
ab.plot(24 * time, 1e6 * residual, c=colours.get(band), label=band)
|
|
119
|
+
ab.axhline(0.0, c='0.8', lw=0.5, zorder=-1)
|
|
120
|
+
ab.autoscale(axis='x', tight=True)
|
|
121
|
+
setp(ab, xlabel='Time - $t_c$ [h]')
|
|
122
|
+
_despine(ab)
|
|
123
|
+
setp(axs[1, 0], ylabel='Residual of a standard fit [ppm]')
|
|
124
|
+
axs[1, 0].legend(fontsize='small', frameon=False, loc='lower left')
|
|
125
|
+
fig.tight_layout()
|
|
126
|
+
return fig
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# PyTransit: fast and easy exoplanet transit modelling in Python.
|
|
2
|
+
# Copyright (C) 2010-2026 Hannu Parviainen
|
|
3
|
+
#
|
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
|
|
17
|
+
"""Plotting helpers for the oblate planet feature page.
|
|
18
|
+
|
|
19
|
+
The page is about how small the oblateness signal is, how much of it a spherical planet can absorb,
|
|
20
|
+
and how accurate the model must be to see the rest. The figures therefore compare an oblate planet
|
|
21
|
+
with the best-fitting spherical one, and the model accuracy settings with a direct numerical
|
|
22
|
+
integration of the stellar disk.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
import warnings
|
|
26
|
+
from math import cos, sin, sqrt
|
|
27
|
+
|
|
28
|
+
from matplotlib.patches import Circle, Ellipse
|
|
29
|
+
from matplotlib.pyplot import subplots, setp
|
|
30
|
+
from numpy import abs as npabs, arccos, arcsin, array, degrees, linspace, pi
|
|
31
|
+
from scipy.integrate import IntegrationWarning, quad
|
|
32
|
+
from scipy.optimize import least_squares
|
|
33
|
+
|
|
34
|
+
from meepmeep.backends.numba.point2d import pos_c, solve2d
|
|
35
|
+
|
|
36
|
+
from pytransit import OPModel, RoadRunnerModel
|
|
37
|
+
|
|
38
|
+
__all__ = ['plot_oblateness_signal', 'plot_accuracy_levels']
|
|
39
|
+
|
|
40
|
+
# The example transit used throughout the page: a Saturn-like planet on a ten-day orbit.
|
|
41
|
+
P, A = 10.0, 15.0
|
|
42
|
+
LDC = (0.4, 0.25)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _despine(ax):
|
|
46
|
+
ax.spines['top'].set_visible(False)
|
|
47
|
+
ax.spines['right'].set_visible(False)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _sphere_fit(time, flux, k0, ldc):
|
|
51
|
+
"""The spherical planet that best reproduces a light curve, with the limb darkening fixed.
|
|
52
|
+
|
|
53
|
+
The radius ratio, scaled semi-major axis, impact parameter, and transit centre are free. The
|
|
54
|
+
fit starts from several impact parameters, since an elongated planet can mimic a spherical one
|
|
55
|
+
on a quite different chord.
|
|
56
|
+
"""
|
|
57
|
+
tm = RoadRunnerModel('quadratic')
|
|
58
|
+
tm.set_data(time)
|
|
59
|
+
|
|
60
|
+
def residuals(x):
|
|
61
|
+
k, a, b, t0 = x
|
|
62
|
+
return tm.evaluate(k, ldc, t0, P, a, arccos(b / a)) - flux
|
|
63
|
+
|
|
64
|
+
bounds = ([0.5 * k0, 5.0, 0.0, -0.01], [2 * k0, 40.0, 0.95, 0.01])
|
|
65
|
+
best = None
|
|
66
|
+
for bs in (0.05, 0.3, 0.5, 0.7, 0.85):
|
|
67
|
+
fit = least_squares(residuals, [k0, A, bs, 0.0], bounds=bounds, x_scale='jac',
|
|
68
|
+
xtol=1e-15, ftol=1e-15, gtol=1e-15)
|
|
69
|
+
if best is None or fit.cost < best.cost:
|
|
70
|
+
best = fit
|
|
71
|
+
return tm.evaluate(best.x[0], ldc, best.x[3], P, best.x[1], arccos(best.x[2] / best.x[1]))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _draw_geometry(ax, b, alpha, k=0.3, f=0.3):
|
|
75
|
+
"""Sketch the planet crossing the stellar limb, with its shape exaggerated so that it is visible."""
|
|
76
|
+
ax.add_patch(Circle((0, 0), 1.0, fc='0.94', ec='0.5', lw=0.8))
|
|
77
|
+
xyc = solve2d(0.0, P, A, arccos(b / A), 0.0, 0.0)
|
|
78
|
+
xs = array([pos_c(t, xyc) for t in linspace(-0.4, 0.4, 200)])
|
|
79
|
+
ax.plot(xs[:, 0], xs[:, 1], c='0.6', lw=0.8, ls='--')
|
|
80
|
+
yc = pos_c(0.0, xyc)[1]
|
|
81
|
+
for x in (-sqrt(1 - yc ** 2), 0.0, sqrt(1 - yc ** 2)):
|
|
82
|
+
ax.add_patch(Ellipse((x, yc), 2 * k, 2 * k * (1 - f), angle=degrees(alpha), fc='k', ec='none'))
|
|
83
|
+
ax.set_xlim(-1.4, 1.4)
|
|
84
|
+
ax.set_ylim(-1.15, 1.15)
|
|
85
|
+
ax.set_aspect('equal')
|
|
86
|
+
ax.axis('off')
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def plot_oblateness_signal(time, fluxes, k, f, b, ldc=LDC):
|
|
90
|
+
"""Draw the oblate planet's light curve against an equal-area and a best-fitting spherical planet.
|
|
91
|
+
|
|
92
|
+
Parameters
|
|
93
|
+
----------
|
|
94
|
+
time : ndarray
|
|
95
|
+
The mid-exposure times the fluxes were computed for.
|
|
96
|
+
fluxes : dict
|
|
97
|
+
Mapping from the projected obliquity in radians to the oblate planet's flux.
|
|
98
|
+
k, f, b : float
|
|
99
|
+
The radius ratio, flattening, and impact parameter the fluxes were computed with.
|
|
100
|
+
ldc : tuple, optional
|
|
101
|
+
The quadratic limb darkening coefficients the fluxes were computed with.
|
|
102
|
+
|
|
103
|
+
Returns
|
|
104
|
+
-------
|
|
105
|
+
matplotlib.figure.Figure
|
|
106
|
+
"""
|
|
107
|
+
ldc = list(ldc)
|
|
108
|
+
rr = RoadRunnerModel('quadratic')
|
|
109
|
+
rr.set_data(time)
|
|
110
|
+
keq = k * sqrt(1.0 - f)
|
|
111
|
+
equal_area = rr.evaluate(keq, ldc, 0.0, P, A, arccos(b / A))
|
|
112
|
+
|
|
113
|
+
n = len(fluxes)
|
|
114
|
+
fig, axs = subplots(2, n, figsize=(9, 5), height_ratios=(2, 3), sharey='row')
|
|
115
|
+
for (alpha, flux), at, ab in zip(fluxes.items(), axs[0], axs[1]):
|
|
116
|
+
_draw_geometry(at, b, alpha)
|
|
117
|
+
at.set_title(f'$\\alpha$ = {degrees(alpha):.0f}°')
|
|
118
|
+
fitted = _sphere_fit(time, flux, keq, ldc)
|
|
119
|
+
ab.plot(24 * time, 1e6 * (flux - equal_area), c='0.6', ls='--', label='Equal-area sphere')
|
|
120
|
+
ab.plot(24 * time, 1e6 * (flux - fitted), c='k', label='Best-fitting sphere')
|
|
121
|
+
ab.axhline(0.0, c='0.8', lw=0.5, zorder=-1)
|
|
122
|
+
ab.autoscale(axis='x', tight=True)
|
|
123
|
+
setp(ab, xlabel='Time - $t_c$ [h]')
|
|
124
|
+
_despine(ab)
|
|
125
|
+
setp(axs[1, 0], ylabel='Oblate - spherical [ppm]')
|
|
126
|
+
axs[1, 0].legend(fontsize='small', frameon=False, loc='lower left')
|
|
127
|
+
fig.tight_layout()
|
|
128
|
+
return fig
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _intensity(x, y, u1, u2):
|
|
132
|
+
r2 = x * x + y * y
|
|
133
|
+
if r2 >= 1.0:
|
|
134
|
+
return 0.0
|
|
135
|
+
mu = sqrt(1.0 - r2)
|
|
136
|
+
return 1.0 - u1 * (1.0 - mu) - u2 * (1.0 - mu) ** 2
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _reference_flux(cx, cy, k, f, alpha, u1, u2):
|
|
140
|
+
"""Oblate planet transit flux from nested adaptive quadrature over the exact overlap region.
|
|
141
|
+
|
|
142
|
+
The same reference the test suite validates the model against (``tests/test_opmodel.py``).
|
|
143
|
+
"""
|
|
144
|
+
bb = 1.0 - f
|
|
145
|
+
ca, sa = cos(alpha), sin(alpha)
|
|
146
|
+
hh = k * sqrt(sa * sa + bb * bb * ca * ca)
|
|
147
|
+
|
|
148
|
+
def scanline(y):
|
|
149
|
+
if abs(y) >= 1.0:
|
|
150
|
+
return 0.0
|
|
151
|
+
yp = (y - cy) / k
|
|
152
|
+
d = bb * bb * ca * ca + sa * sa - yp * yp
|
|
153
|
+
if d <= 0.0:
|
|
154
|
+
return 0.0
|
|
155
|
+
sd = sqrt(d) / bb
|
|
156
|
+
u = yp * ca * sa * (1.0 / (bb * bb) - 1.0)
|
|
157
|
+
v = sa * sa / (bb * bb) + ca * ca
|
|
158
|
+
w = sqrt(1.0 - y * y)
|
|
159
|
+
lo = max(cx + k * (u - sd) / v, -w)
|
|
160
|
+
hi = min(cx + k * (u + sd) / v, w)
|
|
161
|
+
if hi <= lo:
|
|
162
|
+
return 0.0
|
|
163
|
+
return quad(_intensity, lo, hi, args=(y, u1, u2), epsabs=1e-13, epsrel=1e-12, limit=200)[0]
|
|
164
|
+
|
|
165
|
+
ylo, yhi = max(cy - hh, -1.0), min(cy + hh, 1.0)
|
|
166
|
+
blocked = quad(scanline, ylo, yhi, epsabs=1e-12, epsrel=1e-11, limit=500)[0] if yhi > ylo else 0.0
|
|
167
|
+
return 1.0 - blocked / (pi * (1.0 - u1 / 3.0 - u2 / 6.0))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def plot_accuracy_levels(k=0.1, f=0.1, alpha=pi / 4, bs=(0.5, 1.0), ldc=LDC):
|
|
171
|
+
"""Compare the model's accuracy settings against direct numerical integration of the stellar disk.
|
|
172
|
+
|
|
173
|
+
Returns
|
|
174
|
+
-------
|
|
175
|
+
matplotlib.figure.Figure
|
|
176
|
+
"""
|
|
177
|
+
settings = {'Default': {},
|
|
178
|
+
'``exact_ld``': dict(exact_ld=True),
|
|
179
|
+
'``exact_ld`` and ``exact_areas``': dict(exact_ld=True, exact_areas=True)}
|
|
180
|
+
fig, axs = subplots(1, len(bs), figsize=(9, 3.6), sharey=True)
|
|
181
|
+
for b, ax in zip(bs, axs):
|
|
182
|
+
# From mid-transit to slightly past the last contact, which is where all the error lives.
|
|
183
|
+
half_duration = P / (2 * pi) * arcsin(sqrt((1 + k) ** 2 - b ** 2) / A)
|
|
184
|
+
time = linspace(0.0, 1.05 * half_duration, 150)
|
|
185
|
+
tm = OPModel('quadratic')
|
|
186
|
+
tm.set_data(time)
|
|
187
|
+
|
|
188
|
+
inc = arccos(b / A)
|
|
189
|
+
xyc = solve2d(0.0, P, A, inc, 0.0, 0.0)
|
|
190
|
+
with warnings.catch_warnings():
|
|
191
|
+
warnings.simplefilter('ignore', IntegrationWarning)
|
|
192
|
+
reference = array([_reference_flux(*pos_c(t, xyc), k, f, alpha, *ldc) for t in time])
|
|
193
|
+
for label, kwargs in settings.items():
|
|
194
|
+
flux = tm.evaluate(k, f, alpha, list(ldc), 0.0, P, A, inc, **kwargs)
|
|
195
|
+
ax.plot(24 * time, 1e6 * npabs(flux - reference), label=label.replace('``', ''))
|
|
196
|
+
ax.axhline(1.0, ls='--', c='0.75', zorder=-1)
|
|
197
|
+
setp(ax, xlabel='Time - $t_c$ [h]', yscale='log', ylim=(1e-3, 1e2),
|
|
198
|
+
title=f'Impact parameter {b:g}' + (' (grazing)' if b + k >= 1.0 else ''))
|
|
199
|
+
ax.autoscale(axis='x', tight=True)
|
|
200
|
+
_despine(ax)
|
|
201
|
+
setp(axs[0], ylabel='Model error [ppm]')
|
|
202
|
+
axs[0].legend(fontsize='small', frameon=False, loc='upper left')
|
|
203
|
+
fig.tight_layout()
|
|
204
|
+
return fig
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# PyTransit: fast and easy exoplanet transit modelling in Python.
|
|
2
|
+
# Copyright (C) 2010-2026 Hannu Parviainen
|
|
3
|
+
#
|
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
|
|
17
|
+
"""RoadRunner against the quadratic Mandel & Agol model: evaluation time against the exposure count.
|
|
18
|
+
|
|
19
|
+
Timings depend on the machine, and measuring them takes minutes, so the documentation does not
|
|
20
|
+
rerun the benchmark at build time. Running this file as a script measures the timings and writes
|
|
21
|
+
them to ``rr_benchmark.csv`` next to it, and the documentation plots that file:
|
|
22
|
+
|
|
23
|
+
python docs/source/_figures/rr_benchmark.py
|
|
24
|
+
|
|
25
|
+
Both models run on a single thread, for a light curve where about half of the exposures are in
|
|
26
|
+
transit.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
from pathlib import Path
|
|
30
|
+
|
|
31
|
+
from matplotlib.pyplot import subplots, setp
|
|
32
|
+
from numpy import arccos, array, linspace, loadtxt, pi
|
|
33
|
+
|
|
34
|
+
__all__ = ['SETTINGS', 'run_benchmark', 'plot_benchmark']
|
|
35
|
+
|
|
36
|
+
CSV = Path(__file__).with_name('rr_benchmark.csv')
|
|
37
|
+
|
|
38
|
+
# The RoadRunner accuracy levels, each the cheapest (nq, ng) whose worst-case error against the
|
|
39
|
+
# exact quadratic model stays below the target for radius ratios up to 0.2 and impact parameters
|
|
40
|
+
# up to 0.9, with the measured worst-case error in ppm.
|
|
41
|
+
SETTINGS = {'RoadRunner (1 ppm)': dict(nq=5, ng=300, error=0.93),
|
|
42
|
+
'RoadRunner (default)': dict(nq=8, ng=100, error=5.9),
|
|
43
|
+
'RoadRunner (10 ppm)': dict(nq=4, ng=75, error=7.2),
|
|
44
|
+
'RoadRunner (100 ppm)': dict(nq=3, ng=20, error=48.0),
|
|
45
|
+
'RoadRunner (500 ppm)': dict(nq=2, ng=10, error=316.0)}
|
|
46
|
+
|
|
47
|
+
NPTS = (10, 30, 100, 300, 1_000, 3_000, 10_000, 30_000, 100_000, 300_000, 1_000_000)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _models():
|
|
51
|
+
from pytransit import QuadraticModel, RoadRunnerModel
|
|
52
|
+
models = {'Quadratic (exact)': QuadraticModel(interpolate=False),
|
|
53
|
+
'Quadratic (interpolated)': QuadraticModel(interpolate=True)}
|
|
54
|
+
for name, s in SETTINGS.items():
|
|
55
|
+
models[name] = RoadRunnerModel('quadratic', nq=s['nq'], ng=s['ng'])
|
|
56
|
+
return models
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def run_benchmark(npts=NPTS, path=CSV):
|
|
60
|
+
"""Time every model for every number of exposures and write the results to `path`."""
|
|
61
|
+
import numba
|
|
62
|
+
from timeit import repeat
|
|
63
|
+
numba.set_num_threads(1)
|
|
64
|
+
|
|
65
|
+
p, a, k, b, ldc = 4.0, 13.0, 0.1, 0.3, [0.4, 0.25]
|
|
66
|
+
models = _models()
|
|
67
|
+
names = list(models)
|
|
68
|
+
rows = []
|
|
69
|
+
for npt in npts:
|
|
70
|
+
time = linspace(-0.1, 0.1, npt)
|
|
71
|
+
row = [npt]
|
|
72
|
+
for name in names:
|
|
73
|
+
tm = models[name]
|
|
74
|
+
tm.set_data(time)
|
|
75
|
+
f = lambda: tm.evaluate(k, ldc, 0.0, p, a, arccos(b / a))
|
|
76
|
+
f()
|
|
77
|
+
number = max(1, int(2e5 // npt))
|
|
78
|
+
row.append(min(repeat(f, number=number, repeat=7)) / number)
|
|
79
|
+
rows.append(row)
|
|
80
|
+
print(npt, ' '.join(f'{t * 1e3:9.4f}' for t in row[1:]))
|
|
81
|
+
with open(path, 'w') as out:
|
|
82
|
+
out.write('npt,' + ','.join(names) + '\n')
|
|
83
|
+
for row in rows:
|
|
84
|
+
out.write(f'{row[0]},' + ','.join(f'{t:.6e}' for t in row[1:]) + '\n')
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def plot_benchmark(path=CSV):
|
|
88
|
+
"""Plot the evaluation time per exposure against the number of exposures.
|
|
89
|
+
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
matplotlib.figure.Figure
|
|
93
|
+
"""
|
|
94
|
+
with open(path) as f:
|
|
95
|
+
names = f.readline().strip().split(',')[1:]
|
|
96
|
+
data = loadtxt(path, delimiter=',', skiprows=1)
|
|
97
|
+
npt = data[:, 0]
|
|
98
|
+
|
|
99
|
+
styles = {'Quadratic (exact)': dict(c='k', lw=2),
|
|
100
|
+
'Quadratic (interpolated)': dict(c='k', ls='--')}
|
|
101
|
+
fig, ax = subplots(figsize=(9, 4.2))
|
|
102
|
+
for i, name in enumerate(names):
|
|
103
|
+
ax.plot(npt, 1e9 * data[:, i + 1] / npt, label=name, **styles.get(name, {}))
|
|
104
|
+
setp(ax, xscale='log', yscale='log', xlabel='Number of exposures',
|
|
105
|
+
ylabel='Time per exposure [ns]', title='Single-threaded evaluation time')
|
|
106
|
+
ax.legend(fontsize='small', frameon=False, ncols=2)
|
|
107
|
+
ax.spines['top'].set_visible(False)
|
|
108
|
+
ax.spines['right'].set_visible(False)
|
|
109
|
+
fig.tight_layout()
|
|
110
|
+
return fig
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
if __name__ == '__main__':
|
|
114
|
+
run_benchmark()
|