dkist-processing-common 11.4.0rc1__tar.gz → 11.5.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.
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/.readthedocs.yml +1 -1
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/CHANGELOG.rst +31 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/PKG-INFO +2 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/constants.py +42 -28
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/fits_access.py +56 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/tags.py +2 -1
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/task_name.py +2 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/cs_step.py +2 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/dsps_repeat.py +5 -4
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/experiment_id_bud.py +5 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/id_bud.py +6 -3
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/l0_fits_access.py +4 -3
- dkist_processing_common-11.5.0/dkist_processing_common/parsers/l1_fits_access.py +65 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/near_bud.py +5 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/proposal_id_bud.py +3 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/retarder.py +4 -3
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/single_value_single_key_flower.py +6 -1
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/task.py +7 -6
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/time.py +19 -15
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/unique_bud.py +5 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/wavelength.py +4 -3
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/parse_l0_input_data.py +5 -3
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_assemble_movie.py +0 -1
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_constants.py +15 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_fits_access.py +62 -7
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_parse_l0_input_data.py +22 -24
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_stems.py +30 -21
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_task_parsing.py +17 -7
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common.egg-info/PKG-INFO +2 -2
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common.egg-info/SOURCES.txt +0 -1
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common.egg-info/requires.txt +1 -1
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/pyproject.toml +1 -1
- dkist_processing_common-11.4.0rc1/changelog/266.misc.rst +0 -1
- dkist_processing_common-11.4.0rc1/dkist_processing_common/parsers/l1_fits_access.py +0 -64
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/.gitignore +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/.pre-commit-config.yaml +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/.snyk +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/README.rst +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/bitbucket-pipelines.yml +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/changelog/.gitempty +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/_util/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/_util/constants.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/_util/graphql.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/_util/scratch.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/_util/tags.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/array.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/asdf.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/basemodel.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/bytes.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/fits.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/iobase.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/json.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/path.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/quality.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/codecs/str.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/config.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/fonts/Lato-Regular.ttf +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/fonts/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/manual.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/dkist_location.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/flower_pot.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/fried_parameter.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/graphql.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/input_dataset.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/message.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/message_queue_binding.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/metric_code.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/parameters.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/quality.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/models/wavelength.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/parsers/quality.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/assemble_movie.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/base.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/l1_output_data.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/globus.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/interservice_bus.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/metadata_store.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/object_store.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/quality/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/quality/_base.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/mixin/quality/_metrics.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/output_data_base.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/quality_metrics.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/teardown.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/transfer_input_data.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/trial_catalog.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/trial_output_data.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tasks/write_l1.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/__init__.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/conftest.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/mock_metadata_store.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_assemble_quality.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_base.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_codecs.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_cs_step.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_dkist_location.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_flower_pot.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_fried_parameter.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_input_dataset.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_interservice_bus.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_interservice_bus_mixin.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_manual_processing.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_output_data_base.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_parameters.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_publish_catalog_messages.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_quality.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_quality_mixin.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_scratch.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_submit_dataset_metadata.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_tags.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_task_name.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_teardown.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_transfer_input_data.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_transfer_l1_output_data.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_trial_catalog.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_trial_output_data.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_workflow_task_base.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common/tests/test_write_l1.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common.egg-info/dependency_links.txt +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/dkist_processing_common.egg-info/top_level.txt +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/Makefile +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/changelog.rst +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/conf.py +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/index.rst +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/landing_page.rst +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/make.bat +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/docs/requirements.txt +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/licenses/LICENSE.rst +0 -0
- {dkist_processing_common-11.4.0rc1 → dkist_processing_common-11.5.0}/setup.cfg +0 -0
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
v11.5.0 (2025-09-08)
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
Misc
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
- Update dkist-processing-core to 5.2.0 which includes upgrades to airflow 2.11.0 and requires Python 3.12+. (`#266 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/266>`__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
v11.4.0 (2025-09-04)
|
|
11
|
+
====================
|
|
12
|
+
|
|
13
|
+
Features
|
|
14
|
+
--------
|
|
15
|
+
|
|
16
|
+
- Create new MetadataKey string enum class. Replace usages like `metadata_key="keyword_name"`
|
|
17
|
+
with `metadata_key=MetadataKey.keyword_name`. Note that unlike other enum classes, we are using
|
|
18
|
+
the name, not the value. Stem bases now check if they are passed a MetadataKey, and take
|
|
19
|
+
the name as the required string. (`#265 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/265>`__)
|
|
20
|
+
- Add `_set_metadata_key_value` method to FitsAccessBase that takes a StrEnum and sets
|
|
21
|
+
a class attribute. The attribute name is the StrEnum name and the attribute value
|
|
22
|
+
gets the header value with the StrEnum value as key. (`#265 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/265>`__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Misc
|
|
26
|
+
----
|
|
27
|
+
|
|
28
|
+
- Change classes that inherit from `str` and `Enum` to inherit `StrEnum` instead: BudName, StemName, TaskName. Convert
|
|
29
|
+
strings to class members where relevant. (`#265 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/265>`__)
|
|
30
|
+
|
|
31
|
+
|
|
1
32
|
v11.3.0 (2025-08-30)
|
|
2
33
|
====================
|
|
3
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dkist-processing-common
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.5.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
|
|
@@ -17,7 +17,7 @@ Requires-Dist: asdf<4.0.0,>=3.5.0
|
|
|
17
17
|
Requires-Dist: astropy>=7.0.0
|
|
18
18
|
Requires-Dist: dkist-fits-specifications<5.0,>=4.0.0
|
|
19
19
|
Requires-Dist: dkist-header-validator<6.0,>=5.0.0
|
|
20
|
-
Requires-Dist: dkist-processing-core==5.2.
|
|
20
|
+
Requires-Dist: dkist-processing-core==5.2.1
|
|
21
21
|
Requires-Dist: dkist-processing-pac<4.0,>=3.1
|
|
22
22
|
Requires-Dist: dkist-service-configuration<3.0,>=2.0.2
|
|
23
23
|
Requires-Dist: dkist-spectral-lines<4.0,>=3.0.0
|
|
@@ -5,7 +5,7 @@ Contains names of database entries and Base class for an object that simplifies
|
|
|
5
5
|
accessing the database (tab completion, etc.)
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from enum import
|
|
8
|
+
from enum import StrEnum
|
|
9
9
|
from string import ascii_uppercase
|
|
10
10
|
|
|
11
11
|
from sqids import Sqids
|
|
@@ -13,13 +13,13 @@ from sqids import Sqids
|
|
|
13
13
|
from dkist_processing_common._util.constants import ConstantsDb
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class BudName(
|
|
16
|
+
class BudName(StrEnum):
|
|
17
17
|
"""Controlled list of names for constant stems (buds)."""
|
|
18
18
|
|
|
19
|
-
recipe_run_id = "RECIPE_RUN_ID"
|
|
20
19
|
instrument = "INSTRUMENT"
|
|
21
20
|
num_cs_steps = "NUM_CS_STEPS"
|
|
22
21
|
num_modstates = "NUM_MODSTATES"
|
|
22
|
+
retarder_name = "RETARDER_NAME"
|
|
23
23
|
proposal_id = "PROPOSAL_ID"
|
|
24
24
|
contributing_proposal_ids = "CONTRIBUTING_PROPOSAL_IDS"
|
|
25
25
|
experiment_id = "EXPERIMENT_ID"
|
|
@@ -33,7 +33,6 @@ class BudName(str, Enum):
|
|
|
33
33
|
dark_exposure_times = "DARK_EXPOSURE_TIMES"
|
|
34
34
|
dark_readout_exp_times = "DARK_READOUT_EXP_TIMES"
|
|
35
35
|
wavelength = "WAVELENGTH"
|
|
36
|
-
retarder_name = "RETARDER_NAME"
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
class ConstantsBase:
|
|
@@ -63,7 +62,7 @@ class ConstantsBase:
|
|
|
63
62
|
Parameters
|
|
64
63
|
----------
|
|
65
64
|
recipe_run_id
|
|
66
|
-
|
|
65
|
+
The recipe_run_id
|
|
67
66
|
task_name
|
|
68
67
|
The task_name
|
|
69
68
|
"""
|
|
@@ -91,6 +90,31 @@ class ConstantsBase:
|
|
|
91
90
|
"""Define the dataset_id constant."""
|
|
92
91
|
return Sqids(min_length=6, alphabet=ascii_uppercase).encode([self._recipe_run_id])
|
|
93
92
|
|
|
93
|
+
@property
|
|
94
|
+
def stokes_params(self) -> [str]:
|
|
95
|
+
"""Return the list of stokes parameter names."""
|
|
96
|
+
return ["I", "Q", "U", "V"]
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def instrument(self) -> str:
|
|
100
|
+
"""Get the instrument name."""
|
|
101
|
+
return self._db_dict[BudName.instrument]
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def num_cs_steps(self):
|
|
105
|
+
"""Get the number of calibration sequence steps."""
|
|
106
|
+
return self._db_dict[BudName.num_cs_steps]
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def num_modstates(self):
|
|
110
|
+
"""Get the number of modulation states."""
|
|
111
|
+
return self._db_dict[BudName.num_modstates]
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def retarder_name(self):
|
|
115
|
+
"""Get the retarder name."""
|
|
116
|
+
return self._db_dict[BudName.retarder_name]
|
|
117
|
+
|
|
94
118
|
@property
|
|
95
119
|
def proposal_id(self) -> str:
|
|
96
120
|
"""Get the proposal_id constant."""
|
|
@@ -105,14 +129,22 @@ class ConstantsBase:
|
|
|
105
129
|
return proposal_ids
|
|
106
130
|
|
|
107
131
|
@property
|
|
108
|
-
def
|
|
109
|
-
"""Get the
|
|
110
|
-
return self._db_dict[BudName.
|
|
132
|
+
def experiment_id(self) -> str:
|
|
133
|
+
"""Get the experiment_id constant."""
|
|
134
|
+
return self._db_dict[BudName.experiment_id]
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def contributing_experiment_ids(self) -> [str]:
|
|
138
|
+
"""Return the list of contributing experiment IDs."""
|
|
139
|
+
experiment_ids = self._db_dict[BudName.contributing_experiment_ids]
|
|
140
|
+
if isinstance(experiment_ids, str):
|
|
141
|
+
return [experiment_ids]
|
|
142
|
+
return experiment_ids
|
|
111
143
|
|
|
112
144
|
@property
|
|
113
145
|
def obs_ip_start_time(self) -> str:
|
|
114
146
|
"""Return the start time of the observe IP."""
|
|
115
|
-
return self._db_dict[BudName.obs_ip_start_time
|
|
147
|
+
return self._db_dict[BudName.obs_ip_start_time]
|
|
116
148
|
|
|
117
149
|
@property
|
|
118
150
|
def average_cadence(self) -> float:
|
|
@@ -149,25 +181,7 @@ class ConstantsBase:
|
|
|
149
181
|
"""Get a list of readout exp times for all DARK frames."""
|
|
150
182
|
return self._db_dict[BudName.dark_readout_exp_times]
|
|
151
183
|
|
|
152
|
-
@property
|
|
153
|
-
def stokes_params(self) -> [str]:
|
|
154
|
-
"""Return the list of stokes parameter names."""
|
|
155
|
-
return ["I", "Q", "U", "V"]
|
|
156
|
-
|
|
157
|
-
@property
|
|
158
|
-
def experiment_id(self) -> str:
|
|
159
|
-
"""Get the experiment_id constant."""
|
|
160
|
-
return self._db_dict[BudName.experiment_id]
|
|
161
|
-
|
|
162
|
-
@property
|
|
163
|
-
def contributing_experiment_ids(self) -> [str]:
|
|
164
|
-
"""Return the list of contributing experiment IDs."""
|
|
165
|
-
experiment_ids = self._db_dict[BudName.contributing_experiment_ids]
|
|
166
|
-
if isinstance(experiment_ids, str):
|
|
167
|
-
return [experiment_ids]
|
|
168
|
-
return experiment_ids
|
|
169
|
-
|
|
170
184
|
@property
|
|
171
185
|
def wavelength(self) -> float:
|
|
172
186
|
"""Wavelength."""
|
|
173
|
-
return self._db_dict[BudName.wavelength
|
|
187
|
+
return self._db_dict[BudName.wavelength]
|
|
@@ -2,11 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from enum import StrEnum
|
|
5
6
|
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
6
8
|
|
|
7
9
|
import numpy as np
|
|
8
10
|
from astropy.io import fits
|
|
9
11
|
|
|
12
|
+
NOT_FOUND_MESSAGE = "_HEADER_KEYWORD_NOT_FOUND"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MetadataKey(StrEnum):
|
|
16
|
+
"""Controlled list of names for FITS metadata header keys."""
|
|
17
|
+
|
|
18
|
+
ip_task_type = "IPTASK" # in L0FitsAccess
|
|
19
|
+
ip_start_time = "DKIST011" # in L0FitsAccess
|
|
20
|
+
ip_end_time = "DKIST012" # in L0FitsAccess
|
|
21
|
+
elevation = "ELEV_ANG"
|
|
22
|
+
azimuth = "TAZIMUTH"
|
|
23
|
+
table_angle = "TTBLANGL"
|
|
24
|
+
gos_level3_status = "LVL3STAT"
|
|
25
|
+
gos_level3_lamp_status = "LAMPSTAT"
|
|
26
|
+
gos_polarizer_status = "LVL2STAT"
|
|
27
|
+
gos_polarizer_angle = "POLANGLE"
|
|
28
|
+
gos_retarder_status = "LVL1STAT"
|
|
29
|
+
gos_retarder_angle = "RETANGLE"
|
|
30
|
+
gos_level0_status = "LVL0STAT"
|
|
31
|
+
time_obs = "DATE-BEG"
|
|
32
|
+
ip_id = "IP_ID"
|
|
33
|
+
instrument = "INSTRUME"
|
|
34
|
+
wavelength = "LINEWAV"
|
|
35
|
+
proposal_id = "PROP_ID"
|
|
36
|
+
experiment_id = "EXPER_ID"
|
|
37
|
+
num_dsps_repeats = "DSPSREPS"
|
|
38
|
+
current_dsps_repeat = "DSPSNUM"
|
|
39
|
+
fpa_exposure_time_ms = "XPOSURE"
|
|
40
|
+
sensor_readout_exposure_time_ms = "TEXPOSUR"
|
|
41
|
+
num_raw_frames_per_fpa = "NSUMEXP"
|
|
42
|
+
|
|
10
43
|
|
|
11
44
|
class FitsAccessBase:
|
|
12
45
|
"""
|
|
@@ -35,6 +68,29 @@ class FitsAccessBase:
|
|
|
35
68
|
def __repr__(self):
|
|
36
69
|
return f"{self.__class__.__name__}(hdu={self._hdu!r}, name={self.name!r}, auto_squeeze={self.auto_squeeze})"
|
|
37
70
|
|
|
71
|
+
def _set_metadata_key_value(
|
|
72
|
+
self, key: StrEnum, optional: bool = False, default: Any = NOT_FOUND_MESSAGE
|
|
73
|
+
) -> None:
|
|
74
|
+
"""
|
|
75
|
+
Get the header value and assign it as a metadata key name attribute.
|
|
76
|
+
|
|
77
|
+
Parameters
|
|
78
|
+
----------
|
|
79
|
+
key
|
|
80
|
+
The StrEnum member in attribute_name = fits_keyword structure
|
|
81
|
+
optional
|
|
82
|
+
If the keyword is optional
|
|
83
|
+
default
|
|
84
|
+
Value for the attribute if the key is not found
|
|
85
|
+
"""
|
|
86
|
+
if optional:
|
|
87
|
+
if default != NOT_FOUND_MESSAGE:
|
|
88
|
+
setattr(self, key.name, self.header.get(key, default))
|
|
89
|
+
else:
|
|
90
|
+
setattr(self, key.name, self.header.get(key, key + NOT_FOUND_MESSAGE))
|
|
91
|
+
else:
|
|
92
|
+
setattr(self, key.name, self.header[key])
|
|
93
|
+
|
|
38
94
|
@property
|
|
39
95
|
def data(self) -> np.ndarray:
|
|
40
96
|
"""
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Components of the Tag model. Stem + Optional Suffix = Tag."""
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
|
+
from enum import StrEnum
|
|
4
5
|
|
|
5
6
|
from dkist_processing_common.models.task_name import TaskName
|
|
6
7
|
|
|
@@ -8,7 +9,7 @@ from dkist_processing_common.models.task_name import TaskName
|
|
|
8
9
|
EXP_TIME_ROUND_DIGITS: int = 6
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
class StemName(
|
|
12
|
+
class StemName(StrEnum):
|
|
12
13
|
"""Controlled list of Tag Stems."""
|
|
13
14
|
|
|
14
15
|
output = "OUTPUT"
|
|
@@ -101,7 +101,7 @@ class CSStepFlower(Stem):
|
|
|
101
101
|
"""
|
|
102
102
|
|
|
103
103
|
def __init__(self, max_cs_step_time_sec: float):
|
|
104
|
-
super().__init__(stem_name=StemName.cs_step
|
|
104
|
+
super().__init__(stem_name=StemName.cs_step)
|
|
105
105
|
self.max_cs_step_time_sec = max_cs_step_time_sec
|
|
106
106
|
|
|
107
107
|
def setter(self, fits_obj: L0FitsAccess) -> CSStep | Type[SpilledDirt]:
|
|
@@ -148,7 +148,7 @@ class NumCSStepBud(Stem):
|
|
|
148
148
|
"""
|
|
149
149
|
|
|
150
150
|
def __init__(self, max_cs_step_time_sec: float):
|
|
151
|
-
super().__init__(stem_name=BudName.num_cs_steps
|
|
151
|
+
super().__init__(stem_name=BudName.num_cs_steps)
|
|
152
152
|
self.max_cs_step_time_sec = max_cs_step_time_sec
|
|
153
153
|
|
|
154
154
|
def setter(self, fits_obj: L0FitsAccess) -> CSStep | Type[SpilledDirt]:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Classes supporting the Data Set Parameters Set (DSPS) Repeat parameter."""
|
|
2
2
|
|
|
3
3
|
from dkist_processing_common.models.constants import BudName
|
|
4
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
4
5
|
from dkist_processing_common.models.flower_pot import SpilledDirt
|
|
5
6
|
from dkist_processing_common.models.tags import StemName
|
|
6
7
|
from dkist_processing_common.models.task_name import TaskName
|
|
@@ -16,9 +17,9 @@ class TotalDspsRepeatsBud(TaskUniqueBud):
|
|
|
16
17
|
|
|
17
18
|
def __init__(self):
|
|
18
19
|
super().__init__(
|
|
19
|
-
constant_name=BudName.num_dsps_repeats
|
|
20
|
-
metadata_key=
|
|
21
|
-
ip_task_types=TaskName.observe
|
|
20
|
+
constant_name=BudName.num_dsps_repeats,
|
|
21
|
+
metadata_key=MetadataKey.num_dsps_repeats,
|
|
22
|
+
ip_task_types=TaskName.observe,
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
|
|
@@ -27,7 +28,7 @@ class DspsRepeatNumberFlower(SingleValueSingleKeyFlower):
|
|
|
27
28
|
|
|
28
29
|
def __init__(self):
|
|
29
30
|
super().__init__(
|
|
30
|
-
tag_stem_name=StemName.dsps_repeat
|
|
31
|
+
tag_stem_name=StemName.dsps_repeat, metadata_key=MetadataKey.current_dsps_repeat
|
|
31
32
|
)
|
|
32
33
|
|
|
33
34
|
def setter(self, fits_obj: L0FitsAccess):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Experiment Id parser."""
|
|
2
2
|
|
|
3
3
|
from dkist_processing_common.models.constants import BudName
|
|
4
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
4
5
|
from dkist_processing_common.parsers.id_bud import ContributingIdsBud
|
|
5
6
|
from dkist_processing_common.parsers.id_bud import IdBud
|
|
6
7
|
|
|
@@ -9,7 +10,9 @@ class ExperimentIdBud(IdBud):
|
|
|
9
10
|
"""Class to create a Bud for the experiment_id."""
|
|
10
11
|
|
|
11
12
|
def __init__(self):
|
|
12
|
-
super().__init__(
|
|
13
|
+
super().__init__(
|
|
14
|
+
constant_name=BudName.experiment_id, metadata_key=MetadataKey.experiment_id
|
|
15
|
+
)
|
|
13
16
|
|
|
14
17
|
|
|
15
18
|
class ContributingExperimentIdsBud(ContributingIdsBud):
|
|
@@ -17,5 +20,5 @@ class ContributingExperimentIdsBud(ContributingIdsBud):
|
|
|
17
20
|
|
|
18
21
|
def __init__(self):
|
|
19
22
|
super().__init__(
|
|
20
|
-
stem_name=BudName.contributing_experiment_ids
|
|
23
|
+
stem_name=BudName.contributing_experiment_ids, metadata_key=MetadataKey.experiment_id
|
|
21
24
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Base classes for ID bud parsing."""
|
|
2
2
|
|
|
3
|
+
from enum import StrEnum
|
|
3
4
|
from typing import Type
|
|
4
5
|
|
|
5
6
|
from dkist_processing_common.models.flower_pot import SpilledDirt
|
|
@@ -12,19 +13,21 @@ from dkist_processing_common.parsers.unique_bud import TaskUniqueBud
|
|
|
12
13
|
class IdBud(TaskUniqueBud):
|
|
13
14
|
"""Base class for ID buds."""
|
|
14
15
|
|
|
15
|
-
def __init__(self, constant_name, metadata_key):
|
|
16
|
+
def __init__(self, constant_name: str, metadata_key: str | StrEnum):
|
|
16
17
|
super().__init__(
|
|
17
18
|
constant_name=constant_name,
|
|
18
19
|
metadata_key=metadata_key,
|
|
19
|
-
ip_task_types=TaskName.observe
|
|
20
|
+
ip_task_types=TaskName.observe,
|
|
20
21
|
)
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
class ContributingIdsBud(Stem):
|
|
24
25
|
"""Base class for contributing ID buds."""
|
|
25
26
|
|
|
26
|
-
def __init__(self, stem_name, metadata_key):
|
|
27
|
+
def __init__(self, stem_name: str, metadata_key: str | StrEnum):
|
|
27
28
|
super().__init__(stem_name=stem_name)
|
|
29
|
+
if isinstance(metadata_key, StrEnum):
|
|
30
|
+
metadata_key = metadata_key.name
|
|
28
31
|
self.metadata_key = metadata_key
|
|
29
32
|
|
|
30
33
|
def setter(self, fits_obj: L0FitsAccess) -> str | Type[SpilledDirt]:
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from astropy.io import fits
|
|
4
4
|
|
|
5
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
5
6
|
from dkist_processing_common.parsers.l1_fits_access import L1FitsAccess
|
|
6
7
|
|
|
7
8
|
|
|
@@ -26,6 +27,6 @@ class L0FitsAccess(L1FitsAccess):
|
|
|
26
27
|
auto_squeeze: bool = True,
|
|
27
28
|
):
|
|
28
29
|
super().__init__(hdu=hdu, name=name, auto_squeeze=auto_squeeze)
|
|
29
|
-
self.ip_task_type
|
|
30
|
-
self.ip_start_time
|
|
31
|
-
self.ip_end_time
|
|
30
|
+
self._set_metadata_key_value(MetadataKey.ip_task_type)
|
|
31
|
+
self._set_metadata_key_value(MetadataKey.ip_start_time)
|
|
32
|
+
self._set_metadata_key_value(MetadataKey.ip_end_time)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""By-frame 214 L1 only header keywords that are not instrument specific."""
|
|
2
|
+
|
|
3
|
+
from astropy.io import fits
|
|
4
|
+
|
|
5
|
+
from dkist_processing_common.models.fits_access import FitsAccessBase
|
|
6
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class L1FitsAccess(FitsAccessBase):
|
|
10
|
+
"""
|
|
11
|
+
Class defining a fits access object for processed L1 data.
|
|
12
|
+
|
|
13
|
+
Parameters
|
|
14
|
+
----------
|
|
15
|
+
hdu
|
|
16
|
+
The input fits hdu
|
|
17
|
+
name
|
|
18
|
+
An optional name to be associated with the hdu
|
|
19
|
+
auto_squeeze
|
|
20
|
+
A boolean indicating whether to 'squeeze' out dimensions of size 1
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
hdu: fits.ImageHDU | fits.PrimaryHDU | fits.CompImageHDU,
|
|
26
|
+
name: str | None = None,
|
|
27
|
+
auto_squeeze: bool = False, # Because L1 data should always have the right form, right?
|
|
28
|
+
):
|
|
29
|
+
super().__init__(hdu=hdu, name=name, auto_squeeze=auto_squeeze)
|
|
30
|
+
|
|
31
|
+
self._set_metadata_key_value(MetadataKey.elevation)
|
|
32
|
+
self._set_metadata_key_value(MetadataKey.azimuth)
|
|
33
|
+
self._set_metadata_key_value(MetadataKey.table_angle)
|
|
34
|
+
self._set_metadata_key_value(MetadataKey.gos_level3_status)
|
|
35
|
+
self._set_metadata_key_value(MetadataKey.gos_level3_lamp_status)
|
|
36
|
+
self._set_metadata_key_value(MetadataKey.gos_polarizer_status)
|
|
37
|
+
self._set_metadata_key_value(MetadataKey.gos_retarder_status)
|
|
38
|
+
self._set_metadata_key_value(MetadataKey.gos_level0_status)
|
|
39
|
+
self._set_metadata_key_value(MetadataKey.time_obs)
|
|
40
|
+
self._set_metadata_key_value(MetadataKey.ip_id)
|
|
41
|
+
self._set_metadata_key_value(MetadataKey.instrument)
|
|
42
|
+
self._set_metadata_key_value(MetadataKey.wavelength)
|
|
43
|
+
self._set_metadata_key_value(MetadataKey.proposal_id)
|
|
44
|
+
self._set_metadata_key_value(MetadataKey.experiment_id)
|
|
45
|
+
self._set_metadata_key_value(MetadataKey.num_dsps_repeats)
|
|
46
|
+
self._set_metadata_key_value(MetadataKey.current_dsps_repeat)
|
|
47
|
+
self._set_metadata_key_value(MetadataKey.fpa_exposure_time_ms)
|
|
48
|
+
self._set_metadata_key_value(MetadataKey.sensor_readout_exposure_time_ms)
|
|
49
|
+
self._set_metadata_key_value(MetadataKey.num_raw_frames_per_fpa)
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def gos_polarizer_angle(self) -> float:
|
|
53
|
+
"""Convert the polarizer angle to a float if possible before returning."""
|
|
54
|
+
try:
|
|
55
|
+
return float(self.header[MetadataKey.gos_polarizer_angle])
|
|
56
|
+
except ValueError:
|
|
57
|
+
return -999 # The angle is only used if the polarizer is in the beam
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def gos_retarder_angle(self) -> float:
|
|
61
|
+
"""Convert the retarder angle to a float if possible before returning."""
|
|
62
|
+
try:
|
|
63
|
+
return float(self.header[MetadataKey.gos_retarder_angle])
|
|
64
|
+
except ValueError:
|
|
65
|
+
return -999 # The angle is only used if the retarder is in the beam
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Pre-made flower that reads a single header key from all files and raises a ValueError if the values are not in a supplied range."""
|
|
2
2
|
|
|
3
|
+
from enum import StrEnum
|
|
3
4
|
from statistics import mean
|
|
4
5
|
from typing import Callable
|
|
5
6
|
|
|
@@ -30,10 +31,12 @@ class NearFloatBud(Stem):
|
|
|
30
31
|
def __init__(
|
|
31
32
|
self,
|
|
32
33
|
constant_name: str,
|
|
33
|
-
metadata_key: str,
|
|
34
|
+
metadata_key: str | StrEnum,
|
|
34
35
|
tolerance: float,
|
|
35
36
|
):
|
|
36
37
|
super().__init__(stem_name=constant_name)
|
|
38
|
+
if isinstance(metadata_key, StrEnum):
|
|
39
|
+
metadata_key = metadata_key.name
|
|
37
40
|
self.metadata_key = metadata_key
|
|
38
41
|
self.tolerance = tolerance
|
|
39
42
|
|
|
@@ -98,7 +101,7 @@ class TaskNearFloatBud(NearFloatBud):
|
|
|
98
101
|
def __init__(
|
|
99
102
|
self,
|
|
100
103
|
constant_name: str,
|
|
101
|
-
metadata_key: str,
|
|
104
|
+
metadata_key: str | StrEnum,
|
|
102
105
|
ip_task_types: str | list[str],
|
|
103
106
|
tolerance: float,
|
|
104
107
|
task_type_parsing_function: Callable = passthrough_header_ip_task,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Proposal Id parser."""
|
|
2
2
|
|
|
3
3
|
from dkist_processing_common.models.constants import BudName
|
|
4
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
4
5
|
from dkist_processing_common.parsers.id_bud import ContributingIdsBud
|
|
5
6
|
from dkist_processing_common.parsers.id_bud import IdBud
|
|
6
7
|
|
|
@@ -9,7 +10,7 @@ class ProposalIdBud(IdBud):
|
|
|
9
10
|
"""Class to create a Bud for the proposal_id."""
|
|
10
11
|
|
|
11
12
|
def __init__(self):
|
|
12
|
-
super().__init__(constant_name=BudName.proposal_id
|
|
13
|
+
super().__init__(constant_name=BudName.proposal_id, metadata_key=MetadataKey.proposal_id)
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class ContributingProposalIdsBud(ContributingIdsBud):
|
|
@@ -17,5 +18,5 @@ class ContributingProposalIdsBud(ContributingIdsBud):
|
|
|
17
18
|
|
|
18
19
|
def __init__(self):
|
|
19
20
|
super().__init__(
|
|
20
|
-
stem_name=BudName.contributing_proposal_ids
|
|
21
|
+
stem_name=BudName.contributing_proposal_ids, metadata_key=MetadataKey.proposal_id
|
|
21
22
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Bud that parses the name of the retarder used during POLCAL task observations."""
|
|
2
2
|
|
|
3
3
|
from dkist_processing_common.models.constants import BudName
|
|
4
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
4
5
|
from dkist_processing_common.models.task_name import TaskName
|
|
5
6
|
from dkist_processing_common.parsers.unique_bud import TaskUniqueBud
|
|
6
7
|
|
|
@@ -19,9 +20,9 @@ class RetarderNameBud(TaskUniqueBud):
|
|
|
19
20
|
|
|
20
21
|
def __init__(self):
|
|
21
22
|
super().__init__(
|
|
22
|
-
constant_name=BudName.retarder_name
|
|
23
|
-
metadata_key=
|
|
24
|
-
ip_task_types=TaskName.polcal
|
|
23
|
+
constant_name=BudName.retarder_name,
|
|
24
|
+
metadata_key=MetadataKey.gos_retarder_status,
|
|
25
|
+
ip_task_types=TaskName.polcal,
|
|
25
26
|
)
|
|
26
27
|
|
|
27
28
|
def getter(self, key) -> str:
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"""Pre-made flower that produces tag based on a single header key."""
|
|
2
2
|
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
|
|
5
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
3
6
|
from dkist_processing_common.models.flower_pot import Stem
|
|
4
7
|
from dkist_processing_common.parsers.l0_fits_access import L0FitsAccess
|
|
5
8
|
|
|
@@ -16,8 +19,10 @@ class SingleValueSingleKeyFlower(Stem):
|
|
|
16
19
|
The metadata key
|
|
17
20
|
"""
|
|
18
21
|
|
|
19
|
-
def __init__(self, tag_stem_name: str, metadata_key: str):
|
|
22
|
+
def __init__(self, tag_stem_name: str, metadata_key: str | StrEnum):
|
|
20
23
|
super().__init__(stem_name=tag_stem_name)
|
|
24
|
+
if isinstance(metadata_key, StrEnum):
|
|
25
|
+
metadata_key = metadata_key.name
|
|
21
26
|
self.metadata_key = metadata_key
|
|
22
27
|
|
|
23
28
|
def setter(self, fits_obj: L0FitsAccess):
|
|
@@ -4,6 +4,7 @@ from typing import Callable
|
|
|
4
4
|
from typing import Type
|
|
5
5
|
|
|
6
6
|
from dkist_processing_common.models.fits_access import FitsAccessBase
|
|
7
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
7
8
|
from dkist_processing_common.models.flower_pot import SpilledDirt
|
|
8
9
|
from dkist_processing_common.models.tags import StemName
|
|
9
10
|
from dkist_processing_common.models.task_name import TaskName
|
|
@@ -36,9 +37,9 @@ def parse_header_ip_task_with_gains(fits_obj: FitsAccessBase) -> str:
|
|
|
36
37
|
and fits_obj.gos_level3_status == "lamp"
|
|
37
38
|
and fits_obj.gos_level3_lamp_status == "on"
|
|
38
39
|
):
|
|
39
|
-
return TaskName.lamp_gain
|
|
40
|
+
return TaskName.lamp_gain
|
|
40
41
|
if fits_obj.ip_task_type == "gain" and fits_obj.gos_level3_status == "clear":
|
|
41
|
-
return TaskName.solar_gain
|
|
42
|
+
return TaskName.solar_gain
|
|
42
43
|
|
|
43
44
|
# Everything else is unchanged
|
|
44
45
|
return passthrough_header_ip_task(fits_obj)
|
|
@@ -59,14 +60,14 @@ def parse_polcal_task_type(fits_obj: Type[FitsAccessBase]) -> str | Type[Spilled
|
|
|
59
60
|
and fits_obj.gos_retarder_status == "clear"
|
|
60
61
|
and fits_obj.gos_polarizer_status == "clear"
|
|
61
62
|
):
|
|
62
|
-
return TaskName.polcal_dark
|
|
63
|
+
return TaskName.polcal_dark
|
|
63
64
|
|
|
64
65
|
elif (
|
|
65
66
|
fits_obj.gos_level0_status.startswith("FieldStop")
|
|
66
67
|
and fits_obj.gos_retarder_status == "clear"
|
|
67
68
|
and fits_obj.gos_polarizer_status == "clear"
|
|
68
69
|
):
|
|
69
|
-
return TaskName.polcal_gain
|
|
70
|
+
return TaskName.polcal_gain
|
|
70
71
|
|
|
71
72
|
# We don't care about a POLCAL frame that is neither dark nor clear
|
|
72
73
|
return SpilledDirt
|
|
@@ -78,7 +79,7 @@ class TaskTypeFlower(SingleValueSingleKeyFlower):
|
|
|
78
79
|
def __init__(
|
|
79
80
|
self, header_task_parsing_func: Callable[[FitsAccessBase], str] = passthrough_header_ip_task
|
|
80
81
|
):
|
|
81
|
-
super().__init__(tag_stem_name=StemName.task
|
|
82
|
+
super().__init__(tag_stem_name=StemName.task, metadata_key=MetadataKey.ip_task_type)
|
|
82
83
|
self.header_parsing_function = header_task_parsing_func
|
|
83
84
|
|
|
84
85
|
def setter(self, fits_obj: FitsAccessBase):
|
|
@@ -103,7 +104,7 @@ class PolcalTaskFlower(SingleValueSingleKeyFlower):
|
|
|
103
104
|
"""
|
|
104
105
|
|
|
105
106
|
def __init__(self):
|
|
106
|
-
super().__init__(tag_stem_name=StemName.task
|
|
107
|
+
super().__init__(tag_stem_name=StemName.task, metadata_key=MetadataKey.ip_task_type)
|
|
107
108
|
|
|
108
109
|
def setter(self, fits_obj: FitsAccessBase):
|
|
109
110
|
"""
|