jaxedith 0.0.2__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.
@@ -0,0 +1,166 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+ *_version.py
162
+ .DS_Store
163
+ input/
164
+ output/
165
+ scripts/
166
+ *.png
@@ -0,0 +1,20 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: "v6.0.0"
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: name-tests-test
7
+ args: [--pytest-test-first]
8
+ - id: end-of-file-fixer
9
+ - repo: https://github.com/astral-sh/ruff-pre-commit
10
+ rev: v0.15.8
11
+ hooks:
12
+ - id: ruff-check
13
+ args: [--fix]
14
+ - id: ruff-format
15
+ - repo: https://github.com/compilerla/conventional-pre-commit
16
+ rev: v4.4.0
17
+ hooks:
18
+ - id: conventional-pre-commit
19
+ stages: [commit-msg]
20
+ args: []
@@ -0,0 +1,20 @@
1
+ # Required
2
+ version: 2
3
+
4
+ # Set the OS, Python version and other tools you might need
5
+ build:
6
+ os: ubuntu-22.04
7
+ tools:
8
+ python: "3.12"
9
+
10
+ python:
11
+ install:
12
+ - method: pip
13
+ path: .
14
+ extra_requirements:
15
+ # Install with the [docs] flag for sphinx docs specific extensions
16
+ - docs
17
+
18
+ # Build documentation in the "docs/" directory with Sphinx
19
+ sphinx:
20
+ configuration: docs/conf.py
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## [0.0.2](https://github.com/CoreySpohn/jaxedith/compare/v0.0.1...v0.0.2) (2026-04-13)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * release 0.0.2 ([0403b67](https://github.com/CoreySpohn/jaxedith/commit/0403b67df165274c5a31468e4c8a113c49650adf))
9
+
10
+ ## 0.0.1 (2026-04-13)
11
+
12
+
13
+ ### Features
14
+
15
+ * Add all things from the pyEDITH branch ([b0a0f5d](https://github.com/CoreySpohn/jaxEDITH/commit/b0a0f5d49ae77608d1d75abb16723a519e3b1ed7))
16
+
17
+
18
+ ### Miscellaneous Chores
19
+
20
+ * release 0.0.1 ([164ba31](https://github.com/CoreySpohn/jaxEDITH/commit/164ba3136a758595a70fc4cf50fb93a9d801a3bb))
jaxedith-0.0.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Corey Spohn
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.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: jaxedith
3
+ Version: 0.0.2
4
+ Summary: JAX based HWO exposure time calculator
5
+ Project-URL: Homepage, https://github.com/CoreySpohn/jaxedith
6
+ Project-URL: Issues, https://github.com/CoreySpohn/jaxedith/issues
7
+ Author-email: Corey Spohn <corey.a.spohn@nasa.gov>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Corey Spohn
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Classifier: Development Status :: 3 - Alpha
31
+ Classifier: Intended Audience :: Science/Research
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
35
+ Requires-Python: >=3.11
36
+ Requires-Dist: hwoutils
37
+ Requires-Dist: jax>=0.8.1
38
+ Requires-Dist: jaxlib>=0.8.1
39
+ Requires-Dist: optixstuff
40
+ Provides-Extra: dev
41
+ Requires-Dist: pre-commit; extra == 'dev'
42
+ Provides-Extra: docs
43
+ Requires-Dist: ipython; extra == 'docs'
44
+ Requires-Dist: matplotlib; extra == 'docs'
45
+ Requires-Dist: myst-nb; extra == 'docs'
46
+ Requires-Dist: sphinx; extra == 'docs'
47
+ Requires-Dist: sphinx-autoapi; extra == 'docs'
48
+ Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
49
+ Requires-Dist: sphinx-book-theme; extra == 'docs'
50
+ Provides-Extra: test
51
+ Requires-Dist: hypothesis; extra == 'test'
52
+ Requires-Dist: nox; extra == 'test'
53
+ Requires-Dist: orbix; extra == 'test'
54
+ Requires-Dist: pytest; extra == 'test'
55
+ Requires-Dist: pytest-cov; extra == 'test'
56
+ Description-Content-Type: text/markdown
57
+
58
+ # jaxedith
59
+ JAX based HWO exposure time calculator. This library is set up to be a JAX based implementation of the [pyEDITH package](https://github.com/eleonoraalei/pyEDITH/).
60
+
61
+ ## Overview
62
+ This package is currently in early development.
@@ -0,0 +1,5 @@
1
+ # jaxedith
2
+ JAX based HWO exposure time calculator. This library is set up to be a JAX based implementation of the [pyEDITH package](https://github.com/eleonoraalei/pyEDITH/).
3
+
4
+ ## Overview
5
+ This package is currently in early development.
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ['hatchling', "hatch-fancy-pypi-readme", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "jaxedith"
7
+ description = "JAX based HWO exposure time calculator"
8
+ authors = [{ name = "Corey Spohn", email = "corey.a.spohn@nasa.gov" }]
9
+ dynamic = ['readme', 'version']
10
+ requires-python = ">=3.11"
11
+ license = { file = "LICENSE" }
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Intended Audience :: Science/Research",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ "Topic :: Scientific/Engineering :: Astronomy",
18
+ ]
19
+ dependencies = ["hwoutils", "jax>=0.8.1", "jaxlib>=0.8.1", "optixstuff"]
20
+ [project.optional-dependencies]
21
+ dev = ["pre-commit"]
22
+ docs = [
23
+ "sphinx",
24
+ "myst-nb",
25
+ "sphinx-book-theme",
26
+ "sphinx-autoapi",
27
+ "sphinx_autodoc_typehints",
28
+ "ipython",
29
+ "matplotlib",
30
+ ]
31
+ test = ["nox", "pytest", "hypothesis", "pytest-cov", "orbix"]
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/CoreySpohn/jaxedith"
35
+ Issues = "https://github.com/CoreySpohn/jaxedith/issues"
36
+
37
+ [tool.hatch.version]
38
+ source = "vcs"
39
+
40
+ [tool.hatch.build.hooks.vcs]
41
+ version-file = "src/jaxedith/_version.py"
42
+
43
+ [tool.hatch.metadata.hooks.fancy-pypi-readme]
44
+ content-type = "text/markdown"
45
+
46
+ [[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
47
+ path = "README.md"
48
+
49
+ [tool.ruff.lint]
50
+ select = ["B", "D", "E", "F", "I", "UP", "RUF"]
51
+
52
+ [tool.ruff.lint.pydocstyle]
53
+ convention = "google"
54
+
55
+ [tool.hatch.build.targets.wheel]
56
+ packages = ["src/jaxedith"]
57
+
58
+ [tool.hatch.build.targets.sdist]
59
+ exclude = ["/scripts", "/docs", "/tests", "/.github"]
@@ -0,0 +1,66 @@
1
+ """JAX ETC -- public API.
2
+
3
+ This module provides the main user-facing functions for the JAX exposure time
4
+ calculator. It bridges :mod:`optixstuff` hardware objects (stored as
5
+ equinox modules) and astrophysical scene parameters to the pure-JAX count-rate
6
+ and solver functions.
7
+
8
+ Example:
9
+ -------
10
+ >>> from optixstuff import OpticalPath
11
+ >>> from jaxedith import calc_exptime, CONFIG
12
+ >>>
13
+ >>> # Build optical_path from optixstuff objects
14
+ >>> optical_path = OpticalPath(primary=..., coronagraph=..., detector=...)
15
+ >>> scene = ETCScene(F0=..., Fs_over_F0=..., Fp_over_Fs=..., ...)
16
+ >>>
17
+ >>> t_exp = calc_exptime(optical_path, scene, config=CONFIG)
18
+ """
19
+
20
+ try:
21
+ from ._version import __version__
22
+ except ImportError:
23
+ __version__ = "unknown"
24
+
25
+ # ── Re-exports ────────────────────────────────────────────────────────────────
26
+
27
+ from .config import (
28
+ AYO_CONFIG,
29
+ CONFIG,
30
+ EXOSIMS_CHARACTERIZATION_CONFIG,
31
+ EXOSIMS_DETECTION_CONFIG,
32
+ ETCConfig,
33
+ )
34
+ from .core import (
35
+ calc_count_rates,
36
+ calc_exptime,
37
+ calc_exptime_spectrum,
38
+ calc_snr,
39
+ )
40
+ from .observation import (
41
+ calc_exptime_from_observation,
42
+ calc_exptime_from_system,
43
+ calc_snr_from_observation,
44
+ calc_snr_from_system,
45
+ observation_geometry,
46
+ )
47
+ from .scene import ETCScene
48
+
49
+ __all__ = [
50
+ "AYO_CONFIG",
51
+ "CONFIG",
52
+ "EXOSIMS_CHARACTERIZATION_CONFIG",
53
+ "EXOSIMS_DETECTION_CONFIG",
54
+ "ETCConfig",
55
+ "ETCScene",
56
+ "__version__",
57
+ "calc_count_rates",
58
+ "calc_exptime",
59
+ "calc_exptime_from_observation",
60
+ "calc_exptime_from_system",
61
+ "calc_exptime_spectrum",
62
+ "calc_snr",
63
+ "calc_snr_from_observation",
64
+ "calc_snr_from_system",
65
+ "observation_geometry",
66
+ ]
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.2'
22
+ __version_tuple__ = version_tuple = (0, 0, 2)
23
+
24
+ __commit_id__ = commit_id = None
@@ -0,0 +1,91 @@
1
+ """ETCConfig: equinox module that selects the ETC equation variant.
2
+
3
+ The ``variant`` field is a plain Python string used for trace-time dispatch —
4
+ it selects which solver function to call rather than branching inside a single
5
+ function. This means JIT compiles only the chosen code path and ``vmap``
6
+ traces only one solver, avoiding dead-branch overhead.
7
+ """
8
+
9
+ import equinox as eqx
10
+
11
+
12
+ class ETCConfig(eqx.Module):
13
+ """Configuration that determines which ETC equation variant to use.
14
+
15
+ The ``variant`` field drives solver dispatch at trace time:
16
+
17
+ - ``"ayo"`` — AYO / Stark et al. equations (ADI background doubling,
18
+ data-driven noise floor).
19
+ - ``"jaxedith"`` — Same as AYO plus exozodi noise floor extension.
20
+ - ``"exosims_det"`` — EXOSIMS detection (no ADI factor, speckle residual).
21
+ - ``"exosims_char"`` — EXOSIMS characterization (Cp added to Cb).
22
+
23
+ All other fields are static parameters passed directly to the selected
24
+ solver — no boolean flags or ``jnp.where`` branching.
25
+
26
+ Attributes:
27
+ variant: Equation variant string (see above).
28
+ bg_multiplier: ADI background multiplier. AYO/jaxedith: 2.0;
29
+ EXOSIMS: 1.0.
30
+ ppfact: Post-processing factor (EXOSIMS only).
31
+ stability_fact: Wavefront stability factor (EXOSIMS only).
32
+ overhead_multi: Multiplicative overhead factor.
33
+ overhead_fixed_s: Fixed overhead in seconds.
34
+ n_rolls: Number of telescope rolls.
35
+ include_exozodi_noise_floor: Whether the exozodi noise floor is
36
+ included (jaxedith extension).
37
+ npix_multiplier: Pixel count correction factor for the photometric
38
+ aperture. ETC-specific, not a hardware property.
39
+ """
40
+
41
+ # --- Solver variant (trace-time dispatch) ---
42
+ variant: str = "jaxedith"
43
+
44
+ # --- Equation parameters ---
45
+ bg_multiplier: float = 2.0
46
+ ppfact: float = 1.0
47
+ stability_fact: float = 1.0
48
+
49
+ # --- Overheads ---
50
+ overhead_multi: float = 1.0
51
+ overhead_fixed_s: float = 0.0
52
+ n_rolls: int = 1
53
+
54
+ # --- Exozodi noise floor (jaxedith extension) ---
55
+ include_exozodi_noise_floor: bool = True
56
+
57
+ # --- Aperture correction ---
58
+ npix_multiplier: float = 1.0
59
+
60
+
61
+ # ---------------------------------------------------------------------------
62
+ # Presets
63
+ # ---------------------------------------------------------------------------
64
+
65
+ AYO_CONFIG = ETCConfig(
66
+ variant="ayo",
67
+ bg_multiplier=2.0,
68
+ include_exozodi_noise_floor=False,
69
+ )
70
+ """AYO preset — original Stark et al. equations without exozodi noise floor."""
71
+
72
+ CONFIG = ETCConfig(
73
+ variant="jaxedith",
74
+ bg_multiplier=2.0,
75
+ include_exozodi_noise_floor=True,
76
+ )
77
+ """jaxedith preset — AYO equations plus exozodi noise floor."""
78
+
79
+ EXOSIMS_DETECTION_CONFIG = ETCConfig(
80
+ variant="exosims_det",
81
+ bg_multiplier=1.0,
82
+ include_exozodi_noise_floor=False,
83
+ )
84
+ """EXOSIMS detection preset — no ADI factor, speckle residual instead of noise floor."""
85
+
86
+ EXOSIMS_CHARACTERIZATION_CONFIG = ETCConfig(
87
+ variant="exosims_char",
88
+ bg_multiplier=1.0,
89
+ include_exozodi_noise_floor=False,
90
+ )
91
+ """EXOSIMS characterization preset — Cp added to Cb."""