mphot 1.0.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 (46) hide show
  1. mphot-1.0.0/.gitattributes +2 -0
  2. mphot-1.0.0/.github/workflows/publish.yml +50 -0
  3. mphot-1.0.0/.gitignore +157 -0
  4. mphot-1.0.0/LICENSE +21 -0
  5. mphot-1.0.0/PKG-INFO +65 -0
  6. mphot-1.0.0/README.md +48 -0
  7. mphot-1.0.0/docs/Makefile +20 -0
  8. mphot-1.0.0/docs/make.bat +35 -0
  9. mphot-1.0.0/docs/source/conf.py +50 -0
  10. mphot-1.0.0/docs/source/index.md +8 -0
  11. mphot-1.0.0/docs/source/modules.rst +7 -0
  12. mphot-1.0.0/docs/source/mphot.rst +10 -0
  13. mphot-1.0.0/examples/Basic use.ipynb +570 -0
  14. mphot-1.0.0/examples/Comparison use.ipynb +562 -0
  15. mphot-1.0.0/examples/Exoplanet transit.ipynb +575 -0
  16. mphot-1.0.0/examples/Precision plot.ipynb +506 -0
  17. mphot-1.0.0/examples/Sensitivity plot.ipynb +409 -0
  18. mphot-1.0.0/examples/example-plots.png +0 -0
  19. mphot-1.0.0/pyproject.toml +21 -0
  20. mphot-1.0.0/resources/filters/I+z.csv +83 -0
  21. mphot-1.0.0/resources/filters/J.csv +854 -0
  22. mphot-1.0.0/resources/filters/halpha.csv +113 -0
  23. mphot-1.0.0/resources/filters/i.csv +4667 -0
  24. mphot-1.0.0/resources/filters/r.csv +4667 -0
  25. mphot-1.0.0/resources/filters/z.csv +4667 -0
  26. mphot-1.0.0/resources/filters/zYJ.csv +1601 -0
  27. mphot-1.0.0/resources/systems/generic_IMX461.csv +26474 -0
  28. mphot-1.0.0/resources/systems/optics/Al_reflectivity.csv +72 -0
  29. mphot-1.0.0/resources/systems/optics/fused_silica_transmission.csv +47 -0
  30. mphot-1.0.0/resources/systems/qe/Andor_iKon-L-936_-60_qe.csv +83 -0
  31. mphot-1.0.0/resources/systems/qe/PIRT_1280SciCam_-60_qe.csv +2835 -0
  32. mphot-1.0.0/resources/systems/qe/Sony_IMX461_qe.csv +32 -0
  33. mphot-1.0.0/resources/systems/speculoos_Andor_iKon-L-936_-60.csv +27000 -0
  34. mphot-1.0.0/resources/systems/speculoos_PIRT_1280SciCam_-60.csv +25995 -0
  35. mphot-1.0.0/resources/systems/system_calc.ipynb +89 -0
  36. mphot-1.0.0/src/mphot/__init__.py +7 -0
  37. mphot-1.0.0/src/mphot/core.py +1350 -0
  38. mphot-1.0.0/src/mphot/datafiles/16_order_poly.npy +0 -0
  39. mphot-1.0.0/src/mphot/datafiles/pre_grid_2400m_flux.pkl +0 -0
  40. mphot-1.0.0/src/mphot/datafiles/pre_grid_2400m_radiance.pkl +0 -0
  41. mphot-1.0.0/src/mphot/datafiles/system_responses/.gitignore +0 -0
  42. mphot-1.0.0/src/mphot/datafiles/system_responses/speculoos_Andor_iKon-L-936_-60_I+z_instrument_system_response.csv +4100 -0
  43. mphot-1.0.0/src/mphot/datafiles/system_responses/speculoos_PIRT_1280SciCam_-60_zYJ_instrument_system_response.csv +11520 -0
  44. mphot-1.0.0/src/mphot/datafiles/vega.csv +15000 -0
  45. mphot-1.0.0/src/mphot/grids/.gitignore +1 -0
  46. mphot-1.0.0/tests/test_mphot.py +136 -0
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,50 @@
1
+ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ build:
7
+ name: Build distribution 📦
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: Set up Python
13
+ uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.x"
16
+ - name: Install pypa/build
17
+ run: >-
18
+ python3 -m
19
+ pip install
20
+ build
21
+ --user
22
+ - name: Build a binary wheel and a source tarball
23
+ run: python3 -m build
24
+ - name: Store the distribution packages
25
+ uses: actions/upload-artifact@v4
26
+ with:
27
+ name: python-package-distributions
28
+ path: dist/
29
+
30
+ publish-to-pypi:
31
+ name: >-
32
+ Publish Python 🐍 distribution 📦 to PyPI
33
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34
+ needs:
35
+ - build
36
+ runs-on: ubuntu-latest
37
+ environment:
38
+ name: pypi
39
+ url: https://pypi.org/p/mphot # Replace <package-name> with your PyPI project name
40
+ permissions:
41
+ id-token: write # IMPORTANT: mandatory for trusted publishing
42
+
43
+ steps:
44
+ - name: Download all the dists
45
+ uses: actions/download-artifact@v4
46
+ with:
47
+ name: python-package-distributions
48
+ path: dist/
49
+ - name: Publish distribution 📦 to PyPI
50
+ uses: pypa/gh-action-pypi-publish@release/v1
mphot-1.0.0/.gitignore ADDED
@@ -0,0 +1,157 @@
1
+ .DS_Store
2
+ temp/
3
+ .vscode/
4
+ *.psd
5
+
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py,cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # poetry
103
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
107
+ #poetry.lock
108
+
109
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
110
+ __pypackages__/
111
+
112
+ # Celery stuff
113
+ celerybeat-schedule
114
+ celerybeat.pid
115
+
116
+ # SageMath parsed files
117
+ *.sage.py
118
+
119
+ # Environments
120
+ .env
121
+ .venv
122
+ env/
123
+ venv/
124
+ ENV/
125
+ env.bak/
126
+ venv.bak/
127
+
128
+ # Spyder project settings
129
+ .spyderproject
130
+ .spyproject
131
+
132
+ # Rope project settings
133
+ .ropeproject
134
+
135
+ # mkdocs documentation
136
+ /site
137
+
138
+ # mypy
139
+ .mypy_cache/
140
+ .dmypy.json
141
+ dmypy.json
142
+
143
+ # Pyre type checker
144
+ .pyre/
145
+
146
+ # pytype static type analyzer
147
+ .pytype/
148
+
149
+ # Cython debug symbols
150
+ cython_debug/
151
+
152
+ # PyCharm
153
+ # JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
154
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
155
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
156
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
157
+ #.idea/
mphot-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Peter Pihlmann Pedersen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
mphot-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.3
2
+ Name: mphot
3
+ Version: 1.0.0
4
+ Author: Peter Pedersen
5
+ License: MIT License
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: ipython
9
+ Requires-Dist: matplotlib
10
+ Requires-Dist: numpy
11
+ Requires-Dist: pandas
12
+ Requires-Dist: scipy
13
+ Provides-Extra: dev
14
+ Requires-Dist: black; extra == 'dev'
15
+ Requires-Dist: pytest; extra == 'dev'
16
+ Description-Content-Type: text/markdown
17
+
18
+ # mphot
19
+ *mphot* is a Python package to model photometry data from the ground or space.
20
+
21
+ ![example plots](examples/example-plots.png)
22
+
23
+
24
+ ## How it works
25
+
26
+ Simply put,
27
+ - it combines user submitted [telescope * filter * camera qe] efficiencies with generic stellar models and sky transmission/radiance models (for Paranal, 2400m) to generate integrable grids of stellar fluxes and sky radiances.
28
+
29
+ - Then, *mphot* uses the grids to interpolate between different
30
+ - atmospheric parameters (PWV, airmass)
31
+ - target star parameters (effective temperature + distance)
32
+
33
+ - using user submitted
34
+ - telescope/site parameters (primary and secondary diameters, site seeing)
35
+ - camera parameters (plate scale, dark current, read noise, well depth, target well fill, read time)
36
+
37
+ - to calculate ideal exposure time and expected precision for a given observation.
38
+
39
+ Please see the [examples](https://github.com/ppp-one/mphot/tree/main/examples) for more details on how to use *mphot*. For further details on the models used, please see [https://doi.org/10.1117/12.3018320](https://doi.org/10.1117/12.3018320).
40
+
41
+ Note, it uses stellar parameters from "[A Modern Mean Dwarf Stellar Color and Effective Temperature Sequence](https://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt)". Temperatures between 1278 K to 3042 K are calibrated for the [SPECULOOS target list](https://doi.org/10.1051/0004-6361/202038827) and [2MASS](https://irsa.ipac.caltech.edu/Missions/2mass.html) (see Figure 4.7 in "[Optimised ground-based near-infrared instrumentation for robotic exoplanet transit surveys](https://doi.org/10.17863/CAM.96904)").
42
+
43
+ <!-- For further details, please see the [documentation](https://ppp-one.github.io/mphot/). -->
44
+
45
+
46
+ ## Installation
47
+
48
+ You can install *mphot* in a Python (`>=3.11`) environment with
49
+
50
+ ```bash
51
+ pip install mphot
52
+ ```
53
+
54
+ or from a local clone
55
+
56
+ ```bash
57
+ git clone https://github.com/ppp-one/mphot
58
+ pip install -e mphot
59
+ ```
60
+
61
+ You can test the package has been properly installed with
62
+
63
+ ```bash
64
+ python -c "import mphot"
65
+ ```
mphot-1.0.0/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # mphot
2
+ *mphot* is a Python package to model photometry data from the ground or space.
3
+
4
+ ![example plots](examples/example-plots.png)
5
+
6
+
7
+ ## How it works
8
+
9
+ Simply put,
10
+ - it combines user submitted [telescope * filter * camera qe] efficiencies with generic stellar models and sky transmission/radiance models (for Paranal, 2400m) to generate integrable grids of stellar fluxes and sky radiances.
11
+
12
+ - Then, *mphot* uses the grids to interpolate between different
13
+ - atmospheric parameters (PWV, airmass)
14
+ - target star parameters (effective temperature + distance)
15
+
16
+ - using user submitted
17
+ - telescope/site parameters (primary and secondary diameters, site seeing)
18
+ - camera parameters (plate scale, dark current, read noise, well depth, target well fill, read time)
19
+
20
+ - to calculate ideal exposure time and expected precision for a given observation.
21
+
22
+ Please see the [examples](https://github.com/ppp-one/mphot/tree/main/examples) for more details on how to use *mphot*. For further details on the models used, please see [https://doi.org/10.1117/12.3018320](https://doi.org/10.1117/12.3018320).
23
+
24
+ Note, it uses stellar parameters from "[A Modern Mean Dwarf Stellar Color and Effective Temperature Sequence](https://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt)". Temperatures between 1278 K to 3042 K are calibrated for the [SPECULOOS target list](https://doi.org/10.1051/0004-6361/202038827) and [2MASS](https://irsa.ipac.caltech.edu/Missions/2mass.html) (see Figure 4.7 in "[Optimised ground-based near-infrared instrumentation for robotic exoplanet transit surveys](https://doi.org/10.17863/CAM.96904)").
25
+
26
+ <!-- For further details, please see the [documentation](https://ppp-one.github.io/mphot/). -->
27
+
28
+
29
+ ## Installation
30
+
31
+ You can install *mphot* in a Python (`>=3.11`) environment with
32
+
33
+ ```bash
34
+ pip install mphot
35
+ ```
36
+
37
+ or from a local clone
38
+
39
+ ```bash
40
+ git clone https://github.com/ppp-one/mphot
41
+ pip install -e mphot
42
+ ```
43
+
44
+ You can test the package has been properly installed with
45
+
46
+ ```bash
47
+ python -c "import mphot"
48
+ ```
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,50 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ import os
10
+ import sys
11
+
12
+ # add path to source code
13
+ sys.path.insert(0, os.path.abspath("../src/"))
14
+
15
+ project = "mphot"
16
+ copyright = "2024, Peter Pihlmann Pedersen"
17
+ author = "Peter Pihlmann Pedersen"
18
+ release = "0.0.1"
19
+
20
+ # -- General configuration ---------------------------------------------------
21
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
22
+
23
+ extensions = [
24
+ "sphinx.ext.autodoc",
25
+ "sphinx.ext.viewcode",
26
+ "sphinx.ext.napoleon",
27
+ "sphinx_copybutton",
28
+ "myst_parser",
29
+ ]
30
+
31
+ source_suffix = {
32
+ ".rst": "restructuredtext",
33
+ ".txt": "markdown",
34
+ ".md": "markdown",
35
+ }
36
+
37
+ templates_path = ["_templates"]
38
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
39
+
40
+
41
+ # -- Options for HTML output -------------------------------------------------
42
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
43
+
44
+ html_theme = "sphinx_book_theme"
45
+ html_title = "mphot"
46
+ html_static_path = ["_static"]
47
+ html_context = {
48
+ # ...
49
+ "default_mode": "light"
50
+ }
@@ -0,0 +1,8 @@
1
+ ```{include} ../../README.md
2
+ :relative-docs: ../../
3
+ :relative-images:
4
+ ```
5
+
6
+ ## Contents
7
+ ```{toctree} mphot
8
+ ```
@@ -0,0 +1,7 @@
1
+ mphot
2
+ =====
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ mphot
@@ -0,0 +1,10 @@
1
+ mphot package
2
+ =============
3
+
4
+ mphot.core module
5
+ -----------------
6
+
7
+ .. automodule:: mphot.core
8
+ :members:
9
+ :undoc-members:
10
+ :show-inheritance: