Skip to content
Snippets Groups Projects

[PNCCD][CORRECT] Record fragment file and remove pre correction notebook

Merged Karim Ahmed requested to merge feat/fragments_pnccd into feat/pnccd_calcat_interface
Files
2
+ 14
17
@@ -975,24 +975,21 @@ def write_constants_fragment(
{karabo_da: {constant_name: metadata}}
caldb_root (Path): The calibration database root path for constant files.
"""
metadata = {"retrieved-constants": {}}
for karabo_da, const_metadata in det_metadata.items():
CalibrationMetadata(out_folder).add_fragment({
"retrieved-constants": {
karabo_da: {
"constants": {
cname: {
"path": str(caldb_root / ccv_metadata["path"]),
"dataset": ccv_metadata["dataset"],
"creation-time": ccv_metadata["begin_validity_at"],
"ccv_id": ccv_metadata["ccv_id"],
} for cname, ccv_metadata in const_metadata.items()
},
"physical-name": list(
const_metadata.values())[0]["physical_name"],
},
},
})
mod_metadata = {}
mod_metadata["constants"] = {
cname: {
"path": str(caldb_root / ccv_metadata["path"]),
"dataset": ccv_metadata["dataset"],
"creation-time": ccv_metadata["begin_validity_at"],
"ccv_id": ccv_metadata["ccv_id"],
} for cname, ccv_metadata in const_metadata.items()
}
mod_metadata["physical-name"] = list(
const_metadata.values())[0]["physical_name"]
metadata["retrieved-constants"][karabo_da] = mod_metadata
CalibrationMetadata(out_folder).add_fragment(metadata)
def write_compressed_frames(
arr: np.ndarray,
Loading