dkist-processing-visp 5.2.1__py3-none-any.whl → 5.2.2__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.
- dkist_processing_visp/tasks/__init__.py +1 -0
- dkist_processing_visp/tasks/solar.py +3 -34
- dkist_processing_visp/tasks/wavelength_calibration.py +44 -3
- dkist_processing_visp/workflows/l0_processing.py +1 -1
- dkist_processing_visp/workflows/trial_workflows.py +1 -1
- {dkist_processing_visp-5.2.1.dist-info → dkist_processing_visp-5.2.2.dist-info}/METADATA +5 -4
- {dkist_processing_visp-5.2.1.dist-info → dkist_processing_visp-5.2.2.dist-info}/RECORD +9 -9
- {dkist_processing_visp-5.2.1.dist-info → dkist_processing_visp-5.2.2.dist-info}/WHEEL +0 -0
- {dkist_processing_visp-5.2.1.dist-info → dkist_processing_visp-5.2.2.dist-info}/top_level.txt +0 -0
|
@@ -12,4 +12,5 @@ from dkist_processing_visp.tasks.parse import *
|
|
|
12
12
|
from dkist_processing_visp.tasks.quality_metrics import *
|
|
13
13
|
from dkist_processing_visp.tasks.science import *
|
|
14
14
|
from dkist_processing_visp.tasks.solar import *
|
|
15
|
+
from dkist_processing_visp.tasks.wavelength_calibration import WavelengthCalibration
|
|
15
16
|
from dkist_processing_visp.tasks.write_l1 import *
|
|
@@ -46,6 +46,7 @@ from dkist_processing_visp.tasks.visp_base import VispTaskBase
|
|
|
46
46
|
from dkist_processing_visp.tasks.wavelength_calibration import compute_initial_dispersion
|
|
47
47
|
from dkist_processing_visp.tasks.wavelength_calibration import compute_input_wavelength_vector
|
|
48
48
|
from dkist_processing_visp.tasks.wavelength_calibration import compute_order
|
|
49
|
+
from dkist_processing_visp.tasks.wavelength_calibration import estimate_relative_continuum_level
|
|
49
50
|
from dkist_processing_visp.tasks.wavelength_calibration import get_doppler_velocity
|
|
50
51
|
|
|
51
52
|
__all__ = [
|
|
@@ -638,11 +639,12 @@ class SolarCalibration(
|
|
|
638
639
|
resolving_power = self.parameters.wavecal_init_resolving_power
|
|
639
640
|
opacity_factor = self.parameters.wavecal_init_opacity_factor
|
|
640
641
|
straylight_faction = self.parameters.wavecal_init_straylight_fraction
|
|
641
|
-
relative_atlas_scaling =
|
|
642
|
+
relative_atlas_scaling = estimate_relative_continuum_level(
|
|
642
643
|
crval_init=crval_init,
|
|
643
644
|
wavelength_range=wavelength_range,
|
|
644
645
|
atlas=atlas,
|
|
645
646
|
representative_spectrum=representative_spectrum,
|
|
647
|
+
normalization_percentile=self.parameters.wavecal_init_crval_guess_normalization_percentile,
|
|
646
648
|
)
|
|
647
649
|
logger.info(f"0th order coefficient initial guess: {relative_atlas_scaling}")
|
|
648
650
|
|
|
@@ -683,39 +685,6 @@ class SolarCalibration(
|
|
|
683
685
|
|
|
684
686
|
return init_params
|
|
685
687
|
|
|
686
|
-
def estimate_relative_continuum_level(
|
|
687
|
-
self,
|
|
688
|
-
*,
|
|
689
|
-
crval_init: Quantity,
|
|
690
|
-
wavelength_range: Quantity,
|
|
691
|
-
atlas: Atlas,
|
|
692
|
-
representative_spectrum: np.ndarray,
|
|
693
|
-
) -> float:
|
|
694
|
-
"""
|
|
695
|
-
Estimate the multiplicative scaling between the representative spectrum and atlas solar transmission.
|
|
696
|
-
|
|
697
|
-
This scaling is used to set the initial guess of 0th-order polynomial fit coefficient. We estimate the scaling
|
|
698
|
-
factor by comparing the values of the two spectra at a given percent of the CDF. This percent is taken from
|
|
699
|
-
the `~dkist_processing_visp.models.parameters.VispParameters.wavecal_init_crval_guess_normalization_percentile`
|
|
700
|
-
pipeline parameter.
|
|
701
|
-
"""
|
|
702
|
-
wave_min = crval_init - wavelength_range / 2
|
|
703
|
-
wave_max = crval_init + wavelength_range / 2
|
|
704
|
-
|
|
705
|
-
atlas_idx = np.where(
|
|
706
|
-
(atlas.solar_atlas_wavelength >= wave_min) & (atlas.solar_atlas_wavelength <= wave_max)
|
|
707
|
-
)
|
|
708
|
-
atlas_norm = np.nanpercentile(
|
|
709
|
-
atlas.solar_atlas_transmission[atlas_idx],
|
|
710
|
-
self.parameters.wavecal_init_crval_guess_normalization_percentile,
|
|
711
|
-
)
|
|
712
|
-
spec_norm = np.nanpercentile(
|
|
713
|
-
representative_spectrum,
|
|
714
|
-
self.parameters.wavecal_init_crval_guess_normalization_percentile,
|
|
715
|
-
)
|
|
716
|
-
|
|
717
|
-
return spec_norm / atlas_norm
|
|
718
|
-
|
|
719
688
|
def compute_final_vignette_estimate(self, init_vignette_correction: np.ndarray) -> np.ndarray:
|
|
720
689
|
"""
|
|
721
690
|
Fit the spectral shape of continuum residuals for each spatial pixel.
|
|
@@ -26,8 +26,6 @@ from sunpy.coordinates import HeliocentricInertial
|
|
|
26
26
|
from dkist_processing_visp.models.tags import VispTag
|
|
27
27
|
from dkist_processing_visp.tasks.visp_base import VispTaskBase
|
|
28
28
|
|
|
29
|
-
__all__ = ["WavelengthCalibration"]
|
|
30
|
-
|
|
31
29
|
|
|
32
30
|
class WavelengthCalibration(VispTaskBase, QualityMixin):
|
|
33
31
|
"""Task class for correcting the dispersion axis wavelength values.
|
|
@@ -125,6 +123,7 @@ class WavelengthCalibration(VispTaskBase, QualityMixin):
|
|
|
125
123
|
negative_limit=-wavelength_range / 2,
|
|
126
124
|
positive_limit=wavelength_range / 2,
|
|
127
125
|
num_steps=550,
|
|
126
|
+
normalization_percentile=self.parameters.wavecal_init_crval_guess_normalization_percentile,
|
|
128
127
|
)
|
|
129
128
|
logger.info(f"{crval_initial_guess = !s}")
|
|
130
129
|
|
|
@@ -135,6 +134,15 @@ class WavelengthCalibration(VispTaskBase, QualityMixin):
|
|
|
135
134
|
resolving_power = self.parameters.wavecal_init_resolving_power
|
|
136
135
|
logger.info(f"{resolving_power = }")
|
|
137
136
|
|
|
137
|
+
init_continuum_level = estimate_relative_continuum_level(
|
|
138
|
+
crval_init=crval_initial_guess,
|
|
139
|
+
wavelength_range=wavelength_range,
|
|
140
|
+
atlas=atlas,
|
|
141
|
+
representative_spectrum=input_spectrum,
|
|
142
|
+
normalization_percentile=self.parameters.wavecal_init_crval_guess_normalization_percentile,
|
|
143
|
+
)
|
|
144
|
+
logger.info(f"{init_continuum_level = !s}")
|
|
145
|
+
|
|
138
146
|
logger.info("Setting bounds")
|
|
139
147
|
wavelength_search_width = dispersion * self.parameters.wavecal_crval_bounds_px
|
|
140
148
|
bounds = BoundsModel(
|
|
@@ -158,7 +166,9 @@ class WavelengthCalibration(VispTaskBase, QualityMixin):
|
|
|
158
166
|
),
|
|
159
167
|
opacity_factor=UnitlessBoundRange(min=0.0, max=10.0),
|
|
160
168
|
straylight_fraction=UnitlessBoundRange(min=0.0, max=0.4),
|
|
161
|
-
continuum_level=UnitlessBoundRange(
|
|
169
|
+
continuum_level=UnitlessBoundRange(
|
|
170
|
+
min=init_continuum_level * 0.7, max=init_continuum_level * 1.3
|
|
171
|
+
),
|
|
162
172
|
)
|
|
163
173
|
|
|
164
174
|
fit_flags = FitFlagsModel(
|
|
@@ -180,6 +190,7 @@ class WavelengthCalibration(VispTaskBase, QualityMixin):
|
|
|
180
190
|
opacity_factor=self.parameters.wavecal_init_opacity_factor,
|
|
181
191
|
straylight_fraction=self.parameters.wavecal_init_straylight_fraction,
|
|
182
192
|
grating_constant=self.constants.grating_constant_inverse_mm,
|
|
193
|
+
continuum_level=init_continuum_level,
|
|
183
194
|
doppler_velocity=doppler_velocity,
|
|
184
195
|
order=order,
|
|
185
196
|
bounds=bounds,
|
|
@@ -428,3 +439,33 @@ def compute_initial_dispersion(
|
|
|
428
439
|
dispersion = pixel_pitch / linear_dispersion
|
|
429
440
|
|
|
430
441
|
return dispersion.to(u.nm / u.pix)
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def estimate_relative_continuum_level(
|
|
445
|
+
*,
|
|
446
|
+
crval_init: Quantity,
|
|
447
|
+
wavelength_range: Quantity,
|
|
448
|
+
atlas: Atlas,
|
|
449
|
+
representative_spectrum: np.ndarray,
|
|
450
|
+
normalization_percentile: float,
|
|
451
|
+
) -> float:
|
|
452
|
+
"""
|
|
453
|
+
Estimate the multiplicative scaling between the representative spectrum and atlas solar transmission.
|
|
454
|
+
|
|
455
|
+
This scaling is used to set the initial guess of 0th-order continuum scaling. We estimate the scaling factor by
|
|
456
|
+
comparing the values of the two spectra at a given percent of the CDF. This percent is taken from the
|
|
457
|
+
`~dkist_processing_visp.models.parameters.VispParameters.wavecal_init_crval_guess_normalization_percentile`
|
|
458
|
+
pipeline parameter.
|
|
459
|
+
"""
|
|
460
|
+
wave_min = crval_init - wavelength_range / 2
|
|
461
|
+
wave_max = crval_init + wavelength_range / 2
|
|
462
|
+
|
|
463
|
+
atlas_idx = np.where(
|
|
464
|
+
(atlas.solar_atlas_wavelength >= wave_min) & (atlas.solar_atlas_wavelength <= wave_max)
|
|
465
|
+
)
|
|
466
|
+
atlas_norm = np.nanpercentile(
|
|
467
|
+
atlas.solar_atlas_transmission[atlas_idx], normalization_percentile
|
|
468
|
+
)
|
|
469
|
+
spec_norm = np.nanpercentile(representative_spectrum, normalization_percentile)
|
|
470
|
+
|
|
471
|
+
return spec_norm / atlas_norm
|
|
@@ -22,7 +22,7 @@ from dkist_processing_visp.tasks import VispAssembleQualityData
|
|
|
22
22
|
from dkist_processing_visp.tasks import VispL0QualityMetrics
|
|
23
23
|
from dkist_processing_visp.tasks import VispL1QualityMetrics
|
|
24
24
|
from dkist_processing_visp.tasks import VispWriteL1Frame
|
|
25
|
-
from dkist_processing_visp.tasks
|
|
25
|
+
from dkist_processing_visp.tasks import WavelengthCalibration
|
|
26
26
|
|
|
27
27
|
l0_pipeline = Workflow(
|
|
28
28
|
category="visp",
|
|
@@ -23,7 +23,7 @@ from dkist_processing_visp.tasks import VispAssembleQualityData
|
|
|
23
23
|
from dkist_processing_visp.tasks import VispL0QualityMetrics
|
|
24
24
|
from dkist_processing_visp.tasks import VispL1QualityMetrics
|
|
25
25
|
from dkist_processing_visp.tasks import VispWriteL1Frame
|
|
26
|
-
from dkist_processing_visp.tasks
|
|
26
|
+
from dkist_processing_visp.tasks import WavelengthCalibration
|
|
27
27
|
|
|
28
28
|
full_trial_pipeline = Workflow(
|
|
29
29
|
category="visp",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dkist-processing-visp
|
|
3
|
-
Version: 5.2.
|
|
3
|
+
Version: 5.2.2
|
|
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
|
|
@@ -126,8 +126,8 @@ Requires-Dist: attrs==25.4.0; extra == "frozen"
|
|
|
126
126
|
Requires-Dist: babel==2.17.0; extra == "frozen"
|
|
127
127
|
Requires-Dist: billiard==4.2.4; extra == "frozen"
|
|
128
128
|
Requires-Dist: blinker==1.9.0; extra == "frozen"
|
|
129
|
-
Requires-Dist: boto3==1.42.
|
|
130
|
-
Requires-Dist: botocore==1.42.
|
|
129
|
+
Requires-Dist: boto3==1.42.11; extra == "frozen"
|
|
130
|
+
Requires-Dist: botocore==1.42.11; extra == "frozen"
|
|
131
131
|
Requires-Dist: cachelib==0.13.0; extra == "frozen"
|
|
132
132
|
Requires-Dist: celery==5.6.0; extra == "frozen"
|
|
133
133
|
Requires-Dist: certifi==2025.11.12; extra == "frozen"
|
|
@@ -154,7 +154,7 @@ Requires-Dist: dkist-processing-common==11.9.1; extra == "frozen"
|
|
|
154
154
|
Requires-Dist: dkist-processing-core==6.0.1; extra == "frozen"
|
|
155
155
|
Requires-Dist: dkist-processing-math==2.2.1; extra == "frozen"
|
|
156
156
|
Requires-Dist: dkist-processing-pac==3.1.1; extra == "frozen"
|
|
157
|
-
Requires-Dist: dkist-processing-visp==5.2.
|
|
157
|
+
Requires-Dist: dkist-processing-visp==5.2.2; extra == "frozen"
|
|
158
158
|
Requires-Dist: dkist-service-configuration==4.1.13; extra == "frozen"
|
|
159
159
|
Requires-Dist: dkist-spectral-lines==3.0.0; extra == "frozen"
|
|
160
160
|
Requires-Dist: dkist_fits_specifications==4.19.0; extra == "frozen"
|
|
@@ -170,6 +170,7 @@ Requires-Dist: globus-sdk==4.2.0; extra == "frozen"
|
|
|
170
170
|
Requires-Dist: google-re2==1.1.20251105; extra == "frozen"
|
|
171
171
|
Requires-Dist: googleapis-common-protos==1.72.0; extra == "frozen"
|
|
172
172
|
Requires-Dist: gqlclient==1.2.3; extra == "frozen"
|
|
173
|
+
Requires-Dist: greenlet==3.3.0; extra == "frozen"
|
|
173
174
|
Requires-Dist: grpcio==1.76.0; extra == "frozen"
|
|
174
175
|
Requires-Dist: gunicorn==23.0.0; extra == "frozen"
|
|
175
176
|
Requires-Dist: h11==0.16.0; extra == "frozen"
|
|
@@ -18,7 +18,7 @@ dkist_processing_visp/parsers/spectrograph_configuration.py,sha256=YpMX1NhE7xySx
|
|
|
18
18
|
dkist_processing_visp/parsers/time.py,sha256=uudQ5manYdL7SgxqABfFPDzW2iTNrTYF0klqCRsP0CI,4812
|
|
19
19
|
dkist_processing_visp/parsers/visp_l0_fits_access.py,sha256=WDAgMp_70AKmzxGqboKA3McSGgF_mvgsGiihYmK1Nus,1973
|
|
20
20
|
dkist_processing_visp/parsers/visp_l1_fits_access.py,sha256=1MrFfsJjT_7fd1cj8tFr5rHX2JdRSrlwiMCzu-Q8ejY,860
|
|
21
|
-
dkist_processing_visp/tasks/__init__.py,sha256=
|
|
21
|
+
dkist_processing_visp/tasks/__init__.py,sha256=wleMYKy1OmAJdvxmPCwtktM0koSLS5Vnd2H8C2uLdjQ,798
|
|
22
22
|
dkist_processing_visp/tasks/assemble_movie.py,sha256=8UujniXlV_sSGeuISud8wMHihLy6Gc5fKZpwkXLUQB8,3330
|
|
23
23
|
dkist_processing_visp/tasks/background_light.py,sha256=qQ3r1LR5qaOz2qNHnO5_QK8l1zbVP0GaCS3aLqJfNYY,16201
|
|
24
24
|
dkist_processing_visp/tasks/dark.py,sha256=VVitrat08U7e5L1-NVnNNJI_KIx791_DvKEJokvCqXE,4334
|
|
@@ -30,9 +30,9 @@ dkist_processing_visp/tasks/make_movie_frames.py,sha256=fw25ksKiJJNS57XV5a7rHpYG
|
|
|
30
30
|
dkist_processing_visp/tasks/parse.py,sha256=Fe_2svvMSKBup--Ulxbu0uaNW3dzPxQreafMEw0CY6E,7897
|
|
31
31
|
dkist_processing_visp/tasks/quality_metrics.py,sha256=Pw55-PXW0cl39FuNkEQCGGhvI_zMDimwmh-swVPVBD4,8133
|
|
32
32
|
dkist_processing_visp/tasks/science.py,sha256=fm-LLWxmLEjea0a8fhmN3x1v3n1Od4BJ3BioyjPuih8,38318
|
|
33
|
-
dkist_processing_visp/tasks/solar.py,sha256
|
|
33
|
+
dkist_processing_visp/tasks/solar.py,sha256=klV5TvSigFBvriR9YQE5YQzHSECk_J7Lfn1zxQHiWS4,39983
|
|
34
34
|
dkist_processing_visp/tasks/visp_base.py,sha256=-yC-PVP9AqFeZJshJ_nqZpSyRsZyHWUlugWvkeWkPKA,1412
|
|
35
|
-
dkist_processing_visp/tasks/wavelength_calibration.py,sha256=
|
|
35
|
+
dkist_processing_visp/tasks/wavelength_calibration.py,sha256=GLp24j4VfXnHdYmFO0Qd2mV-5hNolx6RQE4GwJo4gTk,18839
|
|
36
36
|
dkist_processing_visp/tasks/write_l1.py,sha256=UbugV6ilmeYdq-bC9WUiJxkFjn9VzJIkZXtoA7cs71k,8798
|
|
37
37
|
dkist_processing_visp/tasks/mixin/__init__.py,sha256=z2nFVvvIzirxklQ9i5-F1nR-WOgcDttYtog_jx4yN5I,12
|
|
38
38
|
dkist_processing_visp/tasks/mixin/beam_access.py,sha256=1VSJkH6yMxCiZWdWOp_RJ37fX5ULMYmB_0_ulT7YJpI,870
|
|
@@ -70,9 +70,9 @@ dkist_processing_visp/tests/local_trial_workflows/l0_solar_gain_as_science.py,sh
|
|
|
70
70
|
dkist_processing_visp/tests/local_trial_workflows/l0_to_l1.py,sha256=q_rS8PVm6pA5EjayBhj2SfGSRnpsd_jY2IlIfiVpPC4,16101
|
|
71
71
|
dkist_processing_visp/tests/local_trial_workflows/local_trial_helpers.py,sha256=R7NZNEv0VQwwZoBwPa6RYY94_VBnM4JQJ1AQdQaCrGQ,29078
|
|
72
72
|
dkist_processing_visp/workflows/__init__.py,sha256=1-GP9tOzjCxLJtyq0ry_x4dPdArfSso8Hxu65ydPpXQ,103
|
|
73
|
-
dkist_processing_visp/workflows/l0_processing.py,sha256=
|
|
73
|
+
dkist_processing_visp/workflows/l0_processing.py,sha256=Gc-tlAPayg9WKq2jdRib83kvyaq1WuPaT_yrZ73sSu0,3506
|
|
74
74
|
dkist_processing_visp/workflows/single_task_workflows.py,sha256=LK4dsshM0-lwy79WaMoTplyCxUyINnP9RU74MG_dhyc,33
|
|
75
|
-
dkist_processing_visp/workflows/trial_workflows.py,sha256=
|
|
75
|
+
dkist_processing_visp/workflows/trial_workflows.py,sha256=52y5gqigVsqVeNDXH-5tnOubEQOLAWy50cMRRTo1BaM,3999
|
|
76
76
|
docs/Makefile,sha256=qnlVz6PuBqE39NfHWuUnHhNEA-EFgT2-WJNNNy9ttfk,4598
|
|
77
77
|
docs/background_light.rst,sha256=FWj8KH7H51BtoqPCJ1A_VIWJkjaXD8-dwM9RdY1rkIc,5147
|
|
78
78
|
docs/changelog.rst,sha256=ZpZPJIyl4nI0Eicku6uSrLdiinNOF2GcZwrvTEsb-Zs,346
|
|
@@ -91,7 +91,7 @@ docs/science_calibration.rst,sha256=VN_g7xSjN-nbXhlBaFnPCbNcsc_Qu0207jEUfRAjnBE,
|
|
|
91
91
|
docs/scientific_changelog.rst,sha256=01AWBSHg8zElnodCgAq-hMxhk9CkX5rtEENx4iz0sjI,300
|
|
92
92
|
docs/wavelength_calibration.rst,sha256=OSGYAeR8Acns2ZUectHzRj2xcAsuNEMLejcYfPYu-vw,3674
|
|
93
93
|
licenses/LICENSE.rst,sha256=piZaQplkzOMmH1NXg6QIdo9wwo9pPCoHkvm2-DmH76E,1462
|
|
94
|
-
dkist_processing_visp-5.2.
|
|
95
|
-
dkist_processing_visp-5.2.
|
|
96
|
-
dkist_processing_visp-5.2.
|
|
97
|
-
dkist_processing_visp-5.2.
|
|
94
|
+
dkist_processing_visp-5.2.2.dist-info/METADATA,sha256=UCKkJRm8UpkRs67vUkPZ9B6cMPlIiWBJZZ_K0_ejB48,30023
|
|
95
|
+
dkist_processing_visp-5.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
96
|
+
dkist_processing_visp-5.2.2.dist-info/top_level.txt,sha256=9GHSn-ZMGQxaRNGrPP3HNc5ZkE7ftzluO74Jz5vUSTE,46
|
|
97
|
+
dkist_processing_visp-5.2.2.dist-info/RECORD,,
|
|
File without changes
|
{dkist_processing_visp-5.2.1.dist-info → dkist_processing_visp-5.2.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|