dkist-processing-common 10.6.3__tar.gz → 10.7.0__tar.gz

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.
Files changed (126) hide show
  1. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/CHANGELOG.rst +32 -0
  2. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/PKG-INFO +1 -1
  3. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/bitbucket-pipelines.yml +1 -1
  4. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/write_l1.py +22 -17
  5. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/conftest.py +1 -1
  6. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_fits_access.py +1 -1
  7. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_transfer_input_data.py +6 -4
  8. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_write_l1.py +30 -0
  9. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common.egg-info/PKG-INFO +1 -1
  10. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/pyproject.toml +1 -1
  11. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/.gitignore +0 -0
  12. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/.pre-commit-config.yaml +0 -0
  13. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/.readthedocs.yml +0 -0
  14. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/.snyk +0 -0
  15. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/README.rst +0 -0
  16. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/changelog/.gitempty +0 -0
  17. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/__init__.py +0 -0
  18. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/_util/__init__.py +0 -0
  19. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/_util/constants.py +0 -0
  20. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/_util/graphql.py +0 -0
  21. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/_util/scratch.py +0 -0
  22. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/_util/tags.py +0 -0
  23. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/__init__.py +0 -0
  24. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/asdf.py +0 -0
  25. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/bytes.py +0 -0
  26. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/fits.py +0 -0
  27. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/iobase.py +0 -0
  28. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/json.py +0 -0
  29. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/path.py +0 -0
  30. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/quality.py +0 -0
  31. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/codecs/str.py +0 -0
  32. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/config.py +0 -0
  33. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/fonts/Lato-Regular.ttf +0 -0
  34. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/fonts/__init__.py +0 -0
  35. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/manual.py +0 -0
  36. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/__init__.py +0 -0
  37. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/constants.py +0 -0
  38. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/fits_access.py +0 -0
  39. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/flower_pot.py +0 -0
  40. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/graphql.py +0 -0
  41. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/message.py +0 -0
  42. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/message_queue_binding.py +0 -0
  43. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/metric_code.py +0 -0
  44. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/parameters.py +0 -0
  45. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/quality.py +0 -0
  46. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/tags.py +0 -0
  47. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/task_name.py +0 -0
  48. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/models/wavelength.py +0 -0
  49. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/__init__.py +0 -0
  50. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/cs_step.py +0 -0
  51. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/dsps_repeat.py +0 -0
  52. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/experiment_id_bud.py +0 -0
  53. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/id_bud.py +0 -0
  54. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/l0_fits_access.py +0 -0
  55. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/l1_fits_access.py +0 -0
  56. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/near_bud.py +0 -0
  57. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/proposal_id_bud.py +0 -0
  58. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/quality.py +0 -0
  59. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/retarder.py +0 -0
  60. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/single_value_single_key_flower.py +0 -0
  61. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/task.py +0 -0
  62. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/time.py +0 -0
  63. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/unique_bud.py +0 -0
  64. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/parsers/wavelength.py +0 -0
  65. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/__init__.py +0 -0
  66. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/assemble_movie.py +0 -0
  67. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/base.py +0 -0
  68. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/l1_output_data.py +0 -0
  69. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/__init__.py +0 -0
  70. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/globus.py +0 -0
  71. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/input_dataset.py +0 -0
  72. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/interservice_bus.py +0 -0
  73. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/metadata_store.py +0 -0
  74. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/object_store.py +0 -0
  75. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/quality/__init__.py +0 -0
  76. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/quality/_base.py +0 -0
  77. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/mixin/quality/_metrics.py +0 -0
  78. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/output_data_base.py +0 -0
  79. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/parse_l0_input_data.py +0 -0
  80. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/quality_metrics.py +0 -0
  81. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/teardown.py +0 -0
  82. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/transfer_input_data.py +0 -0
  83. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/trial_catalog.py +0 -0
  84. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tasks/trial_output_data.py +0 -0
  85. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/__init__.py +0 -0
  86. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_assemble_movie.py +0 -0
  87. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_assemble_quality.py +0 -0
  88. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_base.py +0 -0
  89. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_codecs.py +0 -0
  90. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_constants.py +0 -0
  91. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_cs_step.py +0 -0
  92. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_flower_pot.py +0 -0
  93. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_input_dataset.py +0 -0
  94. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_interservice_bus.py +0 -0
  95. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_interservice_bus_mixin.py +0 -0
  96. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_manual_processing.py +0 -0
  97. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_output_data_base.py +0 -0
  98. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_parameters.py +0 -0
  99. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_parse_l0_input_data.py +0 -0
  100. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_publish_catalog_messages.py +0 -0
  101. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_quality.py +0 -0
  102. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_quality_mixin.py +0 -0
  103. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_scratch.py +0 -0
  104. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_stems.py +0 -0
  105. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_submit_dataset_metadata.py +0 -0
  106. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_tags.py +0 -0
  107. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_task_name.py +0 -0
  108. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_task_parsing.py +0 -0
  109. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_teardown.py +0 -0
  110. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_transfer_l1_output_data.py +0 -0
  111. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_trial_catalog.py +0 -0
  112. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_trial_output_data.py +0 -0
  113. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common/tests/test_workflow_task_base.py +0 -0
  114. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common.egg-info/SOURCES.txt +0 -0
  115. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common.egg-info/dependency_links.txt +0 -0
  116. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common.egg-info/requires.txt +0 -0
  117. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/dkist_processing_common.egg-info/top_level.txt +0 -0
  118. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/Makefile +0 -0
  119. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/changelog.rst +0 -0
  120. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/conf.py +0 -0
  121. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/index.rst +0 -0
  122. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/landing_page.rst +0 -0
  123. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/make.bat +0 -0
  124. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/docs/requirements.txt +0 -0
  125. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/licenses/LICENSE.rst +0 -0
  126. {dkist_processing_common-10.6.3 → dkist_processing_common-10.7.0}/setup.cfg +0 -0
@@ -1,3 +1,35 @@
1
+ v10.7.0 (2025-04-14)
2
+ ====================
3
+
4
+ Features
5
+ --------
6
+
7
+ - New data percentiles are added to the headers to make the range symmetric. (`#242 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/242>`__)
8
+ - L1 headers are now created by removing only the keys listed in SPEC-122 as opposed to removing all keys not present in SPEC-214. In addition, any SPEC-214 keys marked as `level0_only` are removed. This will allow spurious header keys to be discovered more easily. (`#246 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/246>`__)
9
+
10
+
11
+ Bugfixes
12
+ --------
13
+
14
+ - Header keys that write the percentiles of the data are now correctly named (from DATA<pp> to DATAP<pp>). (`#242 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/242>`__)
15
+
16
+
17
+ Misc
18
+ ----
19
+
20
+ - Prevent header keys from being included if they are not a part of the Level 1 SPEC-0214 specification. (`#242 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/242>`__)
21
+ - Add missing build dependency specifications. (`#247 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/247>`__)
22
+
23
+
24
+ v10.6.4 (2025-03-31)
25
+ ====================
26
+
27
+ Bugfixes
28
+ --------
29
+
30
+ - Allow input dataset IDs to be conditionally written into the L1 data headers. (`#243 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/243>`__)
31
+
32
+
1
33
  v10.6.3 (2025-03-27)
2
34
  ====================
3
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dkist-processing-common
3
- Version: 10.6.3
3
+ Version: 10.7.0
4
4
  Summary: Common task classes used by the DKIST science data processing pipelines
5
5
  Author-email: NSO / AURA <dkistdc@nso.edu>
6
6
  License: BSD-3-Clause
@@ -45,7 +45,7 @@ definitions:
45
45
  - pip
46
46
  name: Test
47
47
  script:
48
- - pip install -U pip
48
+ - pip install -U pip wheel build setuptools_scm setuptools
49
49
  - pip install .[test]
50
50
  - pytest -v -n auto -m "not development" --cov dkist_processing_common --cov-report=xml --cov-report=term-missing
51
51
  - ./ci_scripts/latest/execute_script.sh upload_coverage.sh
@@ -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 sanitize_to_spec214_level1
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(self.scratch.absolute_path(relative_path))
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["DATA01"] = percentiles[0]
179
- header["DATA10"] = percentiles[1]
180
- header["DATA25"] = percentiles[2]
181
- header["DATA75"] = percentiles[3]
182
- header["DATA90"] = percentiles[4]
183
- header["DATA95"] = percentiles[5]
184
- header["DATA98"] = percentiles[6]
185
- header["DATA99"] = percentiles[7]
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")
@@ -214,11 +218,12 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
214
218
  header["CADMAX"] = self.constants.maximum_cadence
215
219
  header["CADVAR"] = self.constants.variance_cadence
216
220
  # Keywords to support reprocessing
217
- if ids_par_id := self.metadata_store_input_dataset_parameters.inputDatasetPartId:
218
- header["IDSPARID"] = ids_par_id
219
- header["IDSOBSID"] = self.metadata_store_input_dataset_observe_frames.inputDatasetPartId
220
- if ids_cal_id := self.metadata_store_input_dataset_calibration_frames.inputDatasetPartId:
221
- header["IDSCALID"] = ids_cal_id
221
+ if parameters := self.metadata_store_input_dataset_parameters:
222
+ header["IDSPARID"] = parameters.inputDatasetPartId
223
+ if observe_frames := self.metadata_store_input_dataset_observe_frames:
224
+ header["IDSOBSID"] = observe_frames.inputDatasetPartId
225
+ if calibration_frames := self.metadata_store_input_dataset_calibration_frames:
226
+ header["IDSCALID"] = calibration_frames.inputDatasetPartId
222
227
  header["WKFLNAME"] = self.workflow_name
223
228
  header["WKFLVERS"] = self.workflow_version
224
229
  header = self.add_contributing_id_headers(header=header)
@@ -377,7 +382,7 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
377
382
  # Add the dataset headers (abstract - implement in instrument task)
378
383
  header = self.add_dataset_headers(header=header, stokes=stokes_param)
379
384
  # Remove any headers not contained in spec 214
380
- header = sanitize_to_spec214_level1(input_headers=header)
385
+ header = remove_spec_122_keys_and_spec_214_l0_keys(input_headers=header)
381
386
  # Remove any keys referring to axes that don't exist
382
387
  header = remove_extra_axis_keys(input_headers=header)
383
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("INST_FOO", "bar")
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["INST_FOO"]
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"
@@ -6,6 +6,7 @@ import pytest
6
6
 
7
7
  from dkist_processing_common._util.scratch import WorkflowFileSystem
8
8
  from dkist_processing_common.codecs.json import json_decoder
9
+ from dkist_processing_common.models.graphql import InputDatasetRecipeRunResponse
9
10
  from dkist_processing_common.models.tags import Tag
10
11
  from dkist_processing_common.tasks.transfer_input_data import TransferL0Data
11
12
  from dkist_processing_common.tests.conftest import create_parameter_files
@@ -17,13 +18,14 @@ class TransferL0DataTask(TransferL0Data):
17
18
  ...
18
19
 
19
20
 
20
- class FakeGQLClientMissingPart(FakeGQLClient):
21
+ class FakeGQLClientMissingInputDatasetPart(FakeGQLClient):
21
22
  """Same metadata mocker with calibration input dataset part missing."""
22
23
 
23
24
  def execute_gql_query(self, **kwargs):
24
25
  original_response = super().execute_gql_query(**kwargs)
25
- # Remove calibration frames part
26
- del original_response[0].recipeInstance.inputDataset.inputDatasetInputDatasetParts[2]
26
+ # Remove calibration frames part if getting InputDatasetRecipeRunResponse:
27
+ if kwargs.get("query_response_cls") == InputDatasetRecipeRunResponse:
28
+ del original_response[0].recipeInstance.inputDataset.inputDatasetInputDatasetParts[2]
27
29
  return original_response
28
30
 
29
31
 
@@ -53,7 +55,7 @@ def transfer_l0_data_task(recipe_run_id, tmp_path, mocker):
53
55
  @pytest.fixture
54
56
  def transfer_l0_data_task_missing_part(recipe_run_id, tmp_path, mocker):
55
57
  yield from _transfer_l0_data_task_with_client(
56
- recipe_run_id, tmp_path, mocker, FakeGQLClientMissingPart
58
+ recipe_run_id, tmp_path, mocker, FakeGQLClientMissingInputDatasetPart
57
59
  )
58
60
 
59
61
 
@@ -24,6 +24,9 @@ from dkist_processing_common.models.wavelength import WavelengthRange
24
24
  from dkist_processing_common.tasks.write_l1 import WriteL1Frame
25
25
  from dkist_processing_common.tests.conftest import FakeGQLClient
26
26
  from dkist_processing_common.tests.conftest import TILE_SIZE
27
+ from dkist_processing_common.tests.test_transfer_input_data import (
28
+ FakeGQLClientMissingInputDatasetPart,
29
+ )
27
30
 
28
31
 
29
32
  class FakeGQLClientDefaultRecipeConfiguration(FakeGQLClient):
@@ -132,6 +135,7 @@ def write_l1_task(request, recipe_run_id, tmp_path):
132
135
  stokes_params = ["I", "Q", "U", "V"]
133
136
  used_stokes_params = []
134
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"
135
139
  hdul = fits.HDUList([hdu])
136
140
  for i in range(num_of_stokes_params):
137
141
  task.write(
@@ -276,6 +280,9 @@ def test_write_l1_frame(
276
280
  # Test that FRAMEVOL still has its comment
277
281
  assert hdu.header.comments["FRAMEVOL"]
278
282
 
283
+ # Test that 'level0_only' keys are being removed
284
+ assert "IPTASK" not in hdu.header.keys()
285
+
279
286
 
280
287
  def test_replace_header_values(write_l1_task):
281
288
  """
@@ -484,6 +491,29 @@ def test_reprocessing_keys(write_l1_task, mocker):
484
491
  assert header["PRODUCT"] == task.compute_product_id(header["IDSOBSID"], header["PROCTYPE"])
485
492
 
486
493
 
494
+ def test_missing_input_dataset_part(write_l1_task, mocker):
495
+ """
496
+ :Given: a Write_L1 task with a missing calibration frames part
497
+ :When: running the task
498
+ :Then: the input dataset part keys are correctly written without throwing an exception
499
+ """
500
+ mocker.patch(
501
+ "dkist_processing_common.tasks.mixin.metadata_store.GraphQLClient",
502
+ new=FakeGQLClientMissingInputDatasetPart,
503
+ )
504
+ task, _, _ = write_l1_task
505
+ task()
506
+ files = list(task.read(tags=[Tag.frame(), Tag.output()]))
507
+ for file in files:
508
+ header = fits.open(file)[1].header
509
+ assert header["IDSPARID"] == task.metadata_store_input_dataset_parameters.inputDatasetPartId
510
+ assert (
511
+ header["IDSOBSID"]
512
+ == task.metadata_store_input_dataset_observe_frames.inputDatasetPartId
513
+ )
514
+ assert "IDSCALID" not in header
515
+
516
+
487
517
  @pytest.mark.parametrize(
488
518
  "ids_obs_id, proc_type",
489
519
  [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dkist-processing-common
3
- Version: 10.6.3
3
+ Version: 10.7.0
4
4
  Summary: Common task classes used by the DKIST science data processing pipelines
5
5
  Author-email: NSO / AURA <dkistdc@nso.edu>
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools>=64", "setuptools_scm>=8"]
2
+ requires = ["setuptools>=64", "setuptools_scm>=8", "wheel", "build"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.setuptools.packages]