physicaloptix 2.2.0__tar.gz → 2.3.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.
- physicaloptix-2.3.1/.codespellrc +5 -0
- physicaloptix-2.3.1/.editorconfig +15 -0
- physicaloptix-2.3.1/.gitattributes +10 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/.gitignore +6 -2
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/.pre-commit-config.yaml +6 -2
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/CHANGELOG.md +21 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/PKG-INFO +43 -32
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/README.md +5 -3
- physicaloptix-2.3.1/SECURITY.md +9 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/pyproject.toml +73 -26
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/_version.py +2 -2
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/instruments/roman.py +1 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/interop.py +8 -2
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/speckle.py +1 -1
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/__init__.py +21 -2
- physicaloptix-2.3.1/src/physicaloptix/viz/fresnel.py +629 -0
- physicaloptix-2.3.1/src/physicaloptix/viz/propagation.py +558 -0
- physicaloptix-2.3.1/src/physicaloptix/viz/rays.py +502 -0
- physicaloptix-2.3.1/src/physicaloptix/viz/raytrace.py +438 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/.readthedocs.yaml +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/.zenodo.json +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/CITATION.cff +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/LICENSE +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/NOTICE +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/__init__.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/apertures.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/coatings.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/core/__init__.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/core/field.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/core/grid.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/data/eac1_ci_train.yaml +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/data/eac1_primary.yaml +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/detector.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/diagnostics.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/diff.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/__init__.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/base.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/basis.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/dispersive.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/modes.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/phase_screen.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/vortex.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/elements/zernike_wfs.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/ifs.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/instruments/__init__.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/instruments/_proper_beam.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/instruments/_proper_ops.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/instruments/nircam.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/instruments/roman_full.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/linearize.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/multichannel.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/path.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/robustness.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/sources.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/stats.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/system.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/trains.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/transforms/__init__.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/transforms/cmft.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/transforms/fraunhofer.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/transforms/fresnel.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/_legacy.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/_prepare.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/_require.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/boiling.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/columns.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/fields.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/modes.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/profiles.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/speckle.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/viz/train.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/src/physicaloptix/yip.py +0 -0
- {physicaloptix-2.2.0 → physicaloptix-2.3.1}/tools/check_internal_refs.py +0 -0
|
@@ -70,6 +70,7 @@ instance/
|
|
|
70
70
|
|
|
71
71
|
# Sphinx documentation
|
|
72
72
|
docs/_build/
|
|
73
|
+
docs/.build/
|
|
73
74
|
|
|
74
75
|
# PyBuilder
|
|
75
76
|
.pybuilder/
|
|
@@ -195,9 +196,9 @@ cython_debug/
|
|
|
195
196
|
.abstra/
|
|
196
197
|
|
|
197
198
|
# Visual Studio Code
|
|
198
|
-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
200
|
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
202
|
# you could uncomment the following to ignore the entire vscode folder
|
|
202
203
|
# .vscode/
|
|
203
204
|
# Temporary file for partial code execution
|
|
@@ -219,3 +220,6 @@ __marimo__/
|
|
|
219
220
|
|
|
220
221
|
# hatch-vcs generated version file
|
|
221
222
|
*_version.py
|
|
223
|
+
.claude/
|
|
224
|
+
.jax_cache/
|
|
225
|
+
.DS_Store
|
|
@@ -15,13 +15,17 @@ repos:
|
|
|
15
15
|
args: [--pytest-test-first]
|
|
16
16
|
- id: end-of-file-fixer
|
|
17
17
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
18
|
-
rev: v0.
|
|
18
|
+
rev: v0.17.3
|
|
19
19
|
hooks:
|
|
20
20
|
- id: ruff-check
|
|
21
21
|
args: [--fix]
|
|
22
22
|
- id: ruff-format
|
|
23
|
+
- repo: https://github.com/codespell-project/codespell
|
|
24
|
+
rev: v2.4.1
|
|
25
|
+
hooks:
|
|
26
|
+
- id: codespell
|
|
23
27
|
- repo: https://github.com/compilerla/conventional-pre-commit
|
|
24
|
-
rev: v4.
|
|
28
|
+
rev: v4.4.0
|
|
25
29
|
hooks:
|
|
26
30
|
- id: conventional-pre-commit
|
|
27
31
|
stages: [commit-msg]
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.1](https://github.com/CoreySpohn/physicaloptix/compare/v2.3.0...v2.3.1) (2026-11-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **interop:** accept stellar_diam_lod in core_mean_intensity ([4dbc6ef](https://github.com/CoreySpohn/physicaloptix/commit/4dbc6efa5a95532cab65def7c4638ac2ac6fc7e0))
|
|
9
|
+
* **physicaloptix:** assert focal mask is present before use ([4d5afa5](https://github.com/CoreySpohn/physicaloptix/commit/4d5afa578522c84f021317437d1fc8abff5ca1fb))
|
|
10
|
+
|
|
11
|
+
## [2.3.0](https://github.com/CoreySpohn/physicaloptix/compare/v2.2.0...v2.3.0) (2026-10-03)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **viz:** add plot_propagation, a field-along-z map with bench elements and a background-centered signed colormap ([9b3701f](https://github.com/CoreySpohn/physicaloptix/commit/9b3701fd29914024735e4f10e07d5c24f8671c4d))
|
|
17
|
+
* **viz:** add ray_train and mirror_train side views with paraxial and conic-mirror tracers, and near-to-far, Fresnel-zone and Cornu views ([da896e5](https://github.com/CoreySpohn/physicaloptix/commit/da896e528606901c9f4bc9ecc141a58ca37e6c27))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **deps:** require eyepiece 0.7.0 for the viz extra, whose Cornu view draws with phasor ([c2cd05e](https://github.com/CoreySpohn/physicaloptix/commit/c2cd05ed2a05471f10c1f10ad1d4229b07536bc3))
|
|
23
|
+
|
|
3
24
|
## [2.2.0](https://github.com/CoreySpohn/physicaloptix/compare/v2.1.0...v2.2.0) (2026-09-30)
|
|
4
25
|
|
|
5
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: physicaloptix
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Physical optics (PSFs and diffraction) for the HWO direct imaging simulation suite
|
|
5
5
|
Project-URL: Homepage, https://github.com/CoreySpohn/physicaloptix
|
|
6
6
|
Project-URL: Issues, https://github.com/CoreySpohn/physicaloptix/issues
|
|
@@ -33,40 +33,49 @@ Classifier: Intended Audience :: Science/Research
|
|
|
33
33
|
Classifier: License :: OSI Approved :: MIT License
|
|
34
34
|
Classifier: Programming Language :: Python :: 3
|
|
35
35
|
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
36
|
-
Requires-Python: >=3.
|
|
37
|
-
Requires-Dist: astropy
|
|
38
|
-
Requires-Dist: equinox>=0.
|
|
39
|
-
Requires-Dist: hwoutils
|
|
40
|
-
Requires-Dist: jax>=0.
|
|
41
|
-
Requires-Dist: jaxlib>=0.
|
|
42
|
-
Requires-Dist: jaxtyping
|
|
43
|
-
Requires-Dist: numpy
|
|
36
|
+
Requires-Python: >=3.12
|
|
37
|
+
Requires-Dist: astropy>=6.1
|
|
38
|
+
Requires-Dist: equinox>=0.13.2
|
|
39
|
+
Requires-Dist: hwoutils>=1.10.0
|
|
40
|
+
Requires-Dist: jax>=0.8.1
|
|
41
|
+
Requires-Dist: jaxlib>=0.8.1
|
|
42
|
+
Requires-Dist: jaxtyping>=0.3.3
|
|
43
|
+
Requires-Dist: numpy>=2.0
|
|
44
44
|
Requires-Dist: optixstuff>=3.0.0
|
|
45
|
-
Requires-Dist: pyyaml
|
|
46
|
-
Requires-Dist: scipy
|
|
45
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
46
|
+
Requires-Dist: scipy>=1.13
|
|
47
47
|
Provides-Extra: dev
|
|
48
|
-
Requires-Dist: pre-commit; extra == 'dev'
|
|
48
|
+
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
|
|
49
49
|
Provides-Extra: docs
|
|
50
|
-
Requires-Dist: eyepiece; extra == 'docs'
|
|
51
|
-
Requires-Dist: imageio-ffmpeg; extra == 'docs'
|
|
52
|
-
Requires-Dist: ipython; extra == 'docs'
|
|
53
|
-
Requires-Dist: matplotlib; extra == 'docs'
|
|
54
|
-
Requires-Dist: myst-nb; extra == 'docs'
|
|
55
|
-
Requires-Dist: sphinx; extra == 'docs'
|
|
56
|
-
Requires-Dist: sphinx-
|
|
57
|
-
Requires-Dist: sphinx-
|
|
58
|
-
Requires-Dist: sphinx
|
|
59
|
-
Requires-Dist: sphinxcontrib-mermaid; extra == 'docs'
|
|
50
|
+
Requires-Dist: eyepiece>=0.7.0; extra == 'docs'
|
|
51
|
+
Requires-Dist: imageio-ffmpeg>=0.5.1; extra == 'docs'
|
|
52
|
+
Requires-Dist: ipython>=8.24.0; extra == 'docs'
|
|
53
|
+
Requires-Dist: matplotlib>=3.11.0; extra == 'docs'
|
|
54
|
+
Requires-Dist: myst-nb>=1.2.0; extra == 'docs'
|
|
55
|
+
Requires-Dist: sphinx-autoapi>=3.6.0; extra == 'docs'
|
|
56
|
+
Requires-Dist: sphinx-autodoc-typehints>=3.0.1; extra == 'docs'
|
|
57
|
+
Requires-Dist: sphinx-book-theme>=1.1.4; extra == 'docs'
|
|
58
|
+
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
|
|
59
|
+
Requires-Dist: sphinxcontrib-mermaid>=1.0.0; extra == 'docs'
|
|
60
60
|
Provides-Extra: test
|
|
61
|
-
Requires-Dist:
|
|
62
|
-
Requires-Dist:
|
|
63
|
-
Requires-Dist:
|
|
64
|
-
Requires-Dist:
|
|
65
|
-
Requires-Dist:
|
|
66
|
-
Requires-Dist:
|
|
61
|
+
Requires-Dist: hcipy>=0.7.0; extra == 'test'
|
|
62
|
+
Requires-Dist: hypothesis>=6.79.1; extra == 'test'
|
|
63
|
+
Requires-Dist: lod-unit>=1.8.0; extra == 'test'
|
|
64
|
+
Requires-Dist: matplotlib>=3.11.0; extra == 'test'
|
|
65
|
+
Requires-Dist: psutil>=5.9.4; extra == 'test'
|
|
66
|
+
Requires-Dist: pytest-cov>=1.0; extra == 'test'
|
|
67
|
+
Requires-Dist: pytest-fail-slow>=0.1.0; extra == 'test'
|
|
68
|
+
Requires-Dist: pytest-markdown-docs>=0.5.0; extra == 'test'
|
|
69
|
+
Requires-Dist: pytest-testmon>=2.0.7; extra == 'test'
|
|
70
|
+
Requires-Dist: pytest-timeout>=1.3.1; extra == 'test'
|
|
71
|
+
Requires-Dist: pytest-xdist>=2.5; extra == 'test'
|
|
72
|
+
Requires-Dist: pytest>=7.3.2; extra == 'test'
|
|
73
|
+
Requires-Dist: scipy>=1.13; extra == 'test'
|
|
74
|
+
Requires-Dist: yippy>=2.10.6; extra == 'test'
|
|
67
75
|
Provides-Extra: viz
|
|
68
|
-
Requires-Dist: eyepiece>=0.
|
|
76
|
+
Requires-Dist: eyepiece>=0.7.0; extra == 'viz'
|
|
69
77
|
Requires-Dist: hwostyle>=1.4.0; extra == 'viz'
|
|
78
|
+
Requires-Dist: matplotlib>=3.11.0; extra == 'viz'
|
|
70
79
|
Description-Content-Type: text/markdown
|
|
71
80
|
|
|
72
81
|
# physicaloptix
|
|
@@ -96,14 +105,16 @@ The key piece is `PathCoronagraph`, which implements optixstuff's
|
|
|
96
105
|
wrap it, and hand it to any downstream tool. Its IWA and scalar performance
|
|
97
106
|
curves are derived from the propagated PSFs at construction, never declared.
|
|
98
107
|
|
|
99
|
-
|
|
108
|
+
Requires a configured optical path, pupil field, and output sampling.
|
|
109
|
+
|
|
110
|
+
```python notest
|
|
100
111
|
import physicaloptix as po
|
|
101
112
|
|
|
102
113
|
coro = po.PathCoronagraph.from_path(
|
|
103
114
|
core_path, pupil_field, diameter_m=6.0, owa_lod=32.0
|
|
104
115
|
)
|
|
105
|
-
psf = coro.on_axis_psf(600.0, pixel_scale_rad, npix)
|
|
106
|
-
eta = coro.throughput(6.0, 600.0)
|
|
116
|
+
psf = coro.on_axis_psf(600.0, pixel_scale_rad, npix) # unit-flux PSF out
|
|
117
|
+
eta = coro.throughput(6.0, 600.0) # derived, not declared
|
|
107
118
|
```
|
|
108
119
|
|
|
109
120
|
## What physicaloptix is *not*
|
|
@@ -25,14 +25,16 @@ The key piece is `PathCoronagraph`, which implements optixstuff's
|
|
|
25
25
|
wrap it, and hand it to any downstream tool. Its IWA and scalar performance
|
|
26
26
|
curves are derived from the propagated PSFs at construction, never declared.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Requires a configured optical path, pupil field, and output sampling.
|
|
29
|
+
|
|
30
|
+
```python notest
|
|
29
31
|
import physicaloptix as po
|
|
30
32
|
|
|
31
33
|
coro = po.PathCoronagraph.from_path(
|
|
32
34
|
core_path, pupil_field, diameter_m=6.0, owa_lod=32.0
|
|
33
35
|
)
|
|
34
|
-
psf = coro.on_axis_psf(600.0, pixel_scale_rad, npix)
|
|
35
|
-
eta = coro.throughput(6.0, 600.0)
|
|
36
|
+
psf = coro.on_axis_psf(600.0, pixel_scale_rad, npix) # unit-flux PSF out
|
|
37
|
+
eta = coro.throughput(6.0, 600.0) # derived, not declared
|
|
36
38
|
```
|
|
37
39
|
|
|
38
40
|
## What physicaloptix is *not*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
This is research software maintained by one person. Please report a vulnerability, for
|
|
4
|
+
example a leaked credential, a malicious dependency, or a workflow that could be abused, through
|
|
5
|
+
GitHub private vulnerability reporting: use "Report a vulnerability" on the Security tab of this
|
|
6
|
+
repository. If that is unavailable, email corey.a.spohn@nasa.gov with "SECURITY" in the subject.
|
|
7
|
+
|
|
8
|
+
Expect an acknowledgement within a week. Only the latest release receives fixes. Incorrect
|
|
9
|
+
numerical results are not security issues; please open an ordinary issue for those.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ['hatchling', "hatch-fancy-pypi-readme", "hatch-vcs"]
|
|
2
|
+
requires = ['hatchling>=1.27.0', "hatch-fancy-pypi-readme>=25.1.0", "hatch-vcs>=0.4.0"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -7,7 +7,7 @@ name = "physicaloptix"
|
|
|
7
7
|
description = "Physical optics (PSFs and diffraction) for the HWO direct imaging simulation suite"
|
|
8
8
|
authors = [{ name = "Corey Spohn", email = "corey.a.spohn@nasa.gov" }]
|
|
9
9
|
dynamic = ['readme', 'version']
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
11
|
license = { file = "LICENSE" }
|
|
12
12
|
classifiers = [
|
|
13
13
|
"Development Status :: 2 - Pre-Alpha",
|
|
@@ -20,41 +20,59 @@ classifiers = [
|
|
|
20
20
|
# reader, and scipy (scipy.special.j1) of its round band-limited mask; both
|
|
21
21
|
# were only transitive (optixstuff, jax) before and are declared here.
|
|
22
22
|
dependencies = [
|
|
23
|
-
"astropy",
|
|
24
|
-
"equinox>=0.
|
|
25
|
-
"hwoutils",
|
|
26
|
-
"pyyaml",
|
|
27
|
-
"jax>=0.
|
|
28
|
-
"jaxlib>=0.
|
|
29
|
-
"jaxtyping",
|
|
30
|
-
"numpy",
|
|
23
|
+
"astropy>=6.1",
|
|
24
|
+
"equinox>=0.13.2",
|
|
25
|
+
"hwoutils>=1.10.0",
|
|
26
|
+
"pyyaml>=6.0.1",
|
|
27
|
+
"jax>=0.8.1",
|
|
28
|
+
"jaxlib>=0.8.1",
|
|
29
|
+
"jaxtyping>=0.3.3",
|
|
30
|
+
"numpy>=2.0",
|
|
31
31
|
"optixstuff>=3.0.0",
|
|
32
|
-
"scipy",
|
|
32
|
+
"scipy>=1.13",
|
|
33
33
|
]
|
|
34
34
|
|
|
35
35
|
[project.optional-dependencies]
|
|
36
|
-
dev = ["pre-commit"]
|
|
36
|
+
dev = ["pre-commit>=3.7.0"]
|
|
37
37
|
docs = [
|
|
38
|
-
"sphinx",
|
|
39
|
-
"myst-nb",
|
|
40
|
-
"sphinx-book-theme",
|
|
41
|
-
"sphinx-autoapi",
|
|
42
|
-
"sphinx_autodoc_typehints",
|
|
43
|
-
"sphinxcontrib-mermaid",
|
|
44
|
-
"ipython",
|
|
45
|
-
"matplotlib",
|
|
46
|
-
"eyepiece",
|
|
47
|
-
"imageio-ffmpeg",
|
|
38
|
+
"sphinx>=8.2.3",
|
|
39
|
+
"myst-nb>=1.2.0",
|
|
40
|
+
"sphinx-book-theme>=1.1.4",
|
|
41
|
+
"sphinx-autoapi>=3.6.0",
|
|
42
|
+
"sphinx_autodoc_typehints>=3.0.1",
|
|
43
|
+
"sphinxcontrib-mermaid>=1.0.0",
|
|
44
|
+
"ipython>=8.24.0",
|
|
45
|
+
"matplotlib>=3.11.0",
|
|
46
|
+
"eyepiece>=0.7.0",
|
|
47
|
+
"imageio-ffmpeg>=0.5.1",
|
|
48
|
+
]
|
|
49
|
+
test = [
|
|
50
|
+
"matplotlib>=3.11.0",
|
|
51
|
+
"pytest>=7.3.2",
|
|
52
|
+
"hypothesis>=6.79.1",
|
|
53
|
+
"pytest-cov>=1.0",
|
|
54
|
+
# The optional budget plugin uses psutil for portable memory measurements.
|
|
55
|
+
"psutil>=5.9.4",
|
|
56
|
+
"pytest-xdist>=2.5",
|
|
57
|
+
"pytest-testmon>=2.0.7",
|
|
58
|
+
"pytest-markdown-docs>=0.5.0",
|
|
59
|
+
"pytest-timeout>=1.3.1",
|
|
60
|
+
"pytest-fail-slow>=0.1.0",
|
|
61
|
+
"scipy>=1.13",
|
|
62
|
+
"yippy>=2.10.6",
|
|
63
|
+
"lod-unit>=1.8.0",
|
|
64
|
+
"hcipy>=0.7.0",
|
|
48
65
|
]
|
|
49
|
-
test = ["matplotlib", "nox", "pytest", "hypothesis", "pytest-cov", "scipy"]
|
|
50
66
|
# hwostyle is a DIRECT import of viz/train.py and viz/modes.py (cmaps.opd,
|
|
51
67
|
# palette, roles), so it is declared here rather than relied on transitively
|
|
52
68
|
# through eyepiece -- whose own pin (hwostyle>=1.3.0) would legally resolve a
|
|
53
69
|
# version with no cmaps.opd, turning plot_mode_gallery into a call-time
|
|
54
70
|
# AttributeError with no install-time error.
|
|
55
|
-
# eyepiece 0.
|
|
56
|
-
# viz/
|
|
57
|
-
viz
|
|
71
|
+
# eyepiece 0.7.0 is the first release with phasor (per-arrow starts=),
|
|
72
|
+
# which viz/fresnel.py calls; eyepiece.prepared (viz/_prepare.py,
|
|
73
|
+
# viz/boiling.py) arrived in 0.5.0.
|
|
74
|
+
# Visualization modules import matplotlib directly as well as through eyepiece.
|
|
75
|
+
viz = ["eyepiece>=0.7.0", "hwostyle>=1.4.0", "matplotlib>=3.11.0"]
|
|
58
76
|
|
|
59
77
|
[project.urls]
|
|
60
78
|
Homepage = "https://github.com/CoreySpohn/physicaloptix"
|
|
@@ -90,6 +108,13 @@ dev = [
|
|
|
90
108
|
]
|
|
91
109
|
|
|
92
110
|
[tool.pytest.ini_options]
|
|
111
|
+
filterwarnings = [
|
|
112
|
+
"error",
|
|
113
|
+
# tol_colors calls deprecated Colormap.set_bad while constructing its palettes.
|
|
114
|
+
"ignore:The set_bad function will be deprecated in a future version[.]:PendingDeprecationWarning:tol_colors",
|
|
115
|
+
# JAX 0.8.1 dot_general reverse mode projects complex cotangents to real inputs.
|
|
116
|
+
"ignore:Casting complex values to real discards the imaginary part:numpy.exceptions.ComplexWarning:jax[.]_src[.]lax[.]lax$:5518",
|
|
117
|
+
]
|
|
93
118
|
# The default run is COMPLETE: the external-reference gates are the point of
|
|
94
119
|
# this suite, so nothing is deselected without the caller asking. A handful of
|
|
95
120
|
# gates rebuild a full yield package or a full EAC-1 chain and dominate the
|
|
@@ -98,6 +123,7 @@ dev = [
|
|
|
98
123
|
# gates hold large x64 EAC-1 arrays and one worker per core exhausts memory
|
|
99
124
|
# long before parallelism pays.
|
|
100
125
|
markers = [
|
|
126
|
+
"medium: tests with a 30-second default time budget",
|
|
101
127
|
"slow: rebuilds a full yield package or EAC-1 chain (tens of seconds up)",
|
|
102
128
|
]
|
|
103
129
|
|
|
@@ -106,3 +132,24 @@ packages = ["src/physicaloptix"]
|
|
|
106
132
|
|
|
107
133
|
[tool.hatch.build.targets.sdist]
|
|
108
134
|
exclude = ["/scripts", "/docs", "/tests", "/.github"]
|
|
135
|
+
|
|
136
|
+
[tool.testbudget]
|
|
137
|
+
library = "physicaloptix"
|
|
138
|
+
mode = "report"
|
|
139
|
+
unit_s = 5
|
|
140
|
+
medium_s = 30
|
|
141
|
+
slow_s = 300
|
|
142
|
+
|
|
143
|
+
[tool.deptry]
|
|
144
|
+
known_first_party = ["physicaloptix"]
|
|
145
|
+
optional_dependencies_dev_groups = ["dev", "docs", "test"]
|
|
146
|
+
|
|
147
|
+
[tool.deptry.per_rule_ignores]
|
|
148
|
+
# JAX loads its compiled backend; keep the explicit minimum version constraint.
|
|
149
|
+
DEP002 = ["jaxlib"]
|
|
150
|
+
|
|
151
|
+
[tool.ty.environment]
|
|
152
|
+
python-version = "3.11"
|
|
153
|
+
|
|
154
|
+
[tool.ty.src]
|
|
155
|
+
include = ["src/physicaloptix"]
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.
|
|
22
|
-
__version_tuple__ = version_tuple = (2,
|
|
21
|
+
__version__ = version = '2.3.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 3, 1)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -507,6 +507,7 @@ class RomanCompact(eqx.Module):
|
|
|
507
507
|
return data
|
|
508
508
|
|
|
509
509
|
def _focal_mask(self, field, wl, stages):
|
|
510
|
+
assert self.fpm is not None, "fpm must be present when applying a focal mask"
|
|
510
511
|
m = self.fpm.shape[0]
|
|
511
512
|
dout = self.fpm_sampling_lod * self.fpm_lam0_nm / wl
|
|
512
513
|
focal = Grid.focal(m, dout)
|
|
@@ -221,8 +221,14 @@ class PathCoronagraph(AbstractCoronagraph):
|
|
|
221
221
|
"""Photometric core area (above-half-max region) in (lambda/D)^2."""
|
|
222
222
|
return self._interp(self.curve_core_area, separation_lod)
|
|
223
223
|
|
|
224
|
-
def core_mean_intensity(
|
|
225
|
-
|
|
224
|
+
def core_mean_intensity(
|
|
225
|
+
self, separation_lod, wavelength_nm, *, time_s=0.0, stellar_diam_lod=0.0
|
|
226
|
+
):
|
|
227
|
+
"""Mean stellar intensity density over the core, in (lambda/D)^-2.
|
|
228
|
+
|
|
229
|
+
The curves are propagated for a point star, so stellar_diam_lod is
|
|
230
|
+
accepted for the coronagraph contract and ignored.
|
|
231
|
+
"""
|
|
226
232
|
return self._interp(self.curve_core_mean_intensity, separation_lod)
|
|
227
233
|
|
|
228
234
|
def occulter_transmission(self, separation_lod, wavelength_nm, *, time_s=0.0):
|
|
@@ -1096,7 +1096,7 @@ class SpeckleProcess(eqx.Module):
|
|
|
1096
1096
|
per focal-plane pixel, with ``Gamma = sum_k rms_k^2 |g_k|^2``,
|
|
1097
1097
|
``P = sum_k rms_k^2 g_k^2``, ``I_C = |e_nom|^2``,
|
|
1098
1098
|
``phi_C = angle(e_nom)`` and pinning-quadrature variance
|
|
1099
|
-
``Var(X) = (Gamma + Re[P e^{-2 i phi_C}]) / 2
|
|
1099
|
+
``Var(X) = (Gamma + Re[P e^{-2 i phi_C}]) / 2``::
|
|
1100
1100
|
|
|
1101
1101
|
E[delta] = Gamma / norm
|
|
1102
1102
|
Var[delta] = (4 I_C Var(X) + Gamma^2 + |P|^2) / norm^2
|
|
@@ -4,7 +4,8 @@ Lazy by design: every public name imports on first attribute access, so the
|
|
|
4
4
|
base install never needs the viz extra, and loading one function never loads
|
|
5
5
|
another's module. The eyepiece-consuming names raise an actionable
|
|
6
6
|
ImportError without the viz extra; the deprecated render_path needs only
|
|
7
|
-
matplotlib, and only once it is called
|
|
7
|
+
matplotlib, and only once it is called; the side-view ray tracers
|
|
8
|
+
(``physicaloptix.viz.raytrace``) need only NumPy and SciPy.
|
|
8
9
|
"""
|
|
9
10
|
|
|
10
11
|
_LAZY = {
|
|
@@ -19,6 +20,14 @@ _LAZY = {
|
|
|
19
20
|
"animate_speckles": "boiling",
|
|
20
21
|
"boiling_strip": "boiling",
|
|
21
22
|
"plot_contrast_profile": "profiles",
|
|
23
|
+
"plot_propagation": "propagation",
|
|
24
|
+
"plot_near_to_far": "fresnel",
|
|
25
|
+
"prepare_near_to_far": "fresnel",
|
|
26
|
+
"plot_fresnel_zones": "fresnel",
|
|
27
|
+
"plot_cornu": "fresnel",
|
|
28
|
+
"ray_train": "rays",
|
|
29
|
+
"mirror_train": "rays",
|
|
30
|
+
"plot_mirror": "rays",
|
|
22
31
|
"plot_mode_gallery": "modes",
|
|
23
32
|
"plot_zernike_pyramid": "modes",
|
|
24
33
|
"plot_field_ellipse": "speckle",
|
|
@@ -27,7 +36,17 @@ _LAZY = {
|
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
# Names that do not go through eyepiece at all.
|
|
30
|
-
_LAZY_PLAIN = {
|
|
39
|
+
_LAZY_PLAIN = {
|
|
40
|
+
"render_path": "_legacy",
|
|
41
|
+
"trace_paraxial": "raytrace",
|
|
42
|
+
"beam_polygons": "raytrace",
|
|
43
|
+
"strip_polygons": "raytrace",
|
|
44
|
+
"trace_mirrors": "raytrace",
|
|
45
|
+
"ray_crossing": "raytrace",
|
|
46
|
+
"parabola": "raytrace",
|
|
47
|
+
"hyperbola": "raytrace",
|
|
48
|
+
"Mirror": "raytrace",
|
|
49
|
+
}
|
|
31
50
|
|
|
32
51
|
__all__ = sorted([*_LAZY, *_LAZY_PLAIN])
|
|
33
52
|
|