dkist-processing-common 10.6.4__py3-none-any.whl → 10.7.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_common/tasks/write_l1.py +16 -12
- dkist_processing_common/tests/conftest.py +1 -1
- dkist_processing_common/tests/test_fits_access.py +1 -1
- dkist_processing_common/tests/test_write_l1.py +4 -0
- {dkist_processing_common-10.6.4.dist-info → dkist_processing_common-10.7.0.dist-info}/METADATA +1 -1
- {dkist_processing_common-10.6.4.dist-info → dkist_processing_common-10.7.0.dist-info}/RECORD +8 -8
- {dkist_processing_common-10.6.4.dist-info → dkist_processing_common-10.7.0.dist-info}/WHEEL +0 -0
- {dkist_processing_common-10.6.4.dist-info → dkist_processing_common-10.7.0.dist-info}/top_level.txt +0 -0
|
@@ -18,7 +18,7 @@ from dkist_fits_specifications import __version__ as spec_version
|
|
|
18
18
|
from dkist_fits_specifications.utils.formatter import reformat_spec214_header
|
|
19
19
|
from dkist_header_validator import spec214_validator
|
|
20
20
|
from dkist_header_validator.translator import remove_extra_axis_keys
|
|
21
|
-
from dkist_header_validator.translator import
|
|
21
|
+
from dkist_header_validator.translator import remove_spec_122_keys_and_spec_214_l0_keys
|
|
22
22
|
from dkist_spectral_lines.search import get_closest_spectral_line
|
|
23
23
|
from dkist_spectral_lines.search import get_spectral_lines
|
|
24
24
|
from scipy.stats import kurtosis
|
|
@@ -102,7 +102,9 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
|
|
|
102
102
|
|
|
103
103
|
# Check that the written file passes spec 214 validation if requested
|
|
104
104
|
if self.validate_l1_on_write:
|
|
105
|
-
spec214_validator.validate(
|
|
105
|
+
spec214_validator.validate(
|
|
106
|
+
self.scratch.absolute_path(relative_path), extra=False
|
|
107
|
+
)
|
|
106
108
|
|
|
107
109
|
@cached_property
|
|
108
110
|
def tile_size_param(self) -> int | None:
|
|
@@ -170,19 +172,21 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
|
|
|
170
172
|
def add_stats_headers(header: fits.Header, data: np.ndarray) -> fits.Header:
|
|
171
173
|
"""Fill out the spec 214 statistics header table."""
|
|
172
174
|
data = data.flatten()
|
|
173
|
-
percentiles = np.nanpercentile(data, [1, 10, 25, 75, 90, 95, 98, 99])
|
|
175
|
+
percentiles = np.nanpercentile(data, [1, 2, 5, 10, 25, 75, 90, 95, 98, 99])
|
|
174
176
|
header["DATAMIN"] = np.nanmin(data)
|
|
175
177
|
header["DATAMAX"] = np.nanmax(data)
|
|
176
178
|
header["DATAMEAN"] = np.nanmean(data)
|
|
177
179
|
header["DATAMEDN"] = np.nanmedian(data)
|
|
178
|
-
header["
|
|
179
|
-
header["
|
|
180
|
-
header["
|
|
181
|
-
header["
|
|
182
|
-
header["
|
|
183
|
-
header["
|
|
184
|
-
header["
|
|
185
|
-
header["
|
|
180
|
+
header["DATAP01"] = percentiles[0]
|
|
181
|
+
header["DATAP02"] = percentiles[1]
|
|
182
|
+
header["DATAP05"] = percentiles[2]
|
|
183
|
+
header["DATAP10"] = percentiles[3]
|
|
184
|
+
header["DATAP25"] = percentiles[4]
|
|
185
|
+
header["DATAP75"] = percentiles[5]
|
|
186
|
+
header["DATAP90"] = percentiles[6]
|
|
187
|
+
header["DATAP95"] = percentiles[7]
|
|
188
|
+
header["DATAP98"] = percentiles[8]
|
|
189
|
+
header["DATAP99"] = percentiles[9]
|
|
186
190
|
header["DATARMS"] = np.sqrt(np.nanmean(data**2))
|
|
187
191
|
header["DATAKURT"] = kurtosis(data, nan_policy="omit")
|
|
188
192
|
header["DATASKEW"] = skew(data, nan_policy="omit")
|
|
@@ -378,7 +382,7 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
|
|
|
378
382
|
# Add the dataset headers (abstract - implement in instrument task)
|
|
379
383
|
header = self.add_dataset_headers(header=header, stokes=stokes_param)
|
|
380
384
|
# Remove any headers not contained in spec 214
|
|
381
|
-
header =
|
|
385
|
+
header = remove_spec_122_keys_and_spec_214_l0_keys(input_headers=header)
|
|
382
386
|
# Remove any keys referring to axes that don't exist
|
|
383
387
|
header = remove_extra_axis_keys(input_headers=header)
|
|
384
388
|
return header
|
|
@@ -113,7 +113,7 @@ class CommonDataset(Spec122Dataset):
|
|
|
113
113
|
self.add_constant_key("TELEVATN", 6.28)
|
|
114
114
|
self.add_constant_key("TAZIMUTH", 3.14)
|
|
115
115
|
self.add_constant_key("TTBLANGL", 1.23)
|
|
116
|
-
self.add_constant_key("
|
|
116
|
+
self.add_constant_key("VISP_012", "bar")
|
|
117
117
|
self.add_constant_key("DKIST004", "observe")
|
|
118
118
|
self.add_constant_key("ID___005", "ip id")
|
|
119
119
|
self.add_constant_key("PAC__004", "Sapphire Polarizer")
|
|
@@ -220,7 +220,7 @@ def test_as_subclass(hdu_with_complete_common_header):
|
|
|
220
220
|
class InstFitsAccess(L0FitsAccess):
|
|
221
221
|
def __init__(self, hdu, name):
|
|
222
222
|
super().__init__(hdu, name)
|
|
223
|
-
self.foo: str = self.header["
|
|
223
|
+
self.foo: str = self.header["VISP_012"]
|
|
224
224
|
|
|
225
225
|
fits_obj = InstFitsAccess(hdu_with_complete_common_header, name="foo")
|
|
226
226
|
assert fits_obj.foo == "bar"
|
|
@@ -135,6 +135,7 @@ def write_l1_task(request, recipe_run_id, tmp_path):
|
|
|
135
135
|
stokes_params = ["I", "Q", "U", "V"]
|
|
136
136
|
used_stokes_params = []
|
|
137
137
|
hdu = fits.PrimaryHDU(data=np.random.random(size=(1, 128, 128)) * 10, header=header)
|
|
138
|
+
hdu.header["IPTASK"] = "level0_only key to be removed"
|
|
138
139
|
hdul = fits.HDUList([hdu])
|
|
139
140
|
for i in range(num_of_stokes_params):
|
|
140
141
|
task.write(
|
|
@@ -279,6 +280,9 @@ def test_write_l1_frame(
|
|
|
279
280
|
# Test that FRAMEVOL still has its comment
|
|
280
281
|
assert hdu.header.comments["FRAMEVOL"]
|
|
281
282
|
|
|
283
|
+
# Test that 'level0_only' keys are being removed
|
|
284
|
+
assert "IPTASK" not in hdu.header.keys()
|
|
285
|
+
|
|
282
286
|
|
|
283
287
|
def test_replace_header_values(write_l1_task):
|
|
284
288
|
"""
|
{dkist_processing_common-10.6.4.dist-info → dkist_processing_common-10.7.0.dist-info}/RECORD
RENAMED
|
@@ -58,7 +58,7 @@ dkist_processing_common/tasks/teardown.py,sha256=e4LKnphJDYDVDAez2tH7MxpZgCmxYsK
|
|
|
58
58
|
dkist_processing_common/tasks/transfer_input_data.py,sha256=afEW0glpCFMZRj90nFtQo_4XOQ4CuoOh86jahP6a-a0,5548
|
|
59
59
|
dkist_processing_common/tasks/trial_catalog.py,sha256=Y3DKstRfMS8nWWtJFMB0MUVPlZ1jWS_2jhJGMWwxy50,8748
|
|
60
60
|
dkist_processing_common/tasks/trial_output_data.py,sha256=aI_aRuu0qVO8zFGrr_9baxx9i3jUEHZSmsmbO6ytlkE,6960
|
|
61
|
-
dkist_processing_common/tasks/write_l1.py,sha256=
|
|
61
|
+
dkist_processing_common/tasks/write_l1.py,sha256=Jw8zQjlYjBQru3m1SB_ZDmicMkDRiUihy9VdwehvZc0,22683
|
|
62
62
|
dkist_processing_common/tasks/mixin/__init__.py,sha256=-g-DQbU7m1bclJYuFe3Yh757V-35GIDTbstardKQ7nU,68
|
|
63
63
|
dkist_processing_common/tasks/mixin/globus.py,sha256=QAV8VElxMAqxJ2KSB_bJaraceovYfjHXjOdocrTCkIA,6592
|
|
64
64
|
dkist_processing_common/tasks/mixin/input_dataset.py,sha256=dkW5vf_QPgWedHO_Lf9GjBxr1QrUCKs6gIXufUTi7GE,6813
|
|
@@ -69,14 +69,14 @@ dkist_processing_common/tasks/mixin/quality/__init__.py,sha256=Bgu-DHW7yXLiehgll
|
|
|
69
69
|
dkist_processing_common/tasks/mixin/quality/_base.py,sha256=nZ9IC-O-hsLXa5-tk29B13CZyQIdhJCv0eO9cdkAhWc,8303
|
|
70
70
|
dkist_processing_common/tasks/mixin/quality/_metrics.py,sha256=WenTfa12guIUfm0GzkrK2gduKaOHs03e6RhE6j37Les,54304
|
|
71
71
|
dkist_processing_common/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
|
-
dkist_processing_common/tests/conftest.py,sha256=
|
|
72
|
+
dkist_processing_common/tests/conftest.py,sha256=h_ObhpXb1S0-db0Je8XoHNLkrXxXW_0B0TMhbnbDjMo,30160
|
|
73
73
|
dkist_processing_common/tests/test_assemble_movie.py,sha256=XY_ruXSYP5k6s2gUAwlFdnhJ81eyWLSd2O9IkX4RXeo,4165
|
|
74
74
|
dkist_processing_common/tests/test_assemble_quality.py,sha256=fWSHK4UdVqgNjvxQuD40NBUnXrtmthUP7PUbISPV4MQ,16897
|
|
75
75
|
dkist_processing_common/tests/test_base.py,sha256=4ST3__jEHitEQaQs9-0OcqtyEJfIjZsk_6PRYZFV2-U,7124
|
|
76
76
|
dkist_processing_common/tests/test_codecs.py,sha256=9Ln8FJs319rbHpCukO9lKLk3aDrdyDREjA4nCHsxDCA,20796
|
|
77
77
|
dkist_processing_common/tests/test_constants.py,sha256=Kc9k5TdYy5QkRRlGav6kfI2dy5HHKqtpf9qOuaAfDZU,5903
|
|
78
78
|
dkist_processing_common/tests/test_cs_step.py,sha256=RA0QD3D8eaL3YSOL_gIJ9wkngy14RQ2jbD-05KAziW4,2408
|
|
79
|
-
dkist_processing_common/tests/test_fits_access.py,sha256=
|
|
79
|
+
dkist_processing_common/tests/test_fits_access.py,sha256=aqJ2oBWxEP4PzKfe4fiaGxvfjB9Fvt2f0Owp9XFW-rw,10946
|
|
80
80
|
dkist_processing_common/tests/test_flower_pot.py,sha256=X9_UI3maa3ZQncV3jYHgovWnawDsdEkEB5vw6EAB96o,3151
|
|
81
81
|
dkist_processing_common/tests/test_input_dataset.py,sha256=AI5uqaDea4kOwpwAU5qQdzUbxMpBwD20YCAvB7nzD5o,18766
|
|
82
82
|
dkist_processing_common/tests/test_interservice_bus.py,sha256=M_iv2CLmx5TnCB1VUN4YjkQ2LEUjfCKk7-ZlkV62XEQ,3000
|
|
@@ -100,7 +100,7 @@ dkist_processing_common/tests/test_transfer_l1_output_data.py,sha256=27PifkyH3RZ
|
|
|
100
100
|
dkist_processing_common/tests/test_trial_catalog.py,sha256=SZ-nyn0MXU9Lkg_94FbKER_cwiGoi06GYlzF_3AmvKg,6802
|
|
101
101
|
dkist_processing_common/tests/test_trial_output_data.py,sha256=cBCj0kXyF5NEMzKh6zPVksdoXyE8ju1opJgWgjdcJWA,12790
|
|
102
102
|
dkist_processing_common/tests/test_workflow_task_base.py,sha256=Z5aPW5LQtS0UWJiYho4X0r-2gPLfzpkmMwfmaoFLjMg,10517
|
|
103
|
-
dkist_processing_common/tests/test_write_l1.py,sha256=
|
|
103
|
+
dkist_processing_common/tests/test_write_l1.py,sha256=R_ljJdSC4hCHS_mLV6rKE7PVfpDWCaMXoN6n45QJNWM,21951
|
|
104
104
|
docs/Makefile,sha256=qnlVz6PuBqE39NfHWuUnHhNEA-EFgT2-WJNNNy9ttfk,4598
|
|
105
105
|
docs/changelog.rst,sha256=S2jPASsWlQxSlAPqdvNrYvhk9k3FcFWNXFNDYXBSjl4,120
|
|
106
106
|
docs/conf.py,sha256=FkX575cqTqZGCcLAjg2MlvE8Buj1Vt3CpHNgZxG256E,1890
|
|
@@ -109,7 +109,7 @@ docs/landing_page.rst,sha256=aPAuXFhBx73lEZ59B6E6JXxkK0LlxzD0n-HXqHrfumQ,746
|
|
|
109
109
|
docs/make.bat,sha256=mBAhtURwhQ7yc95pqwJzlhqBSvRknr1aqZ5s8NKvdKs,4513
|
|
110
110
|
docs/requirements.txt,sha256=Kbl_X4c7RQZw035YTeNB63We6I7pvXFU4T0Uflp2yDY,29
|
|
111
111
|
licenses/LICENSE.rst,sha256=piZaQplkzOMmH1NXg6QIdo9wwo9pPCoHkvm2-DmH76E,1462
|
|
112
|
-
dkist_processing_common-10.
|
|
113
|
-
dkist_processing_common-10.
|
|
114
|
-
dkist_processing_common-10.
|
|
115
|
-
dkist_processing_common-10.
|
|
112
|
+
dkist_processing_common-10.7.0.dist-info/METADATA,sha256=4YcNp2PrDZuC5FpxD_2Wr9Zo92EqvXbUYr6GC9t-QEY,7154
|
|
113
|
+
dkist_processing_common-10.7.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
114
|
+
dkist_processing_common-10.7.0.dist-info/top_level.txt,sha256=LJhd1W-Vn90K8HnQDIE4r52YDpUjjMWDnllAWHBByW0,48
|
|
115
|
+
dkist_processing_common-10.7.0.dist-info/RECORD,,
|
|
File without changes
|
{dkist_processing_common-10.6.4.dist-info → dkist_processing_common-10.7.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|