dkist-processing-vbi 1.22.0__py3-none-any.whl → 1.25.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_vbi/__init__.py +1 -0
- dkist_processing_vbi/config.py +1 -0
- dkist_processing_vbi/models/constants.py +1 -0
- dkist_processing_vbi/models/filter.py +1 -0
- dkist_processing_vbi/models/parameters.py +1 -0
- dkist_processing_vbi/models/tags.py +1 -0
- dkist_processing_vbi/parsers/mosaic_repeats.py +1 -0
- dkist_processing_vbi/parsers/spatial_step_pattern.py +1 -0
- dkist_processing_vbi/parsers/vbi_l0_fits_access.py +1 -0
- dkist_processing_vbi/parsers/vbi_l1_fits_access.py +1 -0
- dkist_processing_vbi/tasks/__init__.py +1 -0
- dkist_processing_vbi/tasks/assemble_movie.py +1 -0
- dkist_processing_vbi/tasks/dark.py +5 -6
- dkist_processing_vbi/tasks/gain.py +5 -4
- dkist_processing_vbi/tasks/make_movie_frames.py +5 -6
- dkist_processing_vbi/tasks/parse.py +1 -0
- dkist_processing_vbi/tasks/process_summit_processed.py +2 -1
- dkist_processing_vbi/tasks/quality_metrics.py +3 -2
- dkist_processing_vbi/tasks/science.py +5 -4
- dkist_processing_vbi/tasks/vbi_base.py +1 -0
- dkist_processing_vbi/tasks/write_l1.py +2 -1
- dkist_processing_vbi/tests/conftest.py +12 -0
- dkist_processing_vbi/tests/local_trial_workflows/l0_to_l1.py +0 -20
- dkist_processing_vbi/tests/test_assemble_movie.py +6 -4
- dkist_processing_vbi/tests/test_dark.py +3 -4
- dkist_processing_vbi/tests/test_gain.py +4 -5
- dkist_processing_vbi/tests/test_make_movie_frames.py +4 -5
- dkist_processing_vbi/tests/test_parse_l0.py +19 -14
- dkist_processing_vbi/tests/test_parse_summit.py +8 -6
- dkist_processing_vbi/tests/test_process_summit.py +6 -7
- dkist_processing_vbi/tests/test_science.py +4 -5
- dkist_processing_vbi/tests/test_vbi_constants.py +1 -2
- dkist_processing_vbi/tests/test_workflows.py +1 -0
- dkist_processing_vbi/tests/test_write_l1.py +4 -3
- dkist_processing_vbi/workflows/__init__.py +1 -0
- dkist_processing_vbi/workflows/l0_processing.py +1 -0
- dkist_processing_vbi/workflows/summit_data_processing.py +1 -0
- dkist_processing_vbi/workflows/trial_workflows.py +1 -0
- {dkist_processing_vbi-1.22.0.dist-info → dkist_processing_vbi-1.25.2.dist-info}/METADATA +214 -126
- dkist_processing_vbi-1.25.2.dist-info/RECORD +64 -0
- docs/conf.py +1 -0
- dkist_processing_vbi-1.22.0.dist-info/RECORD +0 -64
- {dkist_processing_vbi-1.22.0.dist-info → dkist_processing_vbi-1.25.2.dist-info}/WHEEL +0 -0
- {dkist_processing_vbi-1.22.0.dist-info → dkist_processing_vbi-1.25.2.dist-info}/top_level.txt +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"""
|
|
2
2
|
This might be a totally redundant test. Leave it in for now.
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
from itertools import chain
|
|
5
6
|
|
|
6
7
|
import pytest
|
|
7
8
|
from dkist_processing_common._util.scratch import WorkflowFileSystem
|
|
8
9
|
from dkist_processing_common.codecs.fits import fits_hdulist_encoder
|
|
9
|
-
from dkist_processing_common.tests.conftest import FakeGQLClient
|
|
10
10
|
|
|
11
11
|
from dkist_processing_vbi.models.constants import VbiBudName
|
|
12
12
|
from dkist_processing_vbi.models.tags import VbiTag
|
|
13
13
|
from dkist_processing_vbi.tasks.parse import ParseL0VbiInputData
|
|
14
|
-
from dkist_processing_vbi.tests.conftest import generate_214_l0_fits_frame
|
|
15
14
|
from dkist_processing_vbi.tests.conftest import Vbi122DarkFrames
|
|
16
15
|
from dkist_processing_vbi.tests.conftest import Vbi122SummitObserveFrames
|
|
16
|
+
from dkist_processing_vbi.tests.conftest import generate_214_l0_fits_frame
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
@pytest.fixture(scope="function")
|
|
@@ -80,14 +80,14 @@ def parse_summit_task_with_subrepeats(tmp_path, recipe_run_id):
|
|
|
80
80
|
task._purge()
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
def test_parse_summit_proccessed_data(parse_summit_processed_task, mocker):
|
|
83
|
+
def test_parse_summit_proccessed_data(parse_summit_processed_task, mocker, fake_gql_client):
|
|
84
84
|
"""
|
|
85
85
|
Given: a set of raw inputs of summit-processed data and a ParseL0VbiInputData task
|
|
86
86
|
When: the task is run
|
|
87
87
|
Then: the observe frames are correctly identified and tagged
|
|
88
88
|
"""
|
|
89
89
|
mocker.patch(
|
|
90
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
90
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
91
91
|
)
|
|
92
92
|
parse_summit_processed_task()
|
|
93
93
|
|
|
@@ -109,14 +109,16 @@ def test_parse_summit_proccessed_data(parse_summit_processed_task, mocker):
|
|
|
109
109
|
assert filepath.exists()
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
def test_parse_summit_correctly_tagged_mosaic_subrepeats(
|
|
112
|
+
def test_parse_summit_correctly_tagged_mosaic_subrepeats(
|
|
113
|
+
parse_summit_task_with_subrepeats, mocker, fake_gql_client
|
|
114
|
+
):
|
|
113
115
|
"""
|
|
114
116
|
Given: A set of observe frames taken with subrepeats (i.e., multiple mosaics per DSPS repeat)
|
|
115
117
|
When: the parse task is run
|
|
116
118
|
Then: pipeline constants are correctly updated and the correct
|
|
117
119
|
"""
|
|
118
120
|
mocker.patch(
|
|
119
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
121
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
120
122
|
)
|
|
121
123
|
task = parse_summit_task_with_subrepeats
|
|
122
124
|
task()
|
|
@@ -7,16 +7,15 @@ from dkist_processing_common._util.scratch import WorkflowFileSystem
|
|
|
7
7
|
from dkist_processing_common.codecs.fits import fits_access_decoder
|
|
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_vbi.models.tags import VbiTag
|
|
13
12
|
from dkist_processing_vbi.parsers.vbi_l0_fits_access import VbiL0FitsAccess
|
|
14
13
|
from dkist_processing_vbi.tasks.process_summit_processed import GenerateL1SummitData
|
|
15
|
-
from dkist_processing_vbi.tests.conftest import ensure_all_inputs_used
|
|
16
|
-
from dkist_processing_vbi.tests.conftest import generate_compressed_214_l0_fits_frame
|
|
17
14
|
from dkist_processing_vbi.tests.conftest import Vbi122DarkFrames
|
|
18
15
|
from dkist_processing_vbi.tests.conftest import Vbi122SummitObserveFrames
|
|
19
16
|
from dkist_processing_vbi.tests.conftest import VbiConstantsDb
|
|
17
|
+
from dkist_processing_vbi.tests.conftest import ensure_all_inputs_used
|
|
18
|
+
from dkist_processing_vbi.tests.conftest import generate_compressed_214_l0_fits_frame
|
|
20
19
|
|
|
21
20
|
RNG = np.random.default_rng()
|
|
22
21
|
|
|
@@ -133,14 +132,14 @@ def process_summit_processed_with_aborted_last_mosaic(
|
|
|
133
132
|
task._purge()
|
|
134
133
|
|
|
135
134
|
|
|
136
|
-
def test_process_summit_data(process_summit_processed, mocker):
|
|
135
|
+
def test_process_summit_data(process_summit_processed, mocker, fake_gql_client):
|
|
137
136
|
"""
|
|
138
137
|
Given: a set of parsed input frames of summit-processed data and a GenerateL1SummitData task
|
|
139
138
|
When: the task is run
|
|
140
139
|
Then: the correct data-dependent L1 headers are added, an output tag is applied to each frame, and the input tag is removed
|
|
141
140
|
"""
|
|
142
141
|
mocker.patch(
|
|
143
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
142
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
144
143
|
)
|
|
145
144
|
task, expected_data, num_exp_per_step = process_summit_processed
|
|
146
145
|
task()
|
|
@@ -172,7 +171,7 @@ def test_process_summit_data(process_summit_processed, mocker):
|
|
|
172
171
|
|
|
173
172
|
|
|
174
173
|
def test_process_summit_data_with_aborted_last_mosaic(
|
|
175
|
-
process_summit_processed_with_aborted_last_mosaic, mocker
|
|
174
|
+
process_summit_processed_with_aborted_last_mosaic, mocker, fake_gql_client
|
|
176
175
|
):
|
|
177
176
|
"""
|
|
178
177
|
Given: a set of parsed input frames of summit-processed data that contain an aborted mosaic
|
|
@@ -180,7 +179,7 @@ def test_process_summit_data_with_aborted_last_mosaic(
|
|
|
180
179
|
Then: only frames from complete mosaics are pass through as "calibrated"
|
|
181
180
|
"""
|
|
182
181
|
mocker.patch(
|
|
183
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
182
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
184
183
|
)
|
|
185
184
|
(
|
|
186
185
|
task,
|
|
@@ -8,15 +8,14 @@ from dkist_processing_common.codecs.fits import fits_access_decoder
|
|
|
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
10
|
from dkist_processing_common.models.tags import Tag
|
|
11
|
-
from dkist_processing_common.tests.conftest import FakeGQLClient
|
|
12
11
|
|
|
13
12
|
from dkist_processing_vbi.models.tags import VbiTag
|
|
14
13
|
from dkist_processing_vbi.parsers.vbi_l0_fits_access import VbiL0FitsAccess
|
|
15
14
|
from dkist_processing_vbi.tasks.science import ScienceCalibration
|
|
16
|
-
from dkist_processing_vbi.tests.conftest import ensure_all_inputs_used
|
|
17
|
-
from dkist_processing_vbi.tests.conftest import generate_214_l0_fits_frame
|
|
18
15
|
from dkist_processing_vbi.tests.conftest import Vbi122ObserveFrames
|
|
19
16
|
from dkist_processing_vbi.tests.conftest import VbiConstantsDb
|
|
17
|
+
from dkist_processing_vbi.tests.conftest import ensure_all_inputs_used
|
|
18
|
+
from dkist_processing_vbi.tests.conftest import generate_214_l0_fits_frame
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
@pytest.fixture(scope="function")
|
|
@@ -111,14 +110,14 @@ def science_calibration_task(tmp_path, recipe_run_id, init_vbi_constants_db, abo
|
|
|
111
110
|
"abort_mosaic",
|
|
112
111
|
[pytest.param(False, id="Full set"), pytest.param(True, id="Aborted last mosaic")],
|
|
113
112
|
)
|
|
114
|
-
def test_science_calibration(science_calibration_task, mocker):
|
|
113
|
+
def test_science_calibration(science_calibration_task, mocker, fake_gql_client):
|
|
115
114
|
"""
|
|
116
115
|
Given: a set of parsed input observe frames, dark and gain calibrations, and a ScienceCalibration task
|
|
117
116
|
When: the task is run
|
|
118
117
|
Then: the science frames are processed, no exposures are averaged, and the array values are correct
|
|
119
118
|
"""
|
|
120
119
|
mocker.patch(
|
|
121
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
120
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
122
121
|
)
|
|
123
122
|
task, num_steps, num_exp_per_step, expected_num_mosaic_repeats = science_calibration_task
|
|
124
123
|
task()
|
|
@@ -18,8 +18,7 @@ def expected_constant_dict() -> dict:
|
|
|
18
18
|
@pytest.fixture(scope="function")
|
|
19
19
|
def vbi_science_task_with_constants(expected_constant_dict, recipe_run_id):
|
|
20
20
|
class Task(VbiTaskBase):
|
|
21
|
-
def run(self):
|
|
22
|
-
...
|
|
21
|
+
def run(self): ...
|
|
23
22
|
|
|
24
23
|
task = Task(
|
|
25
24
|
recipe_run_id=recipe_run_id,
|
|
@@ -10,7 +10,6 @@ from dkist_header_validator import spec122_validator
|
|
|
10
10
|
from dkist_header_validator import spec214_validator
|
|
11
11
|
from dkist_processing_common.codecs.fits import fits_array_encoder
|
|
12
12
|
from dkist_processing_common.models.tags import Tag
|
|
13
|
-
from dkist_processing_common.tests.conftest import FakeGQLClient
|
|
14
13
|
from dkist_service_configuration.logging import logger
|
|
15
14
|
|
|
16
15
|
from dkist_processing_vbi.models.constants import VbiConstants
|
|
@@ -105,14 +104,16 @@ def write_l1_task(calibrated_header, num_mosaic_repeats, camera_str: Literal["re
|
|
|
105
104
|
pytest.param(False, "red", id="Non-Mosaic"),
|
|
106
105
|
],
|
|
107
106
|
)
|
|
108
|
-
def test_write_l1_frame(
|
|
107
|
+
def test_write_l1_frame(
|
|
108
|
+
write_l1_task, num_mosaic_repeats, is_mosaic, camera_str, mocker, fake_gql_client
|
|
109
|
+
):
|
|
109
110
|
"""
|
|
110
111
|
:Given: a write L1 task
|
|
111
112
|
:When: running the task
|
|
112
113
|
:Then: no errors are raised
|
|
113
114
|
"""
|
|
114
115
|
mocker.patch(
|
|
115
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=
|
|
116
|
+
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
116
117
|
)
|
|
117
118
|
task = write_l1_task
|
|
118
119
|
task()
|
|
@@ -10,6 +10,7 @@ VBI: https://nso.edu/telescopes/dkist/instruments/vbi/
|
|
|
10
10
|
This workflow does *not* include the speckle reconstruction algorithms used in summit-calibrated data.
|
|
11
11
|
Instead, darks and gains are generated by averaging the raw darks and gains, and are then subtracted from the science frames.
|
|
12
12
|
"""
|
|
13
|
+
|
|
13
14
|
from dkist_processing_common.tasks import AssembleQualityData
|
|
14
15
|
from dkist_processing_common.tasks import PublishCatalogAndQualityMessages
|
|
15
16
|
from dkist_processing_common.tasks import QualityL1Metrics
|
|
@@ -10,6 +10,7 @@ In this case it is then transferred to the DKIST Data Center for packaging, but
|
|
|
10
10
|
To determine the type of calibrations applied, please inspect the `VBI__005` keyword in the FITS headers.
|
|
11
11
|
It will indicate whether frame selection, speckle imaging, or other calibration algorithms were applied.
|
|
12
12
|
"""
|
|
13
|
+
|
|
13
14
|
from dkist_processing_common.tasks import AssembleQualityData
|
|
14
15
|
from dkist_processing_common.tasks import PublishCatalogAndQualityMessages
|
|
15
16
|
from dkist_processing_common.tasks import QualityL1Metrics
|
|
@@ -4,6 +4,7 @@ Workflow for trial runs.
|
|
|
4
4
|
These runs send their outputs (as well as intermediate files) to an unpublished location so that
|
|
5
5
|
the DC, in coordination instrument scientists, can assess the performance of the pipeline.
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from dkist_processing_common.tasks import AssembleQualityData
|
|
8
9
|
from dkist_processing_common.tasks import CreateTrialAsdf
|
|
9
10
|
from dkist_processing_common.tasks import CreateTrialDatasetInventory
|