dkist-processing-common 11.7.0rc2__tar.gz → 11.7.1rc1__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.7.0rc2 → dkist_processing_common-11.7.1rc1}/PKG-INFO +2 -2
- dkist_processing_common-11.7.1rc1/changelog/271.misc.rst +1 -0
- dkist_processing_common-11.7.1rc1/dkist_processing_common/models/constants.py +187 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/fits_access.py +25 -16
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/experiment_id_bud.py +4 -8
- dkist_processing_common-11.7.1rc1/dkist_processing_common/parsers/id_bud.py +60 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/l0_fits_access.py +3 -3
- dkist_processing_common-11.7.1rc1/dkist_processing_common/parsers/l1_fits_access.py +65 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/near_bud.py +4 -4
- dkist_processing_common-11.7.1rc1/dkist_processing_common/parsers/proposal_id_bud.py +22 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/single_value_single_key_flower.py +1 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/time.py +27 -141
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/quality/_metrics.py +4 -6
- dkist_processing_common-11.7.1rc1/dkist_processing_common/tasks/parse_l0_input_data.py +225 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_fits_access.py +44 -19
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_parse_l0_input_data.py +5 -39
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_quality_mixin.py +11 -3
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_stems.py +10 -127
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_task_parsing.py +6 -6
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common.egg-info/PKG-INFO +2 -2
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common.egg-info/SOURCES.txt +1 -7
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common.egg-info/requires.txt +1 -1
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/pyproject.toml +1 -1
- dkist_processing_common-11.7.0rc2/changelog/267.feature.1.rst +0 -1
- dkist_processing_common-11.7.0rc2/changelog/267.feature.2.rst +0 -1
- dkist_processing_common-11.7.0rc2/changelog/267.feature.rst +0 -1
- dkist_processing_common-11.7.0rc2/changelog/267.misc.rst +0 -1
- dkist_processing_common-11.7.0rc2/changelog/267.removal.1.rst +0 -2
- dkist_processing_common-11.7.0rc2/changelog/267.removal.rst +0 -1
- dkist_processing_common-11.7.0rc2/dkist_processing_common/models/constants.py +0 -523
- dkist_processing_common-11.7.0rc2/dkist_processing_common/parsers/average_bud.py +0 -48
- dkist_processing_common-11.7.0rc2/dkist_processing_common/parsers/id_bud.py +0 -76
- dkist_processing_common-11.7.0rc2/dkist_processing_common/parsers/l1_fits_access.py +0 -91
- dkist_processing_common-11.7.0rc2/dkist_processing_common/parsers/proposal_id_bud.py +0 -28
- dkist_processing_common-11.7.0rc2/dkist_processing_common/tasks/parse_l0_input_data.py +0 -473
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/.gitignore +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/.pre-commit-config.yaml +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/.readthedocs.yml +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/.snyk +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/CHANGELOG.rst +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/README.rst +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/bitbucket-pipelines.yml +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/changelog/.gitempty +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/_util/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/_util/constants.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/_util/graphql.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/_util/scratch.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/_util/tags.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/array.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/asdf.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/basemodel.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/bytes.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/fits.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/iobase.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/json.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/path.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/quality.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/codecs/str.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/config.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/fonts/Lato-Regular.ttf +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/fonts/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/manual.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/dkist_location.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/flower_pot.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/fried_parameter.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/graphql.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/input_dataset.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/message.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/message_queue_binding.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/metric_code.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/parameters.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/quality.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/tags.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/task_name.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/telemetry.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/models/wavelength.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/cs_step.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/dsps_repeat.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/quality.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/retarder.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/task.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/unique_bud.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/parsers/wavelength.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/assemble_movie.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/base.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/l1_output_data.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/globus.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/interservice_bus.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/metadata_store.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/object_store.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/quality/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/mixin/quality/_base.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/output_data_base.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/quality_metrics.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/teardown.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/transfer_input_data.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/trial_catalog.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/trial_output_data.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tasks/write_l1.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/__init__.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/conftest.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/mock_metadata_store.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_assemble_movie.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_assemble_quality.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_base.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_codecs.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_constants.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_cs_step.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_dkist_location.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_flower_pot.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_fried_parameter.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_input_dataset.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_interservice_bus.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_interservice_bus_mixin.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_manual_processing.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_output_data_base.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_parameters.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_publish_catalog_messages.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_quality.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_scratch.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_submit_dataset_metadata.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_tags.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_task_name.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_teardown.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_transfer_input_data.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_transfer_l1_output_data.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_trial_catalog.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_trial_output_data.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_workflow_task_base.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common/tests/test_write_l1.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common.egg-info/dependency_links.txt +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/dkist_processing_common.egg-info/top_level.txt +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/Makefile +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/changelog.rst +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/conf.py +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/index.rst +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/landing_page.rst +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/make.bat +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/docs/requirements.txt +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/licenses/LICENSE.rst +0 -0
- {dkist_processing_common-11.7.0rc2 → dkist_processing_common-11.7.1rc1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dkist-processing-common
|
|
3
|
-
Version: 11.7.
|
|
3
|
+
Version: 11.7.1rc1
|
|
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
|
|
@@ -21,7 +21,7 @@ Requires-Dist: dkist-processing-core==6.0.0
|
|
|
21
21
|
Requires-Dist: dkist-processing-pac<4.0,>=3.1
|
|
22
22
|
Requires-Dist: dkist-service-configuration<5.0,>=4.1.7
|
|
23
23
|
Requires-Dist: dkist-spectral-lines<4.0,>=3.0.0
|
|
24
|
-
Requires-Dist: solar-wavelength-calibration<
|
|
24
|
+
Requires-Dist: solar-wavelength-calibration<3.0,>=2.0.0rc1
|
|
25
25
|
Requires-Dist: globus-sdk>=3.12.0
|
|
26
26
|
Requires-Dist: gqlclient[pydantic]==1.2.3
|
|
27
27
|
Requires-Dist: sqids==0.5.1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Move `solar-wavelength-calibration` dep to 2.0.0 and make use of new helper properties in that release.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Components of the Constant model.
|
|
3
|
+
|
|
4
|
+
Contains names of database entries and Base class for an object that simplifies
|
|
5
|
+
accessing the database (tab completion, etc.)
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from enum import StrEnum
|
|
9
|
+
from string import ascii_uppercase
|
|
10
|
+
|
|
11
|
+
from sqids import Sqids
|
|
12
|
+
|
|
13
|
+
from dkist_processing_common._util.constants import ConstantsDb
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BudName(StrEnum):
|
|
17
|
+
"""Controlled list of names for constant stems (buds)."""
|
|
18
|
+
|
|
19
|
+
instrument = "INSTRUMENT"
|
|
20
|
+
num_cs_steps = "NUM_CS_STEPS"
|
|
21
|
+
num_modstates = "NUM_MODSTATES"
|
|
22
|
+
retarder_name = "RETARDER_NAME"
|
|
23
|
+
proposal_id = "PROPOSAL_ID"
|
|
24
|
+
contributing_proposal_ids = "CONTRIBUTING_PROPOSAL_IDS"
|
|
25
|
+
experiment_id = "EXPERIMENT_ID"
|
|
26
|
+
contributing_experiment_ids = "CONTRIBUTING_EXPERIMENT_IDS"
|
|
27
|
+
obs_ip_start_time = "OBS_IP_START_TIME"
|
|
28
|
+
average_cadence = "AVERAGE_CADENCE"
|
|
29
|
+
maximum_cadence = "MAXIMUM_CADENCE"
|
|
30
|
+
minimum_cadence = "MINIMUM_CADENCE"
|
|
31
|
+
variance_cadence = "VARIANCE_CADENCE"
|
|
32
|
+
num_dsps_repeats = "NUM_DSPS_REPEATS"
|
|
33
|
+
dark_exposure_times = "DARK_EXPOSURE_TIMES"
|
|
34
|
+
dark_readout_exp_times = "DARK_READOUT_EXP_TIMES"
|
|
35
|
+
wavelength = "WAVELENGTH"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class ConstantsBase:
|
|
39
|
+
"""
|
|
40
|
+
Aggregate (from the constant buds flower pot) in a single property on task classes.
|
|
41
|
+
|
|
42
|
+
It also provides some default constants, but is intended to be subclassed by instruments.
|
|
43
|
+
|
|
44
|
+
To subclass:
|
|
45
|
+
|
|
46
|
+
1. Create the actual subclass. All you need to do is add more @properties for the constants you want
|
|
47
|
+
|
|
48
|
+
2. Update the instrument class's `constants_model_class` property to return the new subclass. For example::
|
|
49
|
+
|
|
50
|
+
class NewConstants(ConstantsBase):
|
|
51
|
+
@property
|
|
52
|
+
def something(self):
|
|
53
|
+
return 7
|
|
54
|
+
|
|
55
|
+
class InstrumentWorkflowTask(WorkflowTaskBase):
|
|
56
|
+
@property
|
|
57
|
+
def constants_model_class:
|
|
58
|
+
return NewConstants
|
|
59
|
+
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
Parameters
|
|
63
|
+
----------
|
|
64
|
+
recipe_run_id
|
|
65
|
+
The recipe_run_id
|
|
66
|
+
task_name
|
|
67
|
+
The task_name
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
def __init__(self, recipe_run_id: int, task_name: str):
|
|
71
|
+
self._db_dict = ConstantsDb(recipe_run_id=recipe_run_id, task_name=task_name)
|
|
72
|
+
self._recipe_run_id = recipe_run_id
|
|
73
|
+
|
|
74
|
+
# These management functions are all underscored because we want tab-complete to *only* show the available
|
|
75
|
+
# constants
|
|
76
|
+
def _update(self, d: dict):
|
|
77
|
+
self._db_dict.update(d)
|
|
78
|
+
|
|
79
|
+
def _purge(self):
|
|
80
|
+
self._db_dict.purge()
|
|
81
|
+
|
|
82
|
+
def _close(self):
|
|
83
|
+
self._db_dict.close()
|
|
84
|
+
|
|
85
|
+
def _rollback(self):
|
|
86
|
+
self._db_dict.rollback()
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def dataset_id(self) -> str:
|
|
90
|
+
"""Define the dataset_id constant."""
|
|
91
|
+
return Sqids(min_length=6, alphabet=ascii_uppercase).encode([self._recipe_run_id])
|
|
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
|
+
|
|
118
|
+
@property
|
|
119
|
+
def proposal_id(self) -> str:
|
|
120
|
+
"""Get the proposal_id constant."""
|
|
121
|
+
return self._db_dict[BudName.proposal_id]
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def contributing_proposal_ids(self) -> [str]:
|
|
125
|
+
"""Return the list of contributing proposal IDs."""
|
|
126
|
+
proposal_ids = self._db_dict[BudName.contributing_proposal_ids]
|
|
127
|
+
if isinstance(proposal_ids, str):
|
|
128
|
+
return [proposal_ids]
|
|
129
|
+
return proposal_ids
|
|
130
|
+
|
|
131
|
+
@property
|
|
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
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def obs_ip_start_time(self) -> str:
|
|
146
|
+
"""Return the start time of the observe IP."""
|
|
147
|
+
return self._db_dict[BudName.obs_ip_start_time]
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
def average_cadence(self) -> float:
|
|
151
|
+
"""Get the average_cadence constant."""
|
|
152
|
+
return self._db_dict[BudName.average_cadence]
|
|
153
|
+
|
|
154
|
+
@property
|
|
155
|
+
def maximum_cadence(self) -> float:
|
|
156
|
+
"""Get the maximum cadence constant constant."""
|
|
157
|
+
return self._db_dict[BudName.maximum_cadence]
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
def minimum_cadence(self) -> float:
|
|
161
|
+
"""Get the minimum cadence constant constant."""
|
|
162
|
+
return self._db_dict[BudName.minimum_cadence]
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def variance_cadence(self) -> float:
|
|
166
|
+
"""Get the variance of the cadence constant."""
|
|
167
|
+
return self._db_dict[BudName.variance_cadence]
|
|
168
|
+
|
|
169
|
+
@property
|
|
170
|
+
def num_dsps_repeats(self) -> int:
|
|
171
|
+
"""Get the number of dsps repeats."""
|
|
172
|
+
return self._db_dict[BudName.num_dsps_repeats]
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def dark_exposure_times(self) -> [float]:
|
|
176
|
+
"""Get a list of exposure times used in the dark calibration."""
|
|
177
|
+
return self._db_dict[BudName.dark_exposure_times]
|
|
178
|
+
|
|
179
|
+
@property
|
|
180
|
+
def dark_readout_exp_times(self) -> [float]:
|
|
181
|
+
"""Get a list of readout exp times for all DARK frames."""
|
|
182
|
+
return self._db_dict[BudName.dark_readout_exp_times]
|
|
183
|
+
|
|
184
|
+
@property
|
|
185
|
+
def wavelength(self) -> float:
|
|
186
|
+
"""Wavelength."""
|
|
187
|
+
return self._db_dict[BudName.wavelength]
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from enum import StrEnum
|
|
6
|
-
from enum import unique
|
|
7
6
|
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
8
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
from astropy.io import fits
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
NOT_FOUND_MESSAGE = "_HEADER_KEYWORD_NOT_FOUND"
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
@unique
|
|
16
15
|
class MetadataKey(StrEnum):
|
|
17
16
|
"""Controlled list of names for FITS metadata header keys."""
|
|
18
17
|
|
|
@@ -40,19 +39,6 @@ class MetadataKey(StrEnum):
|
|
|
40
39
|
fpa_exposure_time_ms = "XPOSURE"
|
|
41
40
|
sensor_readout_exposure_time_ms = "TEXPOSUR"
|
|
42
41
|
num_raw_frames_per_fpa = "NSUMEXP"
|
|
43
|
-
camera_id = "CAM_ID"
|
|
44
|
-
camera_name = "CAMERA"
|
|
45
|
-
camera_bit_depth = "BITDEPTH"
|
|
46
|
-
hardware_binning_x = "HWBIN1"
|
|
47
|
-
hardware_binning_y = "HWBIN2"
|
|
48
|
-
software_binning_x = "SWBIN1"
|
|
49
|
-
software_binning_y = "SWBIN2"
|
|
50
|
-
observing_program_execution_id = "OBSPR_ID"
|
|
51
|
-
telescope_tracking_mode = "TELTRACK"
|
|
52
|
-
coude_table_tracking_mode = "TTBLTRCK"
|
|
53
|
-
telescope_scanning_mode = "TELSCAN"
|
|
54
|
-
light_level = "LIGHTLVL"
|
|
55
|
-
hls_version = "HLSVERS"
|
|
56
42
|
|
|
57
43
|
|
|
58
44
|
class FitsAccessBase:
|
|
@@ -82,6 +68,29 @@ class FitsAccessBase:
|
|
|
82
68
|
def __repr__(self):
|
|
83
69
|
return f"{self.__class__.__name__}(hdu={self._hdu!r}, name={self.name!r}, auto_squeeze={self.auto_squeeze})"
|
|
84
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
|
+
|
|
85
94
|
@property
|
|
86
95
|
def data(self) -> np.ndarray:
|
|
87
96
|
"""
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
from dkist_processing_common.models.constants import BudName
|
|
4
4
|
from dkist_processing_common.models.fits_access import MetadataKey
|
|
5
|
-
from dkist_processing_common.models.task_name import TaskName
|
|
6
5
|
from dkist_processing_common.parsers.id_bud import ContributingIdsBud
|
|
7
|
-
from dkist_processing_common.parsers.
|
|
6
|
+
from dkist_processing_common.parsers.id_bud import IdBud
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
class ExperimentIdBud(
|
|
9
|
+
class ExperimentIdBud(IdBud):
|
|
11
10
|
"""Class to create a Bud for the experiment_id."""
|
|
12
11
|
|
|
13
12
|
def __init__(self):
|
|
14
13
|
super().__init__(
|
|
15
|
-
constant_name=BudName.experiment_id,
|
|
16
|
-
metadata_key=MetadataKey.experiment_id,
|
|
17
|
-
ip_task_types=TaskName.observe,
|
|
14
|
+
constant_name=BudName.experiment_id, metadata_key=MetadataKey.experiment_id
|
|
18
15
|
)
|
|
19
16
|
|
|
20
17
|
|
|
@@ -23,6 +20,5 @@ class ContributingExperimentIdsBud(ContributingIdsBud):
|
|
|
23
20
|
|
|
24
21
|
def __init__(self):
|
|
25
22
|
super().__init__(
|
|
26
|
-
|
|
27
|
-
metadata_key=MetadataKey.experiment_id,
|
|
23
|
+
stem_name=BudName.contributing_experiment_ids, metadata_key=MetadataKey.experiment_id
|
|
28
24
|
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Base classes for ID bud parsing."""
|
|
2
|
+
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Type
|
|
5
|
+
|
|
6
|
+
from dkist_processing_common.models.flower_pot import SpilledDirt
|
|
7
|
+
from dkist_processing_common.models.flower_pot import Stem
|
|
8
|
+
from dkist_processing_common.models.task_name import TaskName
|
|
9
|
+
from dkist_processing_common.parsers.l0_fits_access import L0FitsAccess
|
|
10
|
+
from dkist_processing_common.parsers.unique_bud import TaskUniqueBud
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class IdBud(TaskUniqueBud):
|
|
14
|
+
"""Base class for ID buds."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, constant_name: str, metadata_key: str | StrEnum):
|
|
17
|
+
super().__init__(
|
|
18
|
+
constant_name=constant_name,
|
|
19
|
+
metadata_key=metadata_key,
|
|
20
|
+
ip_task_types=TaskName.observe,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ContributingIdsBud(Stem):
|
|
25
|
+
"""Base class for contributing ID buds."""
|
|
26
|
+
|
|
27
|
+
def __init__(self, stem_name: str, metadata_key: str | StrEnum):
|
|
28
|
+
super().__init__(stem_name=stem_name)
|
|
29
|
+
if isinstance(metadata_key, StrEnum):
|
|
30
|
+
metadata_key = metadata_key.name
|
|
31
|
+
self.metadata_key = metadata_key
|
|
32
|
+
|
|
33
|
+
def setter(self, fits_obj: L0FitsAccess) -> str | Type[SpilledDirt]:
|
|
34
|
+
"""
|
|
35
|
+
Set the id for any type of frame.
|
|
36
|
+
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
fits_obj
|
|
40
|
+
The input fits object
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
The id
|
|
44
|
+
"""
|
|
45
|
+
return getattr(fits_obj, self.metadata_key)
|
|
46
|
+
|
|
47
|
+
def getter(self, key) -> tuple:
|
|
48
|
+
"""
|
|
49
|
+
Get all ids seen in non observe frames.
|
|
50
|
+
|
|
51
|
+
Parameters
|
|
52
|
+
----------
|
|
53
|
+
key
|
|
54
|
+
The input key
|
|
55
|
+
|
|
56
|
+
Returns
|
|
57
|
+
-------
|
|
58
|
+
IDs from non observe frames
|
|
59
|
+
"""
|
|
60
|
+
return tuple(set(self.key_to_petal_dict.values()))
|
|
@@ -27,6 +27,6 @@ class L0FitsAccess(L1FitsAccess):
|
|
|
27
27
|
auto_squeeze: bool = True,
|
|
28
28
|
):
|
|
29
29
|
super().__init__(hdu=hdu, name=name, auto_squeeze=auto_squeeze)
|
|
30
|
-
self.
|
|
31
|
-
self.
|
|
32
|
-
self.
|
|
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
|
|
@@ -66,14 +66,14 @@ class NearFloatBud(Stem):
|
|
|
66
66
|
-------
|
|
67
67
|
The mean value associated with this input key
|
|
68
68
|
"""
|
|
69
|
-
|
|
70
|
-
biggest_value = max(
|
|
71
|
-
smallest_value = min(
|
|
69
|
+
value_set = list(self.key_to_petal_dict.values())
|
|
70
|
+
biggest_value = max(value_set)
|
|
71
|
+
smallest_value = min(value_set)
|
|
72
72
|
if biggest_value - smallest_value > self.tolerance:
|
|
73
73
|
raise ValueError(
|
|
74
74
|
f"{self.stem_name} values are not close enough. Max: {biggest_value}, Min: {smallest_value}, Tolerance: {self.tolerance}"
|
|
75
75
|
)
|
|
76
|
-
return mean(
|
|
76
|
+
return mean(value_set)
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
class TaskNearFloatBud(NearFloatBud):
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Proposal Id parser."""
|
|
2
|
+
|
|
3
|
+
from dkist_processing_common.models.constants import BudName
|
|
4
|
+
from dkist_processing_common.models.fits_access import MetadataKey
|
|
5
|
+
from dkist_processing_common.parsers.id_bud import ContributingIdsBud
|
|
6
|
+
from dkist_processing_common.parsers.id_bud import IdBud
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ProposalIdBud(IdBud):
|
|
10
|
+
"""Class to create a Bud for the proposal_id."""
|
|
11
|
+
|
|
12
|
+
def __init__(self):
|
|
13
|
+
super().__init__(constant_name=BudName.proposal_id, metadata_key=MetadataKey.proposal_id)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ContributingProposalIdsBud(ContributingIdsBud):
|
|
17
|
+
"""Class to create a Bud for the proposal_ids."""
|
|
18
|
+
|
|
19
|
+
def __init__(self):
|
|
20
|
+
super().__init__(
|
|
21
|
+
stem_name=BudName.contributing_proposal_ids, metadata_key=MetadataKey.proposal_id
|
|
22
|
+
)
|