Commit 7c4b515
authored
Merge pull request #142 from CosmoStat/case_study_psf_decontamination
WaveDiff: New PSF Model Features, Refactoring, Rotation Obscuration Mask, and PEP8 Compliance
This commit merges the 'case_study_psf_decontamination' feature/refactor branch into `develop`, introducing
significant new features, architectural changes, bug fixes, and CI/tooling improvements.
Highlights:
New Features
---------------
- Added physical Zernike prior layer to PSF model (Closes #123)
- Added obscuration mask rotation support to PSF models
- Included module for simulating spatially-varying PSFs with validation tests (Closes #116, #133)
- Integrated centroid estimation correction (Closes #113)
- Corrected CCD z-axis misalignment handling
- Added phase retrieval module with random seed support (Closes #91)
- Added new data generation script to support structured model validation
Bug Fixes
-----------
- Fixed random seed bug in data-driven PSF reinitialization (Closes #132)
Refactors and Internal Architecture
-------------------------------------
- Replaced `TrainingDataHandler` and `TestDataHandler` with unified `DataHandler`
- Refactored `train_utils.py` and `train.py` using the Strategy Pattern (Closes #89, #152)
- Introduced helper functions and modular callbacks
- Added custom loss/metric functions for masked datasets (e.g. for centroid and sample weights)
- Renamed functions, classes, and variables to comply with PEP8 (Closes #139)
- Removed deprecated code and unused imports
Testing and Validation
-------------------------
- Added `test_training/` with unit tests for `train.py` and `train_utils.py`
CI / Tooling Updates
------------------------
- Replaced `black` with `ruff` for code formatting (Closes #119, #120, #145)
- Unpinned `pytest` (Closes #125)
- Increased TensorFlow version to >=2.11.0 (Closes #90)
120 files changed
Lines changed: 14570 additions & 3089 deletions
File tree
- .github/workflows
- config
- data
- generation
- masked_dataset
- src/wf_psf
- data
- metrics
- plotting
- psf_models
- sims
- tests
- data/validation
- main_random_seed/config
- masked_loss
- results
- runs
- control_train
- wf-outputs/wf-outputs-202503131716
- config
- metrics
- optim-hist
- masked_train_masked_test
- wf-outputs/wf-outputs-202503131718
- config
- metrics
- optim-hist
- masked_train_unit_mask_test
- wf-outputs/wf-outputs-202503131720
- config
- metrics
- optim-hist
- unit_masked_train
- wf-outputs/wf-outputs-202503131721
- config
- metrics
- optim-hist
- phase_retrieval
- checkpoint
- config
- metrics
- optim-hist
- psf_model
- test_data
- test_metrics
- test_psf_models
- test_sims
- test_training
- test_utils
- training
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
| 29 | + | |
19 | 30 | | |
20 | 31 | | |
21 | | - | |
22 | | - | |
| 32 | + | |
| 33 | + | |
23 | 34 | | |
24 | 35 | | |
25 | | - | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | | - | |
| 39 | + | |
29 | 40 | | |
30 | 41 | | |
31 | | - | |
| 42 | + | |
32 | 43 | | |
33 | 44 | | |
34 | | - | |
| 45 | + | |
35 | 46 | | |
36 | 47 | | |
37 | | - | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
41 | 55 | | |
42 | 56 | | |
43 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
44 | 83 | | |
45 | 84 | | |
46 | 85 | | |
| |||
55 | 94 | | |
56 | 95 | | |
57 | 96 | | |
58 | | - | |
| 97 | + | |
59 | 98 | | |
60 | 99 | | |
61 | | - | |
| 100 | + | |
62 | 101 | | |
63 | 102 | | |
64 | | - | |
| 103 | + | |
65 | 104 | | |
66 | 105 | | |
67 | 106 | | |
68 | 107 | | |
69 | 108 | | |
70 | 109 | | |
71 | 110 | | |
72 | | - | |
| 111 | + | |
73 | 112 | | |
74 | 113 | | |
75 | | - | |
| 114 | + | |
76 | 115 | | |
77 | 116 | | |
78 | | - | |
| 117 | + | |
79 | 118 | | |
80 | 119 | | |
81 | 120 | | |
82 | 121 | | |
83 | | - | |
| 122 | + | |
84 | 123 | | |
85 | 124 | | |
86 | 125 | | |
87 | 126 | | |
88 | 127 | | |
89 | | - | |
| 128 | + | |
90 | 129 | | |
91 | 130 | | |
92 | | - | |
| 131 | + | |
93 | 132 | | |
94 | 133 | | |
95 | | - | |
| 134 | + | |
96 | 135 | | |
97 | 136 | | |
98 | | - | |
| 137 | + | |
99 | 138 | | |
100 | 139 | | |
101 | 140 | | |
102 | 141 | | |
103 | 142 | | |
104 | 143 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
108 | 147 | | |
109 | 148 | | |
110 | 149 | | |
111 | 150 | | |
112 | 151 | | |
113 | 152 | | |
114 | 153 | | |
115 | | - | |
| 154 | + | |
116 | 155 | | |
117 | 156 | | |
118 | 157 | | |
119 | | - | |
| 158 | + | |
120 | 159 | | |
121 | 160 | | |
122 | 161 | | |
| |||
0 commit comments