dkist-processing-dlnirsp 0.32.8__py3-none-any.whl → 0.33.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.
- dkist_processing_dlnirsp/models/constants.py +6 -0
- dkist_processing_dlnirsp/models/parameters.py +33 -3
- dkist_processing_dlnirsp/parsers/task.py +2 -25
- dkist_processing_dlnirsp/parsers/time.py +2 -2
- dkist_processing_dlnirsp/tasks/__init__.py +1 -2
- dkist_processing_dlnirsp/tasks/movie.py +1121 -0
- dkist_processing_dlnirsp/tasks/parse.py +13 -8
- dkist_processing_dlnirsp/tasks/solar.py +129 -30
- dkist_processing_dlnirsp/tests/conftest.py +46 -7
- dkist_processing_dlnirsp/tests/local_trial_workflows/l0_polcals_as_science.py +21 -18
- dkist_processing_dlnirsp/tests/local_trial_workflows/l0_solar_gain_as_science.py +21 -18
- dkist_processing_dlnirsp/tests/local_trial_workflows/l0_to_l1.py +21 -18
- dkist_processing_dlnirsp/tests/local_trial_workflows/local_trial_dev_mockers.py +1 -1
- dkist_processing_dlnirsp/tests/test_dlnirsp_constants.py +2 -0
- dkist_processing_dlnirsp/tests/test_movie.py +141 -0
- dkist_processing_dlnirsp/tests/test_parameters.py +8 -0
- dkist_processing_dlnirsp/tests/test_parse.py +10 -0
- dkist_processing_dlnirsp/tests/test_science.py +0 -9
- dkist_processing_dlnirsp/tests/test_solar.py +114 -17
- dkist_processing_dlnirsp/tests/test_wavelength_calibration.py +4 -1
- dkist_processing_dlnirsp/workflows/l0_processing.py +6 -8
- dkist_processing_dlnirsp/workflows/trial_workflow.py +7 -7
- {dkist_processing_dlnirsp-0.32.8.dist-info → dkist_processing_dlnirsp-0.33.0.dist-info}/METADATA +52 -35
- {dkist_processing_dlnirsp-0.32.8.dist-info → dkist_processing_dlnirsp-0.33.0.dist-info}/RECORD +28 -30
- docs/gain.rst +7 -3
- dkist_processing_dlnirsp/tasks/assemble_movie.py +0 -150
- dkist_processing_dlnirsp/tasks/make_movie_frames.py +0 -156
- dkist_processing_dlnirsp/tests/test_assemble_movie.py +0 -169
- dkist_processing_dlnirsp/tests/test_make_movie_frames.py +0 -98
- {dkist_processing_dlnirsp-0.32.8.dist-info → dkist_processing_dlnirsp-0.33.0.dist-info}/WHEEL +0 -0
- {dkist_processing_dlnirsp-0.32.8.dist-info → dkist_processing_dlnirsp-0.33.0.dist-info}/entry_points.txt +0 -0
- {dkist_processing_dlnirsp-0.32.8.dist-info → dkist_processing_dlnirsp-0.33.0.dist-info}/top_level.txt +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from astropy.io import fits
|
|
3
|
-
from dkist_processing_common._util.scratch import WorkflowFileSystem
|
|
4
|
-
|
|
5
|
-
from dkist_processing_dlnirsp.models.tags import DlnirspTag
|
|
6
|
-
from dkist_processing_dlnirsp.tasks.make_movie_frames import MakeDlnirspMovieFrames
|
|
7
|
-
from dkist_processing_dlnirsp.tests.conftest import DlnirspTestingConstants
|
|
8
|
-
from dkist_processing_dlnirsp.tests.conftest import write_calibrated_frames_to_task
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def make_movie_task(recipe_run_id, is_polarimetric, link_constants_db, tmp_path):
|
|
13
|
-
dither_mode_on = True
|
|
14
|
-
num_mosaics = 3
|
|
15
|
-
num_X_tiles = 2
|
|
16
|
-
num_Y_tiles = 1
|
|
17
|
-
|
|
18
|
-
constants_db = DlnirspTestingConstants(
|
|
19
|
-
NUM_MOSAIC_REPEATS=num_mosaics,
|
|
20
|
-
NUM_MOSAIC_TILES_X=num_X_tiles,
|
|
21
|
-
NUM_MOSAIC_TILES_Y=num_Y_tiles,
|
|
22
|
-
NUM_DITHER_STEPS=int(dither_mode_on) + 1,
|
|
23
|
-
POLARIMETER_MODE="Full Stokes" if is_polarimetric else "Stokes I",
|
|
24
|
-
)
|
|
25
|
-
link_constants_db(recipe_run_id, constants_db)
|
|
26
|
-
|
|
27
|
-
with MakeDlnirspMovieFrames(
|
|
28
|
-
recipe_run_id=recipe_run_id,
|
|
29
|
-
workflow_name="workflow_name",
|
|
30
|
-
workflow_version="workflow_version",
|
|
31
|
-
) as task:
|
|
32
|
-
task.scratch = WorkflowFileSystem(scratch_base_path=tmp_path, recipe_run_id=recipe_run_id)
|
|
33
|
-
|
|
34
|
-
yield task, num_mosaics, dither_mode_on, num_X_tiles, num_Y_tiles
|
|
35
|
-
task._purge()
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
@pytest.mark.parametrize(
|
|
39
|
-
"is_polarimetric",
|
|
40
|
-
[pytest.param(True, id="polarimetric"), pytest.param(False, id="spectrographic")],
|
|
41
|
-
)
|
|
42
|
-
def test_make_movie_frames(
|
|
43
|
-
make_movie_task, is_polarimetric, link_constants_db, mocker, fake_gql_client
|
|
44
|
-
):
|
|
45
|
-
"""
|
|
46
|
-
Given: A Make Movie Frames task and some calibrated Science frames
|
|
47
|
-
When: Running the task
|
|
48
|
-
Then: The correct number of movie frames are produced and they have the correct shape (depending on polarimetric or not)
|
|
49
|
-
"""
|
|
50
|
-
mocker.patch(
|
|
51
|
-
"dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient", new=fake_gql_client
|
|
52
|
-
)
|
|
53
|
-
task, num_mosaics, dither_mode_on, num_X_tiles, num_Y_tiles = make_movie_task
|
|
54
|
-
|
|
55
|
-
num_dither = int(dither_mode_on) + 1
|
|
56
|
-
wave_size = 3
|
|
57
|
-
X_size = 4
|
|
58
|
-
Y_size = 5
|
|
59
|
-
write_calibrated_frames_to_task(
|
|
60
|
-
task,
|
|
61
|
-
num_mosaics=num_mosaics,
|
|
62
|
-
num_X_tiles=num_X_tiles,
|
|
63
|
-
num_Y_tiles=num_Y_tiles,
|
|
64
|
-
is_polarimetric=is_polarimetric,
|
|
65
|
-
array_shape=(wave_size, X_size, Y_size),
|
|
66
|
-
dither_mode_on=dither_mode_on,
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
task()
|
|
70
|
-
|
|
71
|
-
if is_polarimetric:
|
|
72
|
-
expected_movie_frame_shape = (X_size * 2, Y_size * 2)
|
|
73
|
-
else:
|
|
74
|
-
expected_movie_frame_shape = (X_size, Y_size)
|
|
75
|
-
|
|
76
|
-
all_movie_frames = list(task.read([DlnirspTag.movie_frame()]))
|
|
77
|
-
assert len(all_movie_frames) == num_dither * num_mosaics * num_X_tiles * num_Y_tiles
|
|
78
|
-
|
|
79
|
-
for mosaic in range(num_mosaics):
|
|
80
|
-
for dither in range(num_dither):
|
|
81
|
-
for X_tile in range(1, num_X_tiles + 1):
|
|
82
|
-
for Y_tile in range(1, num_Y_tiles + 1):
|
|
83
|
-
single_frame = list(
|
|
84
|
-
task.read(
|
|
85
|
-
[
|
|
86
|
-
DlnirspTag.movie_frame(),
|
|
87
|
-
DlnirspTag.mosaic_num(mosaic),
|
|
88
|
-
DlnirspTag.dither_step(dither),
|
|
89
|
-
DlnirspTag.mosaic_tile_x(X_tile),
|
|
90
|
-
DlnirspTag.mosaic_tile_y(Y_tile),
|
|
91
|
-
]
|
|
92
|
-
)
|
|
93
|
-
)
|
|
94
|
-
assert len(single_frame) == 1
|
|
95
|
-
hdul = fits.open(single_frame[0])
|
|
96
|
-
assert len(hdul) == 1
|
|
97
|
-
data = hdul[0].data
|
|
98
|
-
assert data.shape == expected_movie_frame_shape
|
{dkist_processing_dlnirsp-0.32.8.dist-info → dkist_processing_dlnirsp-0.33.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|