dkist-processing-visp 4.0.0__py3-none-any.whl → 5.0.0__py3-none-any.whl

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 (32) hide show
  1. dkist_processing_visp/models/constants.py +50 -9
  2. dkist_processing_visp/models/fits_access.py +5 -1
  3. dkist_processing_visp/models/metric_code.py +10 -0
  4. dkist_processing_visp/models/parameters.py +128 -19
  5. dkist_processing_visp/parsers/spectrograph_configuration.py +75 -0
  6. dkist_processing_visp/parsers/visp_l0_fits_access.py +6 -0
  7. dkist_processing_visp/tasks/geometric.py +115 -7
  8. dkist_processing_visp/tasks/l1_output_data.py +202 -0
  9. dkist_processing_visp/tasks/lamp.py +50 -91
  10. dkist_processing_visp/tasks/parse.py +19 -0
  11. dkist_processing_visp/tasks/science.py +14 -14
  12. dkist_processing_visp/tasks/solar.py +894 -451
  13. dkist_processing_visp/tasks/visp_base.py +1 -0
  14. dkist_processing_visp/tests/conftest.py +98 -35
  15. dkist_processing_visp/tests/header_models.py +71 -20
  16. dkist_processing_visp/tests/local_trial_workflows/local_trial_helpers.py +25 -1
  17. dkist_processing_visp/tests/test_assemble_quality.py +89 -4
  18. dkist_processing_visp/tests/test_geometric.py +40 -0
  19. dkist_processing_visp/tests/test_instrument_polarization.py +2 -1
  20. dkist_processing_visp/tests/test_lamp.py +17 -22
  21. dkist_processing_visp/tests/test_parameters.py +120 -18
  22. dkist_processing_visp/tests/test_parse.py +73 -1
  23. dkist_processing_visp/tests/test_science.py +5 -6
  24. dkist_processing_visp/tests/test_solar.py +319 -102
  25. dkist_processing_visp/tests/test_visp_constants.py +35 -6
  26. {dkist_processing_visp-4.0.0.dist-info → dkist_processing_visp-5.0.0.dist-info}/METADATA +40 -37
  27. {dkist_processing_visp-4.0.0.dist-info → dkist_processing_visp-5.0.0.dist-info}/RECORD +31 -30
  28. docs/conf.py +4 -1
  29. docs/gain_correction.rst +50 -42
  30. dkist_processing_visp/tasks/mixin/line_zones.py +0 -116
  31. {dkist_processing_visp-4.0.0.dist-info → dkist_processing_visp-5.0.0.dist-info}/WHEEL +0 -0
  32. {dkist_processing_visp-4.0.0.dist-info → dkist_processing_visp-5.0.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dkist-processing-visp
3
- Version: 4.0.0
3
+ Version: 5.0.0
4
4
  Summary: Science processing code for the ViSP instrument on DKIST
5
5
  Author-email: NSO / AURA <dkistdc@nso.edu>
6
6
  License: BSD-3-Clause
@@ -13,13 +13,14 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Requires-Python: >=3.12
15
15
  Description-Content-Type: text/x-rst
16
- Requires-Dist: dkist-processing-common==11.8.0
16
+ Requires-Dist: dkist-processing-common==11.8.1
17
17
  Requires-Dist: dkist-processing-math==2.2.1
18
18
  Requires-Dist: dkist-processing-pac==3.1.1
19
19
  Requires-Dist: dkist-header-validator==5.2.1
20
20
  Requires-Dist: dkist-fits-specifications==4.17.0
21
21
  Requires-Dist: dkist-service-configuration==4.1.7
22
22
  Requires-Dist: dkist-spectral-lines==3.0.0
23
+ Requires-Dist: solar-wavelength-calibration==2.0.0
23
24
  Requires-Dist: astropy==7.0.2
24
25
  Requires-Dist: numpy==2.2.5
25
26
  Requires-Dist: sunpy==6.1.1
@@ -94,44 +95,44 @@ Requires-Dist: aiohappyeyeballs==2.6.1; extra == "frozen"
94
95
  Requires-Dist: aiohttp==3.13.2; extra == "frozen"
95
96
  Requires-Dist: aiosignal==1.4.0; extra == "frozen"
96
97
  Requires-Dist: aiosmtplib==5.0.0; extra == "frozen"
97
- Requires-Dist: alembic==1.17.1; extra == "frozen"
98
+ Requires-Dist: alembic==1.17.2; extra == "frozen"
98
99
  Requires-Dist: amqp==5.3.1; extra == "frozen"
99
100
  Requires-Dist: annotated-types==0.7.0; extra == "frozen"
100
- Requires-Dist: anyio==4.11.0; extra == "frozen"
101
+ Requires-Dist: anyio==4.12.0; extra == "frozen"
101
102
  Requires-Dist: apache-airflow==2.11.0; extra == "frozen"
102
- Requires-Dist: apache-airflow-providers-celery==3.10.0; extra == "frozen"
103
- Requires-Dist: apache-airflow-providers-common-compat==1.8.0; extra == "frozen"
104
- Requires-Dist: apache-airflow-providers-common-io==1.6.4; extra == "frozen"
105
- Requires-Dist: apache-airflow-providers-common-sql==1.28.2; extra == "frozen"
103
+ Requires-Dist: apache-airflow-providers-celery==3.13.1; extra == "frozen"
104
+ Requires-Dist: apache-airflow-providers-common-compat==1.10.0; extra == "frozen"
105
+ Requires-Dist: apache-airflow-providers-common-io==1.7.0; extra == "frozen"
106
+ Requires-Dist: apache-airflow-providers-common-sql==1.29.0; extra == "frozen"
106
107
  Requires-Dist: apache-airflow-providers-fab==1.5.3; extra == "frozen"
107
- Requires-Dist: apache-airflow-providers-ftp==3.13.2; extra == "frozen"
108
- Requires-Dist: apache-airflow-providers-http==5.4.0; extra == "frozen"
109
- Requires-Dist: apache-airflow-providers-imap==3.9.3; extra == "frozen"
110
- Requires-Dist: apache-airflow-providers-postgres==6.4.0; extra == "frozen"
111
- Requires-Dist: apache-airflow-providers-smtp==2.3.1; extra == "frozen"
112
- Requires-Dist: apache-airflow-providers-sqlite==4.1.2; extra == "frozen"
113
- Requires-Dist: apispec==6.8.4; extra == "frozen"
108
+ Requires-Dist: apache-airflow-providers-ftp==3.14.0; extra == "frozen"
109
+ Requires-Dist: apache-airflow-providers-http==5.6.0; extra == "frozen"
110
+ Requires-Dist: apache-airflow-providers-imap==3.10.0; extra == "frozen"
111
+ Requires-Dist: apache-airflow-providers-postgres==6.5.0; extra == "frozen"
112
+ Requires-Dist: apache-airflow-providers-smtp==2.4.0; extra == "frozen"
113
+ Requires-Dist: apache-airflow-providers-sqlite==4.2.0; extra == "frozen"
114
+ Requires-Dist: apispec==6.9.0; extra == "frozen"
114
115
  Requires-Dist: argcomplete==3.6.3; extra == "frozen"
115
116
  Requires-Dist: asdf==3.5.0; extra == "frozen"
116
117
  Requires-Dist: asdf_standard==1.4.0; extra == "frozen"
117
118
  Requires-Dist: asdf_transform_schemas==0.6.0; extra == "frozen"
118
- Requires-Dist: asgiref==3.10.0; extra == "frozen"
119
+ Requires-Dist: asgiref==3.11.0; extra == "frozen"
119
120
  Requires-Dist: asteval==1.0.7; extra == "frozen"
120
121
  Requires-Dist: astropy==7.0.2; extra == "frozen"
121
- Requires-Dist: astropy-iers-data==0.2025.11.10.0.38.31; extra == "frozen"
122
- Requires-Dist: asyncpg==0.30.0; extra == "frozen"
122
+ Requires-Dist: astropy-iers-data==0.2025.12.1.0.45.12; extra == "frozen"
123
+ Requires-Dist: asyncpg==0.31.0; extra == "frozen"
123
124
  Requires-Dist: attrs==25.4.0; extra == "frozen"
124
125
  Requires-Dist: babel==2.17.0; extra == "frozen"
125
- Requires-Dist: billiard==4.2.2; extra == "frozen"
126
+ Requires-Dist: billiard==4.2.4; extra == "frozen"
126
127
  Requires-Dist: blinker==1.9.0; extra == "frozen"
127
- Requires-Dist: boto3==1.40.71; extra == "frozen"
128
- Requires-Dist: botocore==1.40.71; extra == "frozen"
128
+ Requires-Dist: boto3==1.42.1; extra == "frozen"
129
+ Requires-Dist: botocore==1.42.1; extra == "frozen"
129
130
  Requires-Dist: cachelib==0.13.0; extra == "frozen"
130
- Requires-Dist: celery==5.3.1; extra == "frozen"
131
+ Requires-Dist: celery==5.6.0; extra == "frozen"
131
132
  Requires-Dist: certifi==2025.11.12; extra == "frozen"
132
133
  Requires-Dist: cffi==2.0.0; extra == "frozen"
133
134
  Requires-Dist: charset-normalizer==3.4.4; extra == "frozen"
134
- Requires-Dist: click==8.3.0; extra == "frozen"
135
+ Requires-Dist: click==8.3.1; extra == "frozen"
135
136
  Requires-Dist: click-didyoumean==0.3.1; extra == "frozen"
136
137
  Requires-Dist: click-plugins==1.1.1.2; extra == "frozen"
137
138
  Requires-Dist: click-repl==0.3.0; extra == "frozen"
@@ -148,25 +149,27 @@ Requires-Dist: dacite==1.9.2; extra == "frozen"
148
149
  Requires-Dist: decorator==5.2.1; extra == "frozen"
149
150
  Requires-Dist: dill==0.4.0; extra == "frozen"
150
151
  Requires-Dist: dkist-header-validator==5.2.1; extra == "frozen"
151
- Requires-Dist: dkist-processing-common==11.8.0; extra == "frozen"
152
+ Requires-Dist: dkist-processing-common==11.8.1; extra == "frozen"
152
153
  Requires-Dist: dkist-processing-core==6.0.0; extra == "frozen"
153
154
  Requires-Dist: dkist-processing-math==2.2.1; extra == "frozen"
154
155
  Requires-Dist: dkist-processing-pac==3.1.1; extra == "frozen"
155
- Requires-Dist: dkist-processing-visp==4.0.0; extra == "frozen"
156
+ Requires-Dist: dkist-processing-visp==5.0.0; extra == "frozen"
156
157
  Requires-Dist: dkist-service-configuration==4.1.7; extra == "frozen"
157
158
  Requires-Dist: dkist-spectral-lines==3.0.0; extra == "frozen"
158
159
  Requires-Dist: dkist_fits_specifications==4.17.0; extra == "frozen"
159
160
  Requires-Dist: dnspython==2.8.0; extra == "frozen"
160
161
  Requires-Dist: email-validator==2.3.0; extra == "frozen"
162
+ Requires-Dist: exceptiongroup==1.3.1; extra == "frozen"
161
163
  Requires-Dist: fastjsonschema==2.21.2; extra == "frozen"
162
164
  Requires-Dist: flower==2.0.1; extra == "frozen"
163
- Requires-Dist: fonttools==4.60.1; extra == "frozen"
165
+ Requires-Dist: fonttools==4.61.0; extra == "frozen"
164
166
  Requires-Dist: frozenlist==1.8.0; extra == "frozen"
165
167
  Requires-Dist: fsspec==2025.10.0; extra == "frozen"
166
168
  Requires-Dist: globus-sdk==3.65.0; extra == "frozen"
167
169
  Requires-Dist: google-re2==1.1.20251105; extra == "frozen"
168
170
  Requires-Dist: googleapis-common-protos==1.72.0; extra == "frozen"
169
171
  Requires-Dist: gqlclient==1.2.3; extra == "frozen"
172
+ Requires-Dist: greenlet==3.2.4; extra == "frozen"
170
173
  Requires-Dist: grpcio==1.76.0; extra == "frozen"
171
174
  Requires-Dist: gunicorn==23.0.0; extra == "frozen"
172
175
  Requires-Dist: h11==0.16.0; extra == "frozen"
@@ -184,7 +187,7 @@ Requires-Dist: jsonschema==4.25.1; extra == "frozen"
184
187
  Requires-Dist: jsonschema-specifications==2025.9.1; extra == "frozen"
185
188
  Requires-Dist: jupyter_core==5.9.1; extra == "frozen"
186
189
  Requires-Dist: kiwisolver==1.4.9; extra == "frozen"
187
- Requires-Dist: kombu==5.6.0; extra == "frozen"
190
+ Requires-Dist: kombu==5.6.1; extra == "frozen"
188
191
  Requires-Dist: lazy-object-proxy==1.12.0; extra == "frozen"
189
192
  Requires-Dist: lazy_loader==0.4; extra == "frozen"
190
193
  Requires-Dist: limits==5.6.0; extra == "frozen"
@@ -204,7 +207,7 @@ Requires-Dist: more-itertools==10.8.0; extra == "frozen"
204
207
  Requires-Dist: moviepy==2.1.2; extra == "frozen"
205
208
  Requires-Dist: multidict==6.7.0; extra == "frozen"
206
209
  Requires-Dist: nbformat==5.10.4; extra == "frozen"
207
- Requires-Dist: networkx==3.5; extra == "frozen"
210
+ Requires-Dist: networkx==3.6; extra == "frozen"
208
211
  Requires-Dist: numpy==2.2.5; extra == "frozen"
209
212
  Requires-Dist: object-clerk==1.0.0; extra == "frozen"
210
213
  Requires-Dist: opentelemetry-api==1.38.0; extra == "frozen"
@@ -249,11 +252,11 @@ Requires-Dist: proglog==0.1.12; extra == "frozen"
249
252
  Requires-Dist: prometheus_client==0.23.1; extra == "frozen"
250
253
  Requires-Dist: prompt_toolkit==3.0.52; extra == "frozen"
251
254
  Requires-Dist: propcache==0.4.1; extra == "frozen"
252
- Requires-Dist: protobuf==6.33.0; extra == "frozen"
255
+ Requires-Dist: protobuf==6.33.1; extra == "frozen"
253
256
  Requires-Dist: psutil==7.1.3; extra == "frozen"
254
257
  Requires-Dist: psycopg2-binary==2.9.11; extra == "frozen"
255
258
  Requires-Dist: pycparser==2.23; extra == "frozen"
256
- Requires-Dist: pydantic==2.12.4; extra == "frozen"
259
+ Requires-Dist: pydantic==2.12.5; extra == "frozen"
257
260
  Requires-Dist: pydantic-settings==2.12.0; extra == "frozen"
258
261
  Requires-Dist: pydantic_core==2.41.5; extra == "frozen"
259
262
  Requires-Dist: pyerfa==2.0.1.5; extra == "frozen"
@@ -271,18 +274,17 @@ Requires-Dist: requests-toolbelt==1.0.0; extra == "frozen"
271
274
  Requires-Dist: rfc3339-validator==0.1.4; extra == "frozen"
272
275
  Requires-Dist: rich==13.9.4; extra == "frozen"
273
276
  Requires-Dist: rich-argparse==1.7.2; extra == "frozen"
274
- Requires-Dist: rpds-py==0.28.0; extra == "frozen"
275
- Requires-Dist: s3transfer==0.14.0; extra == "frozen"
277
+ Requires-Dist: rpds-py==0.30.0; extra == "frozen"
278
+ Requires-Dist: s3transfer==0.16.0; extra == "frozen"
276
279
  Requires-Dist: scikit-image==0.25.2; extra == "frozen"
277
280
  Requires-Dist: scikit-learn==1.6.1; extra == "frozen"
278
281
  Requires-Dist: scipy==1.15.3; extra == "frozen"
279
282
  Requires-Dist: semantic-version==2.10.0; extra == "frozen"
280
283
  Requires-Dist: setproctitle==1.3.7; extra == "frozen"
281
284
  Requires-Dist: six==1.17.0; extra == "frozen"
282
- Requires-Dist: sniffio==1.3.1; extra == "frozen"
283
- Requires-Dist: solar-wavelength-calibration==1.0.1; extra == "frozen"
285
+ Requires-Dist: solar-wavelength-calibration==2.0.0; extra == "frozen"
284
286
  Requires-Dist: sqids==0.5.1; extra == "frozen"
285
- Requires-Dist: sqlparse==0.5.3; extra == "frozen"
287
+ Requires-Dist: sqlparse==0.5.4; extra == "frozen"
286
288
  Requires-Dist: sunpy==6.1.1; extra == "frozen"
287
289
  Requires-Dist: tabulate==0.9.0; extra == "frozen"
288
290
  Requires-Dist: talus==1.3.4; extra == "frozen"
@@ -297,16 +299,17 @@ Requires-Dist: traitlets==5.14.3; extra == "frozen"
297
299
  Requires-Dist: typing-inspection==0.4.2; extra == "frozen"
298
300
  Requires-Dist: typing_extensions==4.15.0; extra == "frozen"
299
301
  Requires-Dist: tzdata==2025.2; extra == "frozen"
302
+ Requires-Dist: tzlocal==5.3.1; extra == "frozen"
300
303
  Requires-Dist: uc-micro-py==1.0.3; extra == "frozen"
301
304
  Requires-Dist: uncertainties==3.2.3; extra == "frozen"
302
- Requires-Dist: universal_pathlib==0.3.5; extra == "frozen"
305
+ Requires-Dist: universal_pathlib==0.3.6; extra == "frozen"
303
306
  Requires-Dist: urllib3==2.5.0; extra == "frozen"
304
307
  Requires-Dist: vine==5.1.0; extra == "frozen"
305
308
  Requires-Dist: voluptuous==0.15.2; extra == "frozen"
306
309
  Requires-Dist: wcwidth==0.2.14; extra == "frozen"
307
310
  Requires-Dist: wirerope==1.0.0; extra == "frozen"
308
311
  Requires-Dist: wrapt==1.17.3; extra == "frozen"
309
- Requires-Dist: yamale==6.0.0; extra == "frozen"
312
+ Requires-Dist: yamale==6.1.0; extra == "frozen"
310
313
  Requires-Dist: yarl==1.22.0; extra == "frozen"
311
314
  Requires-Dist: zipp==3.23.0; extra == "frozen"
312
315
 
@@ -3,9 +3,10 @@ dkist_processing_visp/__init__.py,sha256=LC8o31oTIro4F7IgwoWalX1W3KcPU27yJhlDUeG
3
3
  dkist_processing_visp/config.py,sha256=GMr0CreW4qavbueTtsH_Gx5P52v4yZd2PNKyPmxBKQE,478
4
4
  dkist_processing_visp/fonts/Lato-Regular.ttf,sha256=1jbkaDIx-THtoiLViOlE0IK_0726AvkovuRhwPGFslE,656568
5
5
  dkist_processing_visp/models/__init__.py,sha256=z2nFVvvIzirxklQ9i5-F1nR-WOgcDttYtog_jx4yN5I,12
6
- dkist_processing_visp/models/constants.py,sha256=sizf2PB3H8BVughHsJhh_fJUeNkN-0uHpo-DVy1_wdo,5140
7
- dkist_processing_visp/models/fits_access.py,sha256=-W5hP5U9n4uMCg2A_CSJuM3L6dipktZIjoUxyQfT0O8,435
8
- dkist_processing_visp/models/parameters.py,sha256=m5o41KsPO99WUgWlY4-ezu4wqvQVMGpQ3fNuMcFkSu0,9831
6
+ dkist_processing_visp/models/constants.py,sha256=TP9ZefMdJxu-JWePICMZ6riC4bH1Mz4NJY0hAcWAPQ0,6749
7
+ dkist_processing_visp/models/fits_access.py,sha256=8uKaUgtapyED-WgJCeswrIqEGy4Ob6ekBmiyBqF6yIE,573
8
+ dkist_processing_visp/models/metric_code.py,sha256=L_VJ-l5RXsYgcEIOO6hsez1a5oL5FqTnoVKZ0z7NKng,266
9
+ dkist_processing_visp/models/parameters.py,sha256=ynPzU9Clv15tuI_h7OFH4bgngeGP-WJ0I3814lnaKMw,15070
9
10
  dkist_processing_visp/models/tags.py,sha256=RKtDlNA9O3LMinUP7BJ3tXWn6CWAARaKhXIVB1EHtg0,3055
10
11
  dkist_processing_visp/models/task_name.py,sha256=ykLXcmCBWYguopdBlg_G0X_u-0o_Ugh2117XrCqdbFk,187
11
12
  dkist_processing_visp/parsers/__init__.py,sha256=z2nFVvvIzirxklQ9i5-F1nR-WOgcDttYtog_jx4yN5I,12
@@ -13,51 +14,51 @@ dkist_processing_visp/parsers/map_repeats.py,sha256=YuO1VROQLuE-Hn9hSzityjNhIDe-
13
14
  dkist_processing_visp/parsers/modulator_states.py,sha256=dHAZZaG3i_UUT5FjTg1oJdCBiOKCqkrx1jiQnzp2t2o,3006
14
15
  dkist_processing_visp/parsers/polarimeter_mode.py,sha256=vOE8IYlBrgAFGSrDbpUDfHnI3OTPBDpd3U_j5totZb8,625
15
16
  dkist_processing_visp/parsers/raster_step.py,sha256=tCmXPhG99z54YVX3X-kLOGDKJRTDJHnDbjNev4An7Pg,3142
17
+ dkist_processing_visp/parsers/spectrograph_configuration.py,sha256=YpMX1NhE7xySx6XB3-0etfzfT_oSiGDphNnxhaW_C3c,3203
16
18
  dkist_processing_visp/parsers/time.py,sha256=uudQ5manYdL7SgxqABfFPDzW2iTNrTYF0klqCRsP0CI,4812
17
- dkist_processing_visp/parsers/visp_l0_fits_access.py,sha256=vZGLGQNofRFziTSBOTf4_digLlOdRRGeFEvrAQouXTI,1609
19
+ dkist_processing_visp/parsers/visp_l0_fits_access.py,sha256=WDAgMp_70AKmzxGqboKA3McSGgF_mvgsGiihYmK1Nus,1973
18
20
  dkist_processing_visp/parsers/visp_l1_fits_access.py,sha256=1MrFfsJjT_7fd1cj8tFr5rHX2JdRSrlwiMCzu-Q8ejY,860
19
21
  dkist_processing_visp/tasks/__init__.py,sha256=qlPlahiM9_sCsaIj_wzQpzWkMITJ1dPdT93iV9q-fgg,713
20
22
  dkist_processing_visp/tasks/assemble_movie.py,sha256=8UujniXlV_sSGeuISud8wMHihLy6Gc5fKZpwkXLUQB8,3330
21
23
  dkist_processing_visp/tasks/background_light.py,sha256=qQ3r1LR5qaOz2qNHnO5_QK8l1zbVP0GaCS3aLqJfNYY,16201
22
24
  dkist_processing_visp/tasks/dark.py,sha256=VVitrat08U7e5L1-NVnNNJI_KIx791_DvKEJokvCqXE,4334
23
- dkist_processing_visp/tasks/geometric.py,sha256=rvWa13T2_cPQtiMjlWrqMYS5UvL8XgmiffmrYp5fyc4,44603
25
+ dkist_processing_visp/tasks/geometric.py,sha256=EOkgFdkywc8NKDwMSbtRzjS6jX6T32M7bb8fardcefk,48600
24
26
  dkist_processing_visp/tasks/instrument_polarization.py,sha256=uj7iyzM3CiJcbQeF4eKpk_KCoheXaM4FpDI83GYDld4,25854
25
- dkist_processing_visp/tasks/l1_output_data.py,sha256=lon6bIUBvURV_7gn1HFGAGVuEiLoOiMaJwfbdhSRW3w,459
26
- dkist_processing_visp/tasks/lamp.py,sha256=RciNB8zW5fDx5yrsaNZgFP7LsajmSvkTNvbe3Sm6tjc,6060
27
+ dkist_processing_visp/tasks/l1_output_data.py,sha256=vl_c52noozeu4N-BbfpsIHFc5q6JATQ9r4iLa3MDtDI,8347
28
+ dkist_processing_visp/tasks/lamp.py,sha256=HTBob-4Am1ps5ucmX8nSzxV3BqX2ytMcHZ5iyDrljq0,5132
27
29
  dkist_processing_visp/tasks/make_movie_frames.py,sha256=fw25ksKiJJNS57XV5a7rHpYGcSkYxS2Qf13Fb1UGNpE,7544
28
- dkist_processing_visp/tasks/parse.py,sha256=3f8LWSKQtuY7n-PdHiw1j55i5l4juBn3pIHqTtp2-rk,6752
30
+ dkist_processing_visp/tasks/parse.py,sha256=Fe_2svvMSKBup--Ulxbu0uaNW3dzPxQreafMEw0CY6E,7897
29
31
  dkist_processing_visp/tasks/quality_metrics.py,sha256=Pw55-PXW0cl39FuNkEQCGGhvI_zMDimwmh-swVPVBD4,8133
30
- dkist_processing_visp/tasks/science.py,sha256=BiEtgDowExHAXXzfO4BSr34BT0PZ28CdtOJMP4TDA20,34680
31
- dkist_processing_visp/tasks/solar.py,sha256=QPkrJqUz6gYxFFvNlATMKa4NIEdn4iassYn86qPb60k,27567
32
- dkist_processing_visp/tasks/visp_base.py,sha256=flUM-dCWkjcGvfaiFWH89DRZXz7NADgShxzpFjFqVEw,1370
32
+ dkist_processing_visp/tasks/science.py,sha256=eQZ5MDJhOD8hhp2huksOkl8Btm8EL15no-LX3o6zBXE,34550
33
+ dkist_processing_visp/tasks/solar.py,sha256=YJFHmpmdV-FSIrjFKMH3eLXZ8KTdZWcZo-_XFf-u9Gs,47624
34
+ dkist_processing_visp/tasks/visp_base.py,sha256=-yC-PVP9AqFeZJshJ_nqZpSyRsZyHWUlugWvkeWkPKA,1412
33
35
  dkist_processing_visp/tasks/write_l1.py,sha256=bsDZ0BwoqpTtS_f_rAzUn7Ra8UvYb-kINQhX6BwwFQw,8796
34
36
  dkist_processing_visp/tasks/mixin/__init__.py,sha256=z2nFVvvIzirxklQ9i5-F1nR-WOgcDttYtog_jx4yN5I,12
35
37
  dkist_processing_visp/tasks/mixin/beam_access.py,sha256=1VSJkH6yMxCiZWdWOp_RJ37fX5ULMYmB_0_ulT7YJpI,870
36
38
  dkist_processing_visp/tasks/mixin/corrections.py,sha256=FhLFgD9ZYLZd3SaC3PFF-szrcs-zmdrUYNDUEK-h7JA,7145
37
39
  dkist_processing_visp/tasks/mixin/downsample.py,sha256=SvKzY6HJRn-FeyG7O6HPvyOS5dmMu6uPoWkfnpPXpVw,1344
38
- dkist_processing_visp/tasks/mixin/line_zones.py,sha256=5jfea9V5RJAi-834z_Y9v4fhlRFJdK1McAqO9X92bZo,4065
39
40
  dkist_processing_visp/tests/README.rst,sha256=rnedwwg25c0lB9Me7cT7QNZA17FYlqCu9ZnjQxR5hi0,12502
40
41
  dkist_processing_visp/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- dkist_processing_visp/tests/conftest.py,sha256=K8j-1K4hUoVyS1cOJiK1WV9qYEmmz7rMuuYOZPyMXh0,16585
42
- dkist_processing_visp/tests/header_models.py,sha256=oP34ybRzoiT6CEK4S9bAgw5Bge1u4Qyj09RISgz2QTs,20020
42
+ dkist_processing_visp/tests/conftest.py,sha256=h5K8OyKFKmV6emjDywrS_ZTeWburIyBnZw_3L8uJmnY,18652
43
+ dkist_processing_visp/tests/header_models.py,sha256=80IZgVsEoGbWOG8kvh7BjC2gHqZq9QSEDcjcmW5B4gA,21126
43
44
  dkist_processing_visp/tests/test_assemble_movie.py,sha256=T5EZzdB3sNY4HcSkN2W1ZBDaI4a68ZUNqPB-JpANSQ0,2247
44
- dkist_processing_visp/tests/test_assemble_quality.py,sha256=Hm0nAW90Kbb-6OLkUsW6Hpv_YAZwKOiG114Ui2PqRUw,1229
45
+ dkist_processing_visp/tests/test_assemble_quality.py,sha256=C5djCoi2aHUCUiaMnyIOB3DVDSCAT1gUx_Q19c_-Q8Q,4280
45
46
  dkist_processing_visp/tests/test_background_light.py,sha256=Zvm8s38qx_ybviEhnKqPI4s36VFBJKtsNrp31-o8lEQ,17553
46
47
  dkist_processing_visp/tests/test_dark.py,sha256=iKp12bHOOKPf7GAB8iKYpZu1AXFaESAW6C0ua1nVFXA,5552
47
48
  dkist_processing_visp/tests/test_downsample.py,sha256=iSmb4PwpZtnVU06tmlko1wwepWueQ3KJ459XYgNIpws,2211
48
49
  dkist_processing_visp/tests/test_fits_access.py,sha256=jOaSHDydzPl48SSBxt3z3CtCzBgCmSCc3rZ92CpoAaY,1822
49
- dkist_processing_visp/tests/test_geometric.py,sha256=60W1Vv16JtQBnsP5CS10sOksXF8NzfoQDvl46C7fT3U,12536
50
- dkist_processing_visp/tests/test_instrument_polarization.py,sha256=AntdpdmKtUJmr0VtooucqaMzXwgPqFgChU88_vFUtBU,11853
51
- dkist_processing_visp/tests/test_lamp.py,sha256=_ibg4ORd_19eORS24zgJZfkOxIdijr1eWKVGHWk-PKY,5212
50
+ dkist_processing_visp/tests/test_geometric.py,sha256=H3oqFPHSPfgJVRZUqD1DIs7DanIVei9-oTsJuiHA4SY,13850
51
+ dkist_processing_visp/tests/test_instrument_polarization.py,sha256=ZsYSyXUKfs0dvTwjzssdoHGiJLgQgkc5tnlfs6q4zOo,11833
52
+ dkist_processing_visp/tests/test_lamp.py,sha256=19mRN8drAg0tqQGwSbSUDlpryqYjMvmfv1DCsttxuXk,5124
52
53
  dkist_processing_visp/tests/test_make_movie_frames.py,sha256=huQ5n0YneHByKumM_Ye9tekqKeh-F-e6MQoudOP3S-g,2628
53
54
  dkist_processing_visp/tests/test_map_repeats.py,sha256=9g3NnvSfn1OqxxYYxTFoOIi1UsCOa6mZjiuGkbxUvTg,7611
54
- dkist_processing_visp/tests/test_parameters.py,sha256=h9EemGJf0b4ma0jLGd321untkhLkhwgo88mIRnSmxXs,4369
55
- dkist_processing_visp/tests/test_parse.py,sha256=aFBbLBXdz2KJZy62gC1KC049FFfRKYqYVo-Y32mx_E4,20853
55
+ dkist_processing_visp/tests/test_parameters.py,sha256=MBSddKsFmRC4zDZEgpA3y3_sRKriETiPEIhcVoSchTo,8053
56
+ dkist_processing_visp/tests/test_parse.py,sha256=XyH8oCk5C0CWl4ndNIyVjgXLoMg0679s4dj1MGlJs0c,23363
56
57
  dkist_processing_visp/tests/test_quality.py,sha256=YW24VjEHoILseFIXZBp4-o7egT26mfT1lafzajVjXu8,6905
57
- dkist_processing_visp/tests/test_science.py,sha256=rIoHu1hifNYj1niQaDkmyID5BQVzTEgZ5BhsdZOSaWk,23985
58
- dkist_processing_visp/tests/test_solar.py,sha256=Bpkm59HI0GqrwM8LqIK7GR0pUUW0anboJkePQnofgmA,9471
58
+ dkist_processing_visp/tests/test_science.py,sha256=KpOYvL86xhSnTCOcVDveE-enDxcj_G4IrUw_wa375tI,23893
59
+ dkist_processing_visp/tests/test_solar.py,sha256=xuKeUrnAeTQoWbL6pUTiRr09jw0O4jYL6-MSCmyF_k4,16789
59
60
  dkist_processing_visp/tests/test_trial_create_quality_report.py,sha256=t3de9LMJOqrRaFXAvKV_5sotAfzDR8fZVIrFNRB2I_A,2779
60
- dkist_processing_visp/tests/test_visp_constants.py,sha256=v8meAXdR6jJntaFtWR-N65Z-3ovr9Vf9_-BwAZv2RBc,1974
61
+ dkist_processing_visp/tests/test_visp_constants.py,sha256=y2x42Y-dK2lrCPufLAV1KHpu2fQ-FRpe8tSIhfHJEw8,3134
61
62
  dkist_processing_visp/tests/test_workflows.py,sha256=qyWxagIDv-MmVN0u3KFswa5HdaHC6uGeJpvgxvPE30E,287
62
63
  dkist_processing_visp/tests/test_write_l1.py,sha256=ORNKUvF4RPjXc24HgOzyVsP0BCQ9izi54EqXpjLzHXQ,6574
63
64
  dkist_processing_visp/tests/local_trial_workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -65,7 +66,7 @@ dkist_processing_visp/tests/local_trial_workflows/l0_cals_only.py,sha256=1TmvdAn
65
66
  dkist_processing_visp/tests/local_trial_workflows/l0_polcals_as_science.py,sha256=geU6Q8ULfIq4Jmj6ORq8mgXYlF8SYrvgZP-0u-4Uz24,17567
66
67
  dkist_processing_visp/tests/local_trial_workflows/l0_solar_gain_as_science.py,sha256=cRrLklazesLBHPPbGzVjBXbEQKaCxQfgy1_AgWyZRyo,15820
67
68
  dkist_processing_visp/tests/local_trial_workflows/l0_to_l1.py,sha256=cwEdvUGqqSpp4htrxlmyRN2sZBBvVOjomd66DEqTmTA,15191
68
- dkist_processing_visp/tests/local_trial_workflows/local_trial_helpers.py,sha256=eSOuCn7c2DYATq3twu9Gqj7DrLR902p7b5vGlHZ3zxU,26750
69
+ dkist_processing_visp/tests/local_trial_workflows/local_trial_helpers.py,sha256=UYGDwvCqzyCzyp44T-vys_JdKuMVRVS7bpWG9gvwnSE,28250
69
70
  dkist_processing_visp/workflows/__init__.py,sha256=1-GP9tOzjCxLJtyq0ry_x4dPdArfSso8Hxu65ydPpXQ,103
70
71
  dkist_processing_visp/workflows/l0_processing.py,sha256=VzTjyS-ywhwATN1Hc17B7tdZOwu3Cv3dUv9l5Ux_vqY,3262
71
72
  dkist_processing_visp/workflows/single_task_workflows.py,sha256=LK4dsshM0-lwy79WaMoTplyCxUyINnP9RU74MG_dhyc,33
@@ -73,8 +74,8 @@ dkist_processing_visp/workflows/trial_workflows.py,sha256=O229pmhvYf-R6Jf9aB4cY3
73
74
  docs/Makefile,sha256=qnlVz6PuBqE39NfHWuUnHhNEA-EFgT2-WJNNNy9ttfk,4598
74
75
  docs/background_light.rst,sha256=FWj8KH7H51BtoqPCJ1A_VIWJkjaXD8-dwM9RdY1rkIc,5147
75
76
  docs/changelog.rst,sha256=ZpZPJIyl4nI0Eicku6uSrLdiinNOF2GcZwrvTEsb-Zs,346
76
- docs/conf.py,sha256=6WhsmMvWPzPF_maYpd0hMpmsu-4RZiPDXnceKIfi1VE,2029
77
- docs/gain_correction.rst,sha256=9wODkWWpxJXOcoxyl-tUr3FC7sL8MqNIEGLthqXFbPw,6481
77
+ docs/conf.py,sha256=qgWzWK98wj5QHHnNW52fzjCyfibFM_g1DkjB8m2WMAk,2151
78
+ docs/gain_correction.rst,sha256=rQA51C2ZwUAk1lwCbSUpjs1SjhE2HpT-ik1C5UO9XrU,7148
78
79
  docs/geometric.rst,sha256=VsAWefgJ1j64Uo1TQ-ltAQ6INgsdS7-_FSvOtm0i17s,7301
79
80
  docs/index.rst,sha256=pl8VhwISd-kb1IQi2h7gOySfOhQQl2C71pjTatShGNI,319
80
81
  docs/l0_to_l1_visp.rst,sha256=wE1TT7DD93r3kByaFAaT2HO907pjV4YrJ_fzvJFTchw,623
@@ -87,7 +88,7 @@ docs/requirements_table.rst,sha256=_HIbwFpDooM5n0JjiDAbFozGfJuX13smtcoujLFN4Gk,2
87
88
  docs/science_calibration.rst,sha256=VN_g7xSjN-nbXhlBaFnPCbNcsc_Qu0207jEUfRAjnBE,2939
88
89
  docs/scientific_changelog.rst,sha256=01AWBSHg8zElnodCgAq-hMxhk9CkX5rtEENx4iz0sjI,300
89
90
  licenses/LICENSE.rst,sha256=piZaQplkzOMmH1NXg6QIdo9wwo9pPCoHkvm2-DmH76E,1462
90
- dkist_processing_visp-4.0.0.dist-info/METADATA,sha256=4S8qtlI-Cp12PpvTDgD0ZgSA2ZaaOp0QnHtC94RZ4Ak,29073
91
- dkist_processing_visp-4.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
92
- dkist_processing_visp-4.0.0.dist-info/top_level.txt,sha256=9GHSn-ZMGQxaRNGrPP3HNc5ZkE7ftzluO74Jz5vUSTE,46
93
- dkist_processing_visp-4.0.0.dist-info/RECORD,,
91
+ dkist_processing_visp-5.0.0.dist-info/METADATA,sha256=nTAiUZTz8aDnkaabIxiFL4cJ18_ZOSdp60apcgBvC3I,29229
92
+ dkist_processing_visp-5.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
93
+ dkist_processing_visp-5.0.0.dist-info/top_level.txt,sha256=9GHSn-ZMGQxaRNGrPP3HNc5ZkE7ftzluO74Jz5vUSTE,46
94
+ dkist_processing_visp-5.0.0.dist-info/RECORD,,
docs/conf.py CHANGED
@@ -33,7 +33,10 @@ autoapi_dirs = [Path(package.__file__).parent]
33
33
  # autoapi_keep_files = True
34
34
 
35
35
  # -- Options for intersphinx extension -----------------------------------------
36
- intersphinx_mapping = create_intersphinx_mapping(repo_name)
36
+ intersphinx_mapping = create_intersphinx_mapping(repo_name) | {
37
+ "lmfit": ("https://lmfit.github.io/lmfit-py", None),
38
+ "sklearn": ("https://scikit-learn.org/stable/", None),
39
+ }
37
40
  # Remaining sphinx settings are in dkist-sphinx-theme conf.py
38
41
 
39
42
  # -- Project information -------------------------------------------------------
docs/gain_correction.rst CHANGED
@@ -4,8 +4,8 @@ Gain Calibration
4
4
  Introduction
5
5
  ------------
6
6
 
7
- NOTE: The usage of the term "gain" throughout this document refers to total system response of the DKIST/ViSP optical
8
- train; it does NOT refer to the detector gain that has units of ADU / electron. Sometimes the term "flat" is used in
7
+ NOTE: The usage of the term "gain" throughout this document refers to the total system response of the DKIST/ViSP optical
8
+ train; it does NOT refer to the detector gain that has units of ADU / electron. Often the term "flat" is used in
9
9
  a way that is interchangeable with the usage of "gain" in this document.
10
10
 
11
11
  The ViSP gain calibration is broken down into the following steps across two pipeline tasks
@@ -13,20 +13,21 @@ The ViSP gain calibration is broken down into the following steps across two pip
13
13
 
14
14
  #. Subtract dark and :doc:`background <background_light>` signals from all input gain images.
15
15
 
16
- #. Compute an average, equalized lamp gain and mask the hairlines.
16
+ #. Compute an average lamp gain and mask the hairlines.
17
17
 
18
- #. Divide the solar gain by the resulting lamp image and correct for :doc:`geometric </geometric>` rotation/shifts and
18
+ #. Divide the solar gain by the resulting lamp image and correct for :doc:`geometric </geometric>` rotation and
19
19
  spectral curvature.
20
20
 
21
- #. Mask hairlines and compute 2D characteristic solar spectra with spatial median filter.
21
+ #. Separate the true solar spectrum from vignetting effects by fitting a solar atlas to the solar gain data.
22
22
 
23
- #. Re-curve/shift/rotate the characteristic spectra into the same coordinates as the input frames.
23
+ #. Mask hairlines and compute a 2D characteristic solar spectra with a spatial median filter over the vignette-corrected solar gain data.
24
+
25
+ #. Re-curve and rotate the characteristic spectra into the same coordinates as the input frames.
24
26
 
25
27
  #. Remove the characteristic spectra from solar gain images that have NOT had a lamp correction applied.
26
28
 
27
- The result is a final gain image that can be applied to science data. Note that all steps happen separately for every
28
- modulator state and beam. This is because the geometric x/y shifts have been found to be significantly different for each
29
- modulator state and beam.
29
+ The result is a final gain image that can be applied to science data. Note that all steps happen separately for each
30
+ beam to capture the differences in optical response between the two beams.
30
31
 
31
32
  Important Features
32
33
  ------------------
@@ -49,40 +50,53 @@ from all input frames.
49
50
  Average Lamp Frames and Mask Hairlines
50
51
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51
52
 
52
- All lamp frames for a particular modulator state and beam are averaged into a single array. The slit hairlines are then
53
- identified by smoothing the image in the spatial dimension and then computing the relative difference between this smoothed
54
- image and the original image. Any pixels that deviate by a large amount (set by the ``hairline_fraction`` parameter) are
55
- considered to be hairline pixels. These hairline pixels are masked by replacing them with values from the smoothed array.
56
-
57
- Lamp gains for all modulator states are then compared and equalized so each individual modulator state has the same
58
- median as the median of all (pre-equalized) modulator states. This step helps to mitigate any residual polarization that
59
- may exist in input gain images that would otherwise affect the residual continuum polarization in the processed
60
- science frames.
61
-
62
- Finally, all lamp gain images have any spatial intensity gradients removed by normalizing each spatial position by its
63
- median. This removes known gradients caused by the different input illumination of the lamp compared to the Sun.
53
+ All lamp frames for a single beam are averaged into a single array. The slit hairlines are then identified by smoothing
54
+ the image in the spatial dimension and then computing the relative difference between this smoothed image and the
55
+ original image. Any pixels that deviate by a large amount (set by the ``hairline_fraction`` parameter) are considered to
56
+ be hairline pixels. These hairline pixels are masked by replacing them with values from the smoothed array.
64
57
 
65
58
  Prepare and Rectify Solar Frames
66
59
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67
60
 
68
- The averaged modulated lamp frames from the previous step are applied to dark/background subtracted solar gain frames through
69
- division. Then the pre-computed :doc:`geometric </geometric>` correction removes any spectral rotation, x/y shifts, and
70
- spectral curvature (in that order). At the end of this step the dispersion axis will be parallel to a pixel axis and a
71
- single spectral pixel will have the same physical wavelength value for all spatial pixels.
61
+ The averaged lamp frames from the previous step are applied to dark/background subtracted solar gain frames through
62
+ division. Then the pre-computed :doc:`geometric </geometric>` correction removes any spectral rotation and spectral
63
+ curvature (in that order). Note that at this point we do NOT correct for X/Y offsets for two reasons: 1). a separate gain
64
+ is computed for each beam so applying the beam offsets is not necessary, and 2). it has been found that the
65
+ modstate-to-modstate offsets are small enough to ignore when making gain frames. At the end of this step the dispersion
66
+ axis will be parallel to a pixel axis and a single spectral pixel will have the same physical wavelength value for all
67
+ spatial pixels.
68
+
69
+ Separate Solar and Vignette Signals
70
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
+
72
+ Aperture masks in ViSP cause known vignetting in both the spatial and spectral dimensions and we need to capture this
73
+ vignetting in our final gain images so it can be correctly removed from science data. To separate the spectral vignette
74
+ signature from the true solar spectrum we fit a representative spectrum to a solar atlas with a parameterized continuum.
75
+ The representative spectrum is a spatial median of the rectified solar gain array, and the continuum is parameterized as
76
+ a polynomial with an order set by the ``solar_vignette_initial_continuum_poly_fit_order`` parameter. Atlas fits are
77
+ done with the `solar-wavelength-calibration <https://docs.dkist.nso.edu/projects/solar-wavelength-calibration/en/latest/>`_
78
+ package. We take the fit continuum as a first estimate of the vignette signal in the spectral dimension.
79
+
80
+ This first vignette estimate is then removed from the representative spectrum, thus producing an estimate of the true
81
+ solar signal, and that spectrum is divided from every spatial pixel of the gain array. The residuals capture how the
82
+ vignette signal varies with spatial and spectral position across the chip. We fit these residuals for each spatial pixel
83
+ to compute a fully 2D estimate of the true vignette signal. The order of this polynomial fit is set by the
84
+ ``solar_vignette_spectral_poly_fit_order`` parameter.
72
85
 
73
86
  Compute Characteristic Spectra
74
87
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
88
 
76
- First, the slit hairlines are masked using the same method as :ref:`above <hairline-description>`.
89
+ First, the 2D vignette signal is divided from the solar gain array and the slit hairlines are masked using the same
90
+ method as :ref:`above <hairline-description>`.
77
91
 
78
92
  The goal of this step is to derive pure solar spectra, free from any optical effects of the DKIST/ViSP system. By applying
79
- lamp gain frames to our solar images we have already removed a lot of optical effects, but some spatial variations still
80
- remain. Thus, the characteristic spectra is computed by applying a median filter (with width controlled by the
81
- ``solar_spectral_avg_window`` parameter) in the spatial direction. Previously, a single, median spectrum had been used,
82
- but it did not accurately capture small, but important variations in spectral shape along the slit.
93
+ lamp gain and vignette corrections to our solar images we have already removed a lot of optical effects, but some spatial
94
+ variations still remain. Thus, the characteristic spectra is computed by applying a median filter (with width controlled
95
+ by the ``solar_spatial_median_filter_width_px`` parameter) in the spatial direction. Previously, a single, median spectrum had been
96
+ used, but it did not accurately capture small, but important variations in spectral shape along the slit.
83
97
 
84
- Finally, the smooth characteristic spectra has any spatial gradients removed by normalizing each spatial positions by its
85
- median. This ensures that the characteristic spectra contain *only* pure solar spectra, and thus any real spatial
98
+ Finally, the smooth characteristic spectra have any spatial gradients removed by normalizing each spatial position by its
99
+ continuum level. This ensures that the characteristic spectra contain *only* pure solar spectra, and thus any real spatial
86
100
  gradients are preserved in the final gain image. This normalization also ensures the absolute flux of the final
87
101
  gain images is preserved so that science frames will have values relative to average disk center (where the solar images
88
102
  are taken).
@@ -90,21 +104,15 @@ are taken).
90
104
  Un-rectify Characteristic Spectra
91
105
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
106
 
93
- The characteristic spectra have spectral shifts, x/y offsets, and spectral rotation re-applied to bring them back into
94
- raw input pixel coordinates.
95
-
96
- The spectral curvature is NOT applied using the precomputed curvature. Instead, for each spatial position a new spectral
97
- shift is computed that minimizes the residual of the final gain image at that position. This step is needed because the
98
- characteristic spectra have *slightly* different spectral shapes than the input solar image (see above) and any small
99
- misalignment causes large, sharp residuals in the line wings. By explicitly minimizing final gain residuals we ensure
100
- that the new spectral shifts remove the solar signal as much as possible.
107
+ The characteristic spectra have spectral shifts and spectral rotation re-applied to bring them back into raw input pixel
108
+ coordinates.
101
109
 
102
110
  Remove Characteristic Solar Spectra from Input Solar Frames
103
111
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
112
 
105
113
  The dark/background corrected solar gain image is simply divided by the re-distorted characteristic spectra. Because we
106
- do NOT use a solar image with a lamp correction applied, the resulting gain image includes the full optical response of
107
- the system and can be applied directly to the science data.
114
+ do NOT use a solar image with a lamp or vignette correction applied, the resulting gain image includes the full optical
115
+ response of the system and can be applied directly to the science data.
108
116
 
109
117
  As mentioned above, these gain calibration images are not normalized. The result is that L1 science data will have
110
118
  values that are relative to solar disk center (where the solar gain images are observed).
@@ -1,116 +0,0 @@
1
- """Helper functions for line zone determination."""
2
-
3
- import numpy as np
4
- import peakutils
5
- import scipy.signal as sps
6
- from dkist_service_configuration.logging import logger
7
-
8
-
9
- class LineZonesMixin:
10
- """Helper functions for line zone determination."""
11
-
12
- def compute_line_zones(
13
- self,
14
- spec_2d: np.ndarray,
15
- prominence: float = 0.2,
16
- width: float = 2,
17
- bg_order: int = 22,
18
- normalization_percentile: int = 99,
19
- rel_height=0.97,
20
- ) -> list[tuple[int, int]]:
21
- """
22
- Identify spectral regions around strong spectra features.
23
-
24
- Parameters
25
- ----------
26
- spec_2d : np.ndarray
27
- Data
28
-
29
- prominence : float
30
- Zone prominence threshold used to identify strong spectral features
31
-
32
- width : float
33
- Zone width
34
-
35
- bg_order : int
36
- Order of polynomial fit used to remove continuum when identifying strong spectral features
37
-
38
- normalization_percentile : int
39
- Compute this percentile of the data along a specified axis
40
-
41
-
42
-
43
- Returns
44
- -------
45
- List
46
- List of regions to remove
47
-
48
- """
49
- logger.info(
50
- f"Finding zones using {prominence=}, {width=}, {bg_order=}, {normalization_percentile=}, and {rel_height=}"
51
- )
52
- # Compute average along slit to improve signal. Line smearing isn't important here
53
- avg_1d = np.mean(spec_2d, axis=1)
54
-
55
- # Convert to an emission spectrum and remove baseline continuum so peakutils has an easier time
56
- em_spec = -1 * avg_1d + avg_1d.max()
57
- em_spec /= np.nanpercentile(em_spec, normalization_percentile)
58
- baseline = peakutils.baseline(em_spec, bg_order)
59
- em_spec -= baseline
60
-
61
- # Find indices of peaks
62
- peak_idxs = sps.find_peaks(em_spec, prominence=prominence, width=width)[0]
63
-
64
- # Find the rough width based only on the height of the peak
65
- # rips and lips are the right and left borders of the region around the peak
66
- _, _, rips, lips = sps.peak_widths(em_spec, peak_idxs, rel_height=rel_height)
67
-
68
- # Convert to ints so they can be used as indices
69
- rips = np.floor(rips).astype(int)
70
- lips = np.ceil(lips).astype(int)
71
-
72
- # Remove any regions that are contained within another region
73
- ranges_to_remove = self.identify_overlapping_zones(rips, lips)
74
- rips = np.delete(rips, ranges_to_remove)
75
- lips = np.delete(lips, ranges_to_remove)
76
-
77
- return list(zip(rips, lips))
78
-
79
- @staticmethod
80
- def identify_overlapping_zones(rips: np.ndarray, lips: np.ndarray) -> list[int]:
81
- """
82
- Identify line zones that overlap with other zones. Any overlap greater than 1 pixel is flagged.
83
-
84
- Parameters
85
- ----------
86
- rips : np.ndarray
87
- Right borders of the region around the peak
88
-
89
- lips : np.ndarray
90
- Left borders of the region around the peak
91
-
92
- Returns
93
- -------
94
- List
95
- List of ranges to be removed
96
- """
97
- all_ranges = [np.arange(zmin, zmax) for zmin, zmax in zip(rips, lips)]
98
- ranges_to_remove = []
99
- for i in range(len(all_ranges)):
100
- target_range = all_ranges[i]
101
- for j in range(i + 1, len(all_ranges)):
102
- if (
103
- np.intersect1d(target_range, all_ranges[j]).size > 1
104
- ): # Allow for a single overlap just to be nice
105
- if target_range.size > all_ranges[j].size:
106
- ranges_to_remove.append(j)
107
- logger.info(
108
- f"Zone ({all_ranges[j][0]}, {all_ranges[j][-1]}) inside zone ({target_range[0]}, {target_range[-1]})"
109
- )
110
- else:
111
- ranges_to_remove.append(i)
112
- logger.info(
113
- f"Zone ({target_range[0]}, {target_range[-1]}) inside zone ({all_ranges[j][0]}, {all_ranges[j][-1]})"
114
- )
115
-
116
- return ranges_to_remove