dkist-processing-cryonirsp 1.10.0rc1__py3-none-any.whl → 1.14.9rc1__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.
- changelog/232.misc.rst +1 -0
- dkist_processing_cryonirsp/__init__.py +1 -0
- dkist_processing_cryonirsp/codecs/fits.py +1 -0
- dkist_processing_cryonirsp/config.py +1 -0
- dkist_processing_cryonirsp/models/beam_boundaries.py +1 -0
- dkist_processing_cryonirsp/models/constants.py +8 -30
- dkist_processing_cryonirsp/models/exposure_conditions.py +6 -5
- dkist_processing_cryonirsp/models/fits_access.py +40 -0
- dkist_processing_cryonirsp/models/parameters.py +1 -0
- dkist_processing_cryonirsp/models/tags.py +1 -0
- dkist_processing_cryonirsp/models/task_name.py +1 -0
- dkist_processing_cryonirsp/parsers/check_for_gains.py +1 -0
- dkist_processing_cryonirsp/parsers/cryonirsp_l0_fits_access.py +40 -48
- dkist_processing_cryonirsp/parsers/cryonirsp_l1_fits_access.py +1 -0
- dkist_processing_cryonirsp/parsers/exposure_conditions.py +14 -13
- dkist_processing_cryonirsp/parsers/map_repeats.py +1 -0
- dkist_processing_cryonirsp/parsers/measurements.py +29 -16
- dkist_processing_cryonirsp/parsers/modstates.py +5 -1
- dkist_processing_cryonirsp/parsers/optical_density_filters.py +1 -0
- dkist_processing_cryonirsp/parsers/polarimetric_check.py +18 -7
- dkist_processing_cryonirsp/parsers/scan_step.py +12 -4
- dkist_processing_cryonirsp/parsers/time.py +7 -7
- dkist_processing_cryonirsp/parsers/wavelength.py +6 -1
- dkist_processing_cryonirsp/tasks/__init__.py +1 -0
- dkist_processing_cryonirsp/tasks/assemble_movie.py +1 -0
- dkist_processing_cryonirsp/tasks/bad_pixel_map.py +6 -5
- dkist_processing_cryonirsp/tasks/beam_boundaries_base.py +9 -10
- dkist_processing_cryonirsp/tasks/ci_beam_boundaries.py +1 -0
- dkist_processing_cryonirsp/tasks/ci_science.py +1 -0
- dkist_processing_cryonirsp/tasks/cryonirsp_base.py +1 -0
- dkist_processing_cryonirsp/tasks/dark.py +5 -4
- dkist_processing_cryonirsp/tasks/gain.py +7 -6
- dkist_processing_cryonirsp/tasks/instrument_polarization.py +16 -15
- dkist_processing_cryonirsp/tasks/l1_output_data.py +1 -0
- dkist_processing_cryonirsp/tasks/linearity_correction.py +1 -0
- dkist_processing_cryonirsp/tasks/make_movie_frames.py +3 -2
- dkist_processing_cryonirsp/tasks/mixin/corrections.py +1 -0
- dkist_processing_cryonirsp/tasks/mixin/shift_measurements.py +1 -0
- dkist_processing_cryonirsp/tasks/parse.py +66 -61
- dkist_processing_cryonirsp/tasks/quality_metrics.py +15 -14
- dkist_processing_cryonirsp/tasks/science_base.py +8 -6
- dkist_processing_cryonirsp/tasks/sp_beam_boundaries.py +2 -1
- dkist_processing_cryonirsp/tasks/sp_geometric.py +11 -10
- dkist_processing_cryonirsp/tasks/sp_science.py +1 -0
- dkist_processing_cryonirsp/tasks/sp_solar_gain.py +15 -12
- dkist_processing_cryonirsp/tasks/sp_wavelength_calibration.py +9 -9
- dkist_processing_cryonirsp/tasks/write_l1.py +36 -7
- dkist_processing_cryonirsp/tests/conftest.py +6 -7
- dkist_processing_cryonirsp/tests/header_models.py +40 -3
- dkist_processing_cryonirsp/tests/local_trial_workflows/l0_cals_only.py +11 -31
- dkist_processing_cryonirsp/tests/local_trial_workflows/l0_to_l1.py +11 -30
- dkist_processing_cryonirsp/tests/local_trial_workflows/linearize_only.py +3 -3
- dkist_processing_cryonirsp/tests/local_trial_workflows/local_trial_helpers.py +3 -2
- dkist_processing_cryonirsp/tests/test_assemble_movie.py +4 -5
- dkist_processing_cryonirsp/tests/test_assemble_qualilty.py +5 -1
- dkist_processing_cryonirsp/tests/test_bad_pixel_maps.py +3 -4
- dkist_processing_cryonirsp/tests/test_ci_beam_boundaries.py +3 -4
- dkist_processing_cryonirsp/tests/test_ci_science.py +3 -4
- dkist_processing_cryonirsp/tests/test_corrections.py +3 -3
- dkist_processing_cryonirsp/tests/test_cryo_base.py +3 -5
- dkist_processing_cryonirsp/tests/test_cryo_constants.py +1 -2
- dkist_processing_cryonirsp/tests/test_dark.py +5 -6
- dkist_processing_cryonirsp/tests/test_fits_access.py +44 -0
- dkist_processing_cryonirsp/tests/test_gain.py +5 -6
- dkist_processing_cryonirsp/tests/test_instrument_polarization.py +9 -6
- dkist_processing_cryonirsp/tests/test_linearity_correction.py +4 -3
- dkist_processing_cryonirsp/tests/test_make_movie_frames.py +2 -3
- dkist_processing_cryonirsp/tests/test_parameters.py +3 -4
- dkist_processing_cryonirsp/tests/test_parse.py +14 -8
- dkist_processing_cryonirsp/tests/test_quality.py +2 -3
- dkist_processing_cryonirsp/tests/test_sp_beam_boundaries.py +4 -4
- dkist_processing_cryonirsp/tests/test_sp_geometric.py +3 -4
- dkist_processing_cryonirsp/tests/test_sp_make_movie_frames.py +2 -3
- dkist_processing_cryonirsp/tests/test_sp_science.py +3 -4
- dkist_processing_cryonirsp/tests/test_sp_solar.py +5 -4
- dkist_processing_cryonirsp/tests/test_sp_wavelength_calibration.py +4 -5
- dkist_processing_cryonirsp/tests/test_trial_create_quality_report.py +1 -1
- dkist_processing_cryonirsp/tests/test_workflows.py +1 -0
- dkist_processing_cryonirsp/tests/test_write_l1.py +12 -16
- dkist_processing_cryonirsp/workflows/__init__.py +1 -0
- dkist_processing_cryonirsp/workflows/ci_l0_processing.py +6 -5
- dkist_processing_cryonirsp/workflows/sp_l0_processing.py +6 -5
- dkist_processing_cryonirsp/workflows/trial_workflows.py +9 -8
- dkist_processing_cryonirsp-1.14.9rc1.dist-info/METADATA +552 -0
- dkist_processing_cryonirsp-1.14.9rc1.dist-info/RECORD +115 -0
- docs/conf.py +1 -0
- docs/wavelength_calibration.rst +1 -1
- changelog/167.feature.rst +0 -1
- dkist_processing_cryonirsp-1.10.0rc1.dist-info/METADATA +0 -458
- dkist_processing_cryonirsp-1.10.0rc1.dist-info/RECORD +0 -113
- {dkist_processing_cryonirsp-1.10.0rc1.dist-info → dkist_processing_cryonirsp-1.14.9rc1.dist-info}/WHEEL +0 -0
- {dkist_processing_cryonirsp-1.10.0rc1.dist-info → dkist_processing_cryonirsp-1.14.9rc1.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Cryonirsp write L1 task."""
|
|
2
|
+
|
|
2
3
|
from abc import ABC
|
|
3
4
|
from abc import abstractmethod
|
|
4
5
|
from functools import cached_property
|
|
@@ -13,12 +14,14 @@ from astropy.io import fits
|
|
|
13
14
|
from astropy.time.core import Time
|
|
14
15
|
from dkist_processing_common.codecs.json import json_decoder
|
|
15
16
|
from dkist_processing_common.models.dkist_location import location_of_dkist
|
|
17
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
16
18
|
from dkist_processing_common.models.wavelength import WavelengthRange
|
|
17
19
|
from dkist_processing_common.tasks import WriteL1Frame
|
|
18
20
|
from sunpy.coordinates import GeocentricEarthEquatorial
|
|
19
21
|
from sunpy.coordinates import Helioprojective
|
|
20
22
|
|
|
21
23
|
from dkist_processing_cryonirsp.models.constants import CryonirspConstants
|
|
24
|
+
from dkist_processing_cryonirsp.models.fits_access import CryonirspMetadataKey
|
|
22
25
|
from dkist_processing_cryonirsp.models.parameters import CryonirspParameters
|
|
23
26
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
24
27
|
|
|
@@ -92,13 +95,13 @@ class CryonirspWriteL1Frame(WriteL1Frame, ABC):
|
|
|
92
95
|
next_axis = self.add_map_scan_axis(header, axis_num=next_axis)
|
|
93
96
|
if self.constants.correct_for_polarization:
|
|
94
97
|
next_axis = self.add_stokes_axis(header, stokes=stokes, axis_num=next_axis)
|
|
95
|
-
self.add_wavelength_headers(header)
|
|
96
98
|
last_axis = next_axis - 1
|
|
97
99
|
self.add_common_headers(header, num_axes=last_axis)
|
|
98
100
|
self.flip_spectral_axis(header)
|
|
99
101
|
boresight_coordinates = self.get_boresight_coords(header)
|
|
100
102
|
self.correct_spatial_wcs_info(header, boresight_coordinates)
|
|
101
103
|
self.update_spectral_headers(header)
|
|
104
|
+
self.add_wavelength_headers(header)
|
|
102
105
|
|
|
103
106
|
return header
|
|
104
107
|
|
|
@@ -143,7 +146,7 @@ class CryonirspWriteL1Frame(WriteL1Frame, ABC):
|
|
|
143
146
|
header[f"DWNAME{axis_num}"] = "time"
|
|
144
147
|
header[f"DUNIT{axis_num}"] = "s"
|
|
145
148
|
# DINDEX and CNCMEAS are both one-based
|
|
146
|
-
header[f"DINDEX{axis_num}"] = header[
|
|
149
|
+
header[f"DINDEX{axis_num}"] = header[CryonirspMetadataKey.meas_num]
|
|
147
150
|
next_axis = axis_num + 1
|
|
148
151
|
return next_axis
|
|
149
152
|
|
|
@@ -277,7 +280,7 @@ class CryonirspWriteL1Frame(WriteL1Frame, ABC):
|
|
|
277
280
|
-------
|
|
278
281
|
None
|
|
279
282
|
"""
|
|
280
|
-
t0 = Time(header[
|
|
283
|
+
t0 = Time(header[MetadataKey.time_obs])
|
|
281
284
|
sky_coordinates = SkyCoord(
|
|
282
285
|
boresight_coordinates[0] * u.arcsec,
|
|
283
286
|
boresight_coordinates[1] * u.arcsec,
|
|
@@ -396,7 +399,7 @@ class CryonirspWriteL1Frame(WriteL1Frame, ABC):
|
|
|
396
399
|
"""Get CryoNIRSP slit orientation measured relative to solar north at time of observation."""
|
|
397
400
|
with Helioprojective.assume_spherical_screen(sky_coordinates.observer):
|
|
398
401
|
sc_alt = sky_coordinates.transform_to(frame_altaz)
|
|
399
|
-
coude_minus_azimuth_elevation = header[
|
|
402
|
+
coude_minus_azimuth_elevation = header[MetadataKey.table_angle] * u.deg - (
|
|
400
403
|
(sc_alt.az.deg - sc_alt.alt.deg) * u.deg
|
|
401
404
|
)
|
|
402
405
|
cryo_instrument_alignment_angle = self.parameters.cryo_instrument_alignment_angle
|
|
@@ -470,6 +473,32 @@ class CryonirspWriteL1Frame(WriteL1Frame, ABC):
|
|
|
470
473
|
"""Update spectral headers after spectral correction."""
|
|
471
474
|
pass
|
|
472
475
|
|
|
476
|
+
def add_timing_headers(self, header: fits.Header) -> fits.Header:
|
|
477
|
+
"""
|
|
478
|
+
Add timing headers to the FITS header.
|
|
479
|
+
|
|
480
|
+
This method adds or updates headers related to frame timings.
|
|
481
|
+
"""
|
|
482
|
+
# The source data is based on L0 data but L1 data takes L0 cadence * modstates * number of measurements to obtain.
|
|
483
|
+
# This causes the cadence to be num_modstates * num_measurements times longer.
|
|
484
|
+
# This causes the exposure time to be num_modstates times longer.
|
|
485
|
+
header["CADENCE"] = (
|
|
486
|
+
self.constants.average_cadence * self.constants.num_modstates * self.constants.num_meas
|
|
487
|
+
)
|
|
488
|
+
header["CADMIN"] = (
|
|
489
|
+
self.constants.minimum_cadence * self.constants.num_modstates * self.constants.num_meas
|
|
490
|
+
)
|
|
491
|
+
header["CADMAX"] = (
|
|
492
|
+
self.constants.maximum_cadence * self.constants.num_modstates * self.constants.num_meas
|
|
493
|
+
)
|
|
494
|
+
header["CADVAR"] = (
|
|
495
|
+
self.constants.variance_cadence * self.constants.num_modstates * self.constants.num_meas
|
|
496
|
+
)
|
|
497
|
+
header[MetadataKey.fpa_exposure_time_ms] = (
|
|
498
|
+
header[MetadataKey.fpa_exposure_time_ms] * self.constants.num_modstates
|
|
499
|
+
)
|
|
500
|
+
return header
|
|
501
|
+
|
|
473
502
|
|
|
474
503
|
class CIWriteL1Frame(CryonirspWriteL1Frame):
|
|
475
504
|
"""
|
|
@@ -522,7 +551,7 @@ class CIWriteL1Frame(CryonirspWriteL1Frame):
|
|
|
522
551
|
header[f"CNAME{axis_num}"] = "time"
|
|
523
552
|
header[f"DUNIT{axis_num}"] = "s"
|
|
524
553
|
# DINDEX and CNCURSCN are both one-based
|
|
525
|
-
header[f"DINDEX{axis_num}"] = header[
|
|
554
|
+
header[f"DINDEX{axis_num}"] = header[CryonirspMetadataKey.scan_step]
|
|
526
555
|
next_axis = axis_num + 1
|
|
527
556
|
return next_axis
|
|
528
557
|
|
|
@@ -536,7 +565,7 @@ class CIWriteL1Frame(CryonirspWriteL1Frame):
|
|
|
536
565
|
|
|
537
566
|
Range is the wavelengths at the edges of the filter full width half maximum.
|
|
538
567
|
"""
|
|
539
|
-
filter_central_wavelength = header[
|
|
568
|
+
filter_central_wavelength = header[CryonirspMetadataKey.center_wavelength] * u.nm
|
|
540
569
|
filter_fwhm = header["CNFWHM"] * u.nm
|
|
541
570
|
return WavelengthRange(
|
|
542
571
|
min=filter_central_wavelength - (filter_fwhm / 2),
|
|
@@ -807,7 +836,7 @@ class SPWriteL1Frame(CryonirspWriteL1Frame):
|
|
|
807
836
|
# NB: CUNIT axis number is hard coded here
|
|
808
837
|
header[f"DUNIT{axis_num}"] = header[f"CUNIT3"]
|
|
809
838
|
# DINDEX and CNCURSCN are both one-based
|
|
810
|
-
header[f"DINDEX{axis_num}"] = header[
|
|
839
|
+
header[f"DINDEX{axis_num}"] = header[CryonirspMetadataKey.scan_step]
|
|
811
840
|
next_axis = axis_num + 1
|
|
812
841
|
return next_axis
|
|
813
842
|
|
|
@@ -26,6 +26,7 @@ from dkist_processing_common.models.input_dataset import InputDatasetFilePointer
|
|
|
26
26
|
from dkist_processing_common.models.input_dataset import InputDatasetObject
|
|
27
27
|
from dkist_processing_common.models.input_dataset import InputDatasetPartDocumentList
|
|
28
28
|
from dkist_processing_common.tasks import WorkflowTaskBase
|
|
29
|
+
from dkist_processing_common.tests.mock_metadata_store import fake_gql_client
|
|
29
30
|
from pydantic import Field
|
|
30
31
|
from pydantic import model_validator
|
|
31
32
|
|
|
@@ -176,7 +177,7 @@ class CryonirspConstantsDb:
|
|
|
176
177
|
GRATING_POSITION_DEG: float = 62.505829779431224
|
|
177
178
|
GRATING_LITTROW_ANGLE_DEG: float = -5.5
|
|
178
179
|
GRATING_CONSTANT: float = 31.6
|
|
179
|
-
|
|
180
|
+
SOLAR_GAIN_START_TIME: str = "2021-01-01T00:00:00"
|
|
180
181
|
CENTER_WAVELENGTH: float = 1074.9
|
|
181
182
|
SLIT_WIDTH: int = 175
|
|
182
183
|
|
|
@@ -277,11 +278,9 @@ class FileParameter(InputDatasetFilePointer):
|
|
|
277
278
|
|
|
278
279
|
@model_validator(mode="after")
|
|
279
280
|
def _populate_file_object(self):
|
|
280
|
-
self.file_pointer =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
tag=CryonirspTag.parameter((self.object_key)),
|
|
284
|
-
)
|
|
281
|
+
self.file_pointer.bucket = "not_used_because_we_dont_transfer"
|
|
282
|
+
self.file_pointer.object_key = self.object_key
|
|
283
|
+
self.file_pointer.tag = CryonirspTag.parameter((self.object_key))
|
|
285
284
|
return self
|
|
286
285
|
|
|
287
286
|
|
|
@@ -377,7 +376,7 @@ def cryonirsp_testing_parameters_factory(
|
|
|
377
376
|
cryonirsp_pixel_pitch_micron: float = 18.0
|
|
378
377
|
cryonirsp_wavecal_atlas_download_config: dict[str, str] = field(
|
|
379
378
|
default_factory=lambda: {
|
|
380
|
-
"base_url": "
|
|
379
|
+
"base_url": "https://g-a36282.cd214.a567.data.globus.org/atlas/",
|
|
381
380
|
"telluric_reference_atlas_file_name": "telluric_reference_atlas.npy",
|
|
382
381
|
"telluric_reference_atlas_hash_id": "md5:8db5e12508b293bca3495d81a0747447",
|
|
383
382
|
"solar_reference_atlas_file_name": "solar_reference_atlas.npy",
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Model header objects
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
import datetime
|
|
5
6
|
import random
|
|
6
7
|
import uuid
|
|
7
8
|
from random import choice
|
|
8
9
|
|
|
9
10
|
import numpy as np
|
|
10
|
-
import pytest
|
|
11
|
-
from astropy.io import fits
|
|
12
11
|
from astropy.wcs import WCS
|
|
13
12
|
from dkist_data_simulator.dataset import key_function
|
|
14
13
|
from dkist_data_simulator.spec122 import Spec122Dataset
|
|
15
|
-
from dkist_header_validator import spec122_validator
|
|
16
14
|
|
|
17
15
|
from dkist_processing_cryonirsp.models.exposure_conditions import AllowableOpticalDensityFilterNames
|
|
18
16
|
from dkist_processing_cryonirsp.models.exposure_conditions import ExposureConditions
|
|
@@ -25,6 +23,7 @@ class CryonirspHeaders(Spec122Dataset):
|
|
|
25
23
|
array_shape: tuple[int, ...],
|
|
26
24
|
time_delta: 10,
|
|
27
25
|
instrument: str = "cryonirsp",
|
|
26
|
+
exp_time: float = 15.0,
|
|
28
27
|
**kwargs,
|
|
29
28
|
):
|
|
30
29
|
super().__init__(
|
|
@@ -50,6 +49,20 @@ class CryonirspHeaders(Spec122Dataset):
|
|
|
50
49
|
self.add_constant_key("CRSP_053", 1083.0)
|
|
51
50
|
self.add_constant_key("CRSP_054", 1.0)
|
|
52
51
|
|
|
52
|
+
self.add_constant_key("CAM__004", exp_time)
|
|
53
|
+
|
|
54
|
+
self.add_constant_key("CAM__001", "camera_id")
|
|
55
|
+
self.add_constant_key("CAM__002", "camera_name")
|
|
56
|
+
self.add_constant_key("CAM__003", 1)
|
|
57
|
+
self.add_constant_key("CAM__009", 1)
|
|
58
|
+
self.add_constant_key("CAM__010", 1)
|
|
59
|
+
self.add_constant_key("CAM__011", 1)
|
|
60
|
+
self.add_constant_key("CAM__012", 1)
|
|
61
|
+
self.add_constant_key("ID___014", "v1")
|
|
62
|
+
self.add_constant_key("TELTRACK", "Fixed Solar Rotation Tracking")
|
|
63
|
+
self.add_constant_key("TTBLTRCK", "fixed angle on sun")
|
|
64
|
+
self.add_constant_key("CAM__014", 10) # num_raw_frames_per_fpa
|
|
65
|
+
|
|
53
66
|
@key_function("CRSP_042")
|
|
54
67
|
# current modstate
|
|
55
68
|
def current_modstate(self, key: str):
|
|
@@ -172,6 +185,13 @@ class CryonirspHeadersValidDarkFrames(CryonirspHeaders):
|
|
|
172
185
|
self.add_constant_key("CRSP_041", 1)
|
|
173
186
|
self.add_constant_key("CRSP_042", 1)
|
|
174
187
|
|
|
188
|
+
self.add_constant_key("TELSCAN", "Raster")
|
|
189
|
+
self.add_constant_key("PAC__002", "lamp")
|
|
190
|
+
self.add_constant_key("PAC__003", "on")
|
|
191
|
+
self.add_constant_key("PAC__004", "Sapphire Polarizer")
|
|
192
|
+
self.add_constant_key("PAC__006", "SiO2 OC")
|
|
193
|
+
self.add_constant_key("PAC__008", "FieldStop (5arcmin)")
|
|
194
|
+
|
|
175
195
|
|
|
176
196
|
class CryonirspHeadersValidLampGainFrames(CryonirspHeaders):
|
|
177
197
|
def __init__(
|
|
@@ -226,6 +246,10 @@ class CryonirspHeadersValidCISolarGainFrames(CryonirspHeaders):
|
|
|
226
246
|
self.add_constant_key("CRSP_007", 1)
|
|
227
247
|
# lamp (clear, lamp, undefined)
|
|
228
248
|
self.add_constant_key("PAC__002", "clear")
|
|
249
|
+
self.add_constant_key("PAC__003", "off")
|
|
250
|
+
self.add_constant_key("PAC__004", "clear")
|
|
251
|
+
self.add_constant_key("PAC__006", "clear")
|
|
252
|
+
self.add_constant_key("PAC__008", "FieldStop (5arcmin)")
|
|
229
253
|
self.add_constant_key("TELSCAN", "Raster")
|
|
230
254
|
# inst prog id
|
|
231
255
|
self.add_constant_key("ID___004")
|
|
@@ -259,6 +283,10 @@ class CryonirspHeadersValidSPSolarGainFrames(CryonirspHeaders):
|
|
|
259
283
|
self.add_constant_key("CRSP_007", 1)
|
|
260
284
|
# lamp (clear, lamp, undefined)
|
|
261
285
|
self.add_constant_key("PAC__002", "clear")
|
|
286
|
+
self.add_constant_key("PAC__003", "off")
|
|
287
|
+
self.add_constant_key("PAC__004", "clear")
|
|
288
|
+
self.add_constant_key("PAC__006", "clear")
|
|
289
|
+
self.add_constant_key("PAC__008", "FieldStop (5arcmin)")
|
|
262
290
|
self.add_constant_key("TELSCAN", "Raster")
|
|
263
291
|
# inst prog id
|
|
264
292
|
self.add_constant_key("ID___004")
|
|
@@ -477,6 +505,9 @@ class ModulatedSolarGainHeaders(SimpleModulatedHeaders):
|
|
|
477
505
|
self.add_constant_key("CRSP_007", 1)
|
|
478
506
|
# inst prog id
|
|
479
507
|
self.add_constant_key("ID___004")
|
|
508
|
+
self.add_constant_key("PAC__004", "clear")
|
|
509
|
+
self.add_constant_key("PAC__006", "clear")
|
|
510
|
+
self.add_constant_key("PAC__008", "FieldStop (5arcmin)")
|
|
480
511
|
|
|
481
512
|
|
|
482
513
|
class ModulatedDarkHeaders(SimpleModulatedHeaders):
|
|
@@ -510,6 +541,12 @@ class ModulatedDarkHeaders(SimpleModulatedHeaders):
|
|
|
510
541
|
# inst prog id
|
|
511
542
|
self.add_constant_key("ID___004")
|
|
512
543
|
self.add_constant_key("WAVELNTH", 0.0)
|
|
544
|
+
self.add_constant_key("TELSCAN", "Raster")
|
|
545
|
+
self.add_constant_key("PAC__002", "lamp")
|
|
546
|
+
self.add_constant_key("PAC__003", "on")
|
|
547
|
+
self.add_constant_key("PAC__004", "Sapphire Polarizer")
|
|
548
|
+
self.add_constant_key("PAC__006", "SiO2 OC")
|
|
549
|
+
self.add_constant_key("PAC__008", "FieldStop (5arcmin)")
|
|
513
550
|
|
|
514
551
|
|
|
515
552
|
class ModulatedPolcalHeaders(SimpleModulatedHeaders):
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
import json
|
|
3
2
|
import os
|
|
4
3
|
import sys
|
|
5
4
|
from datetime import datetime
|
|
@@ -12,6 +11,7 @@ from dkist_processing_common.tasks import WorkflowTaskBase
|
|
|
12
11
|
from dkist_service_configuration.logging import logger
|
|
13
12
|
|
|
14
13
|
from dkist_processing_cryonirsp.models.constants import CryonirspBudName
|
|
14
|
+
from dkist_processing_cryonirsp.models.fits_access import CryonirspMetadataKey
|
|
15
15
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
16
16
|
from dkist_processing_cryonirsp.tasks import CIBeamBoundariesCalibration
|
|
17
17
|
from dkist_processing_cryonirsp.tasks import SPWavelengthCalibration
|
|
@@ -33,13 +33,7 @@ from dkist_processing_cryonirsp.tasks.parse import ParseL0CryonirspSPLinearizedD
|
|
|
33
33
|
from dkist_processing_cryonirsp.tasks.sp_beam_boundaries import SPBeamBoundariesCalibration
|
|
34
34
|
from dkist_processing_cryonirsp.tasks.sp_geometric import SPGeometricCalibration
|
|
35
35
|
from dkist_processing_cryonirsp.tasks.sp_solar_gain import SPSolarGainCalibration
|
|
36
|
-
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
37
|
-
create_input_dataset_parameter_document,
|
|
38
|
-
)
|
|
39
36
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import DBAccess
|
|
40
|
-
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
41
|
-
load_parsing_task,
|
|
42
|
-
)
|
|
43
37
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
44
38
|
LoadBadPixelMap,
|
|
45
39
|
)
|
|
@@ -61,9 +55,6 @@ from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers
|
|
|
61
55
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
62
56
|
LoadWavelengthCorrection,
|
|
63
57
|
)
|
|
64
|
-
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
65
|
-
save_parsing_task,
|
|
66
|
-
)
|
|
67
58
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
68
59
|
SaveBadPixelMap,
|
|
69
60
|
)
|
|
@@ -85,6 +76,15 @@ from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers
|
|
|
85
76
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
86
77
|
SaveWavelengthCorrection,
|
|
87
78
|
)
|
|
79
|
+
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
80
|
+
create_input_dataset_parameter_document,
|
|
81
|
+
)
|
|
82
|
+
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
83
|
+
load_parsing_task,
|
|
84
|
+
)
|
|
85
|
+
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
86
|
+
save_parsing_task,
|
|
87
|
+
)
|
|
88
88
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
89
89
|
tag_inputs_task,
|
|
90
90
|
)
|
|
@@ -134,7 +134,7 @@ def tag_linearized_inputs_task(suffix: str):
|
|
|
134
134
|
hdu = hdul[0]
|
|
135
135
|
else:
|
|
136
136
|
hdu = hdul[1]
|
|
137
|
-
arm_id = hdu.header[
|
|
137
|
+
arm_id = hdu.header[CryonirspMetadataKey.arm_id]
|
|
138
138
|
self.constants._update({CryonirspBudName.arm_id.value: arm_id})
|
|
139
139
|
|
|
140
140
|
return TagLinearizedInputs
|
|
@@ -170,21 +170,6 @@ def spoof_obs_lin_parsed_constants(
|
|
|
170
170
|
return SetCalOnlyConstants
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
def setup_APM_config() -> None:
|
|
174
|
-
mesh_config = {
|
|
175
|
-
"system-monitoring-log-apm": {
|
|
176
|
-
"mesh_address": "system-monitoring-log-apm.service.sim.consul",
|
|
177
|
-
"mesh_port": 8200,
|
|
178
|
-
},
|
|
179
|
-
"automated-processing-scratch-inventory": {"mesh_address": "localhost", "mesh_port": 6379},
|
|
180
|
-
"internal-api-gateway": {"mesh_address": "localhost", "mesh_port": 80},
|
|
181
|
-
}
|
|
182
|
-
apm_options = {"TRANSACTION_MAX_SPANS": 10000}
|
|
183
|
-
os.environ["MESH_CONFIG"] = json.dumps(mesh_config)
|
|
184
|
-
os.environ["ELASTIC_APM_ENABLED"] = "true"
|
|
185
|
-
os.environ["ELASTIC_APM_OTHER_OPTIONS"] = json.dumps(apm_options)
|
|
186
|
-
|
|
187
|
-
|
|
188
173
|
def CI_workflow(
|
|
189
174
|
manual_processing_run: ManualProcessing,
|
|
190
175
|
load_beam_boundaries: bool = False,
|
|
@@ -289,13 +274,10 @@ def main(
|
|
|
289
274
|
load_solar: bool = False,
|
|
290
275
|
load_wavelength_correction: bool = False,
|
|
291
276
|
load_inst_pol: bool = False,
|
|
292
|
-
use_apm: bool = False,
|
|
293
277
|
param_path: Path = None,
|
|
294
278
|
dummy_wavelength: float = 1083.0,
|
|
295
279
|
polarimetric: bool = True,
|
|
296
280
|
):
|
|
297
|
-
if use_apm:
|
|
298
|
-
setup_APM_config()
|
|
299
281
|
with ManualProcessing(
|
|
300
282
|
workflow_path=Path(scratch_path),
|
|
301
283
|
recipe_run_id=recipe_run_id,
|
|
@@ -491,7 +473,6 @@ if __name__ == "__main__":
|
|
|
491
473
|
help="Load instrument polarization calibration from previously saved run",
|
|
492
474
|
action="store_true",
|
|
493
475
|
)
|
|
494
|
-
parser.add_argument("-A", "--use-apm", help="Send APM spans to SIM", action="store_true")
|
|
495
476
|
parser.add_argument(
|
|
496
477
|
"-p",
|
|
497
478
|
"--param-path",
|
|
@@ -526,7 +507,6 @@ if __name__ == "__main__":
|
|
|
526
507
|
load_solar=args.load_solar,
|
|
527
508
|
load_wavelength_correction=args.load_wavelength_correction,
|
|
528
509
|
load_inst_pol=args.load_inst_pol,
|
|
529
|
-
use_apm=args.use_apm,
|
|
530
510
|
param_path=Path(args.param_path),
|
|
531
511
|
polarimetric=not args.intensity_only,
|
|
532
512
|
)
|
|
@@ -14,6 +14,7 @@ from dkist_processing_common.tasks import WorkflowTaskBase
|
|
|
14
14
|
from dkist_service_configuration.logging import logger
|
|
15
15
|
|
|
16
16
|
from dkist_processing_cryonirsp.models.constants import CryonirspBudName
|
|
17
|
+
from dkist_processing_cryonirsp.models.fits_access import CryonirspMetadataKey
|
|
17
18
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
18
19
|
from dkist_processing_cryonirsp.tasks import CIBeamBoundariesCalibration
|
|
19
20
|
from dkist_processing_cryonirsp.tasks import CIScienceCalibration
|
|
@@ -45,13 +46,7 @@ from dkist_processing_cryonirsp.tasks.sp_solar_gain import SPSolarGainCalibratio
|
|
|
45
46
|
from dkist_processing_cryonirsp.tasks.sp_wavelength_calibration import SPWavelengthCalibration
|
|
46
47
|
from dkist_processing_cryonirsp.tasks.write_l1 import CIWriteL1Frame
|
|
47
48
|
from dkist_processing_cryonirsp.tasks.write_l1 import SPWriteL1Frame
|
|
48
|
-
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
49
|
-
create_input_dataset_parameter_document,
|
|
50
|
-
)
|
|
51
49
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import DBAccess
|
|
52
|
-
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
53
|
-
load_parsing_task,
|
|
54
|
-
)
|
|
55
50
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
56
51
|
LoadBadPixelMap,
|
|
57
52
|
)
|
|
@@ -73,9 +68,6 @@ from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers
|
|
|
73
68
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
74
69
|
LoadWavelengthCorrection,
|
|
75
70
|
)
|
|
76
|
-
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
77
|
-
save_parsing_task,
|
|
78
|
-
)
|
|
79
71
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
80
72
|
SaveBadPixelMap,
|
|
81
73
|
)
|
|
@@ -97,6 +89,15 @@ from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers
|
|
|
97
89
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
98
90
|
SaveWavelengthCorrection,
|
|
99
91
|
)
|
|
92
|
+
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
93
|
+
create_input_dataset_parameter_document,
|
|
94
|
+
)
|
|
95
|
+
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
96
|
+
load_parsing_task,
|
|
97
|
+
)
|
|
98
|
+
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
99
|
+
save_parsing_task,
|
|
100
|
+
)
|
|
100
101
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
101
102
|
tag_inputs_task,
|
|
102
103
|
)
|
|
@@ -149,7 +150,7 @@ def tag_linearized_inputs_task(suffix: str):
|
|
|
149
150
|
hdu = hdul[0]
|
|
150
151
|
else:
|
|
151
152
|
hdu = hdul[1]
|
|
152
|
-
arm_id = hdu.header[
|
|
153
|
+
arm_id = hdu.header[CryonirspMetadataKey.arm_id]
|
|
153
154
|
self.constants._update({CryonirspBudName.arm_id.value: arm_id})
|
|
154
155
|
|
|
155
156
|
return TagLinearizedInputs
|
|
@@ -191,21 +192,6 @@ class ValidateL1Output(CryonirspTaskBase):
|
|
|
191
192
|
spec214_validator.validate(f, extra=False)
|
|
192
193
|
|
|
193
194
|
|
|
194
|
-
def setup_APM_config() -> None:
|
|
195
|
-
mesh_config = {
|
|
196
|
-
"system-monitoring-log-apm": {
|
|
197
|
-
"mesh_address": "system-monitoring-log-apm.service.sim.consul",
|
|
198
|
-
"mesh_port": 8200,
|
|
199
|
-
},
|
|
200
|
-
"automated-processing-scratch-inventory": {"mesh_address": "localhost", "mesh_port": 6379},
|
|
201
|
-
"internal-api-gateway": {"mesh_address": "localhost", "mesh_port": 80},
|
|
202
|
-
}
|
|
203
|
-
apm_options = {"TRANSACTION_MAX_SPANS": 10000}
|
|
204
|
-
os.environ["MESH_CONFIG"] = json.dumps(mesh_config)
|
|
205
|
-
os.environ["ELASTIC_APM_ENABLED"] = "true"
|
|
206
|
-
os.environ["ELASTIC_APM_OTHER_OPTIONS"] = json.dumps(apm_options)
|
|
207
|
-
|
|
208
|
-
|
|
209
195
|
def CI_workflow(
|
|
210
196
|
manual_processing_run: ManualProcessing,
|
|
211
197
|
load_beam_boundaries: bool = False,
|
|
@@ -322,12 +308,9 @@ def main(
|
|
|
322
308
|
load_solar: bool = False,
|
|
323
309
|
load_inst_pol: bool = False,
|
|
324
310
|
load_wavelength_calibration: bool = False,
|
|
325
|
-
use_apm: bool = False,
|
|
326
311
|
param_path: Path = None,
|
|
327
312
|
transfer_trial_data: str | None = None,
|
|
328
313
|
):
|
|
329
|
-
if use_apm:
|
|
330
|
-
setup_APM_config()
|
|
331
314
|
with ManualProcessing(
|
|
332
315
|
workflow_path=Path(scratch_path),
|
|
333
316
|
recipe_run_id=recipe_run_id,
|
|
@@ -573,7 +556,6 @@ if __name__ == "__main__":
|
|
|
573
556
|
help="Load instrument polarization calibration from previously saved run",
|
|
574
557
|
action="store_true",
|
|
575
558
|
)
|
|
576
|
-
parser.add_argument("-A", "--use-apm", help="Send APM spans to SIM", action="store_true")
|
|
577
559
|
parser.add_argument(
|
|
578
560
|
"-p",
|
|
579
561
|
"--param-path",
|
|
@@ -603,7 +585,6 @@ if __name__ == "__main__":
|
|
|
603
585
|
load_solar=args.load_solar,
|
|
604
586
|
load_wavelength_calibration=args.load_wavelength_calibration,
|
|
605
587
|
load_inst_pol=args.load_inst_pol,
|
|
606
|
-
use_apm=args.use_apm,
|
|
607
588
|
param_path=Path(args.param_path),
|
|
608
589
|
transfer_trial_data=args.transfer_trial_data,
|
|
609
590
|
)
|
|
@@ -8,13 +8,13 @@ from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
|
8
8
|
from dkist_processing_cryonirsp.tasks.linearity_correction import LinearityCorrection
|
|
9
9
|
from dkist_processing_cryonirsp.tasks.parse import ParseL0CryonirspRampData
|
|
10
10
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
11
|
-
|
|
11
|
+
SaveLinearizedFiles,
|
|
12
12
|
)
|
|
13
13
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
14
|
-
|
|
14
|
+
create_input_dataset_parameter_document,
|
|
15
15
|
)
|
|
16
16
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
17
|
-
|
|
17
|
+
save_parsing_task,
|
|
18
18
|
)
|
|
19
19
|
from dkist_processing_cryonirsp.tests.local_trial_workflows.local_trial_helpers import (
|
|
20
20
|
tag_inputs_task,
|
|
@@ -19,8 +19,8 @@ from dkist_service_configuration.logging import logger
|
|
|
19
19
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
20
20
|
from dkist_processing_cryonirsp.models.task_name import CryonirspTaskName
|
|
21
21
|
from dkist_processing_cryonirsp.tasks.cryonirsp_base import CryonirspTaskBase
|
|
22
|
-
from dkist_processing_cryonirsp.tests.conftest import cryonirsp_testing_parameters_factory
|
|
23
22
|
from dkist_processing_cryonirsp.tests.conftest import FileParameter
|
|
23
|
+
from dkist_processing_cryonirsp.tests.conftest import cryonirsp_testing_parameters_factory
|
|
24
24
|
|
|
25
25
|
# These are the workflow versions of the polyfit coefficient parameters
|
|
26
26
|
WORKFLOW_LINEARIZATION_POLYFIT_COEFFS_CI = [
|
|
@@ -365,7 +365,7 @@ class SaveWavelengthCorrection(SaveTaskTags):
|
|
|
365
365
|
|
|
366
366
|
@property
|
|
367
367
|
def relative_save_file(self) -> str:
|
|
368
|
-
return "
|
|
368
|
+
return "sp_wavelength_correction.asdf"
|
|
369
369
|
|
|
370
370
|
@property
|
|
371
371
|
def tag_lists_to_save(self) -> list[list[str]]:
|
|
@@ -475,6 +475,7 @@ def create_input_dataset_parameter_document(param_path: Path):
|
|
|
475
475
|
relative_path=relative_path,
|
|
476
476
|
tags=CryonirspTag.input_dataset_parameters(),
|
|
477
477
|
encoder=basemodel_encoder,
|
|
478
|
+
overwrite=True,
|
|
478
479
|
)
|
|
479
480
|
logger.info(f"Wrote input dataset parameter doc to {relative_path}")
|
|
480
481
|
self.copy_and_tag_parameter_files(param_path=param_path)
|
|
@@ -2,7 +2,6 @@ import numpy as np
|
|
|
2
2
|
import pytest
|
|
3
3
|
from dkist_processing_common._util.scratch import WorkflowFileSystem
|
|
4
4
|
from dkist_processing_common.codecs.fits import fits_hdulist_encoder
|
|
5
|
-
from dkist_processing_common.tests.conftest import FakeGQLClient
|
|
6
5
|
|
|
7
6
|
from dkist_processing_cryonirsp.models.constants import CryonirspBudName
|
|
8
7
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
@@ -68,9 +67,9 @@ def assemble_movie_task_with_tagged_movie_frames(
|
|
|
68
67
|
task._purge()
|
|
69
68
|
|
|
70
69
|
|
|
71
|
-
def test_assemble_movie(assemble_movie_task_with_tagged_movie_frames, mocker):
|
|
70
|
+
def test_assemble_movie(assemble_movie_task_with_tagged_movie_frames, mocker, fake_gql_client):
|
|
72
71
|
mocker.patch(
|
|
73
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
72
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
74
73
|
)
|
|
75
74
|
task, _, _ = assemble_movie_task_with_tagged_movie_frames
|
|
76
75
|
task()
|
|
@@ -134,9 +133,9 @@ def assemble_sp_task_with_tagged_movie_frames(tmp_path, recipe_run_id, init_cryo
|
|
|
134
133
|
task._purge()
|
|
135
134
|
|
|
136
135
|
|
|
137
|
-
def test_assemble_sp_movie(assemble_sp_task_with_tagged_movie_frames, mocker):
|
|
136
|
+
def test_assemble_sp_movie(assemble_sp_task_with_tagged_movie_frames, mocker, fake_gql_client):
|
|
138
137
|
mocker.patch(
|
|
139
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
138
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
140
139
|
)
|
|
141
140
|
assemble_sp_task_with_tagged_movie_frames()
|
|
142
141
|
movie_file = list(assemble_sp_task_with_tagged_movie_frames.read(tags=[CryonirspTag.movie()]))
|
|
@@ -474,7 +474,11 @@ def test_assemble_quality_data(
|
|
|
474
474
|
# Then
|
|
475
475
|
# each quality_data file is a list - this will combine the elements of multiple lists into a single list
|
|
476
476
|
quality_data = list(
|
|
477
|
-
chain.from_iterable(
|
|
477
|
+
chain.from_iterable(
|
|
478
|
+
task.read(
|
|
479
|
+
tags=[CryonirspTag.output(), CryonirspTag.quality_data()], decoder=json_decoder
|
|
480
|
+
)
|
|
481
|
+
)
|
|
478
482
|
)
|
|
479
483
|
# 19 with polcal
|
|
480
484
|
assert len(quality_data) == 19
|
|
@@ -6,13 +6,12 @@ from astropy.io import fits
|
|
|
6
6
|
from dkist_header_validator import spec122_validator
|
|
7
7
|
from dkist_processing_common._util.scratch import WorkflowFileSystem
|
|
8
8
|
from dkist_processing_common.codecs.fits import fits_hdulist_encoder
|
|
9
|
-
from dkist_processing_common.tests.conftest import FakeGQLClient
|
|
10
9
|
from dkist_service_configuration.logging import logger
|
|
11
10
|
|
|
12
11
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
13
12
|
from dkist_processing_cryonirsp.tasks.bad_pixel_map import BadPixelMapCalibration
|
|
14
|
-
from dkist_processing_cryonirsp.tests.conftest import cryonirsp_testing_parameters_factory
|
|
15
13
|
from dkist_processing_cryonirsp.tests.conftest import CryonirspConstantsDb
|
|
14
|
+
from dkist_processing_cryonirsp.tests.conftest import cryonirsp_testing_parameters_factory
|
|
16
15
|
from dkist_processing_cryonirsp.tests.conftest import generate_fits_frame
|
|
17
16
|
from dkist_processing_cryonirsp.tests.header_models import CryonirspHeadersValidCISolarGainFrames
|
|
18
17
|
|
|
@@ -91,14 +90,14 @@ def compute_bad_pixel_map_task(
|
|
|
91
90
|
task._purge()
|
|
92
91
|
|
|
93
92
|
|
|
94
|
-
def test_compute_bad_pixel_map_task(compute_bad_pixel_map_task, mocker):
|
|
93
|
+
def test_compute_bad_pixel_map_task(compute_bad_pixel_map_task, mocker, fake_gql_client):
|
|
95
94
|
"""
|
|
96
95
|
Given: An BadPixelMapCalibration task
|
|
97
96
|
When: Calling the task instance with known input data
|
|
98
97
|
Then: The correct beam boundary values are created and saved as intermediate files
|
|
99
98
|
"""
|
|
100
99
|
mocker.patch(
|
|
101
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
100
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
102
101
|
)
|
|
103
102
|
# Given
|
|
104
103
|
task, num_zeros, num_hot = compute_bad_pixel_map_task
|
|
@@ -7,12 +7,11 @@ from dkist_header_validator import spec122_validator
|
|
|
7
7
|
from dkist_processing_common._util.scratch import WorkflowFileSystem
|
|
8
8
|
from dkist_processing_common.codecs.fits import fits_array_encoder
|
|
9
9
|
from dkist_processing_common.codecs.fits import fits_hdulist_encoder
|
|
10
|
-
from dkist_processing_common.tests.conftest import FakeGQLClient
|
|
11
10
|
|
|
12
11
|
from dkist_processing_cryonirsp.models.tags import CryonirspTag
|
|
13
12
|
from dkist_processing_cryonirsp.tasks.ci_beam_boundaries import CIBeamBoundariesCalibration
|
|
14
|
-
from dkist_processing_cryonirsp.tests.conftest import cryonirsp_testing_parameters_factory
|
|
15
13
|
from dkist_processing_cryonirsp.tests.conftest import CryonirspConstantsDb
|
|
14
|
+
from dkist_processing_cryonirsp.tests.conftest import cryonirsp_testing_parameters_factory
|
|
16
15
|
from dkist_processing_cryonirsp.tests.conftest import generate_fits_frame
|
|
17
16
|
from dkist_processing_cryonirsp.tests.header_models import CryonirspHeadersValidCISolarGainFrames
|
|
18
17
|
|
|
@@ -85,14 +84,14 @@ def compute_beam_boundaries_task(
|
|
|
85
84
|
task._purge()
|
|
86
85
|
|
|
87
86
|
|
|
88
|
-
def test_compute_beam_boundaries_task(compute_beam_boundaries_task, mocker):
|
|
87
|
+
def test_compute_beam_boundaries_task(compute_beam_boundaries_task, mocker, fake_gql_client):
|
|
89
88
|
"""
|
|
90
89
|
Given: A CIBeamBoundariesCalibration task
|
|
91
90
|
When: Calling the task instance with known input data
|
|
92
91
|
Then: The correct beam boundary values are created and saved as intermediate files
|
|
93
92
|
"""
|
|
94
93
|
mocker.patch(
|
|
95
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
94
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
96
95
|
)
|
|
97
96
|
# Given
|
|
98
97
|
task, arm_id = compute_beam_boundaries_task
|