Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix provenance #116

Merged
merged 5 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions osa/provenance/config/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ activities:
# entityName: AnalysisConfigFile
# value: CalibrationConfigurationFile
# filepath: /fefs/aswg/software/virtual_env/ctasoft/cta-lstchain/lstchain/data/onsite_camera_calibration_param.json
# - role: "Systematics correction file"
# description: "Systematics correction file"
# entityName: SystematicsCorrectionFile
# value: SystematicsCorrectionFile
# - role: "Systematic correction file"
# description: "Systematic correction file"
# entityName: SystematicCorrectionFile
# value: SystematicCorrectionFile
# filepath: /path/to/ff_systematics_file.h5
# - role: "Time calibration file"
# description: "Time calibration file"
Expand Down Expand Up @@ -155,6 +155,11 @@ activities:
entityName: PointingFile
value: PointingFile
# filepath: /fefs/home/lapp/DrivePositioning/drive_log_20_02_18.txt
- role: "Interleaved pedestal events file"
description: "Interleaved pedestal events file"
entityName: InterleavedPedestalEventsFile
value: InterleavedPedestalEventsFile
# filepath: .../path/to/interleaved/pedestal/events.h5
- role: "Run summary"
description: "Run summary configuration"
entityName: RunSummaryFile
Expand Down Expand Up @@ -378,10 +383,14 @@ entities:
description: "Coefficients calibration file in HDF5 format on the disk"
type: File
contentType: application/x-hdf
# SystematicsCorrectionFile:
# description: "Systematics correction file in HDF5 format on the disk"
# type: File
# contentType: application/x-hdf
SystematicCorrectionFile:
description: "Systematic correction file in HDF5 format on the disk"
type: File
contentType: application/x-hdf
InterleavedPedestalEventsFile:
description: "Interleaved pedestal events file in HDF5 format on the disk"
type: File
contentType: application/x-hdf
TimeCalibrationFile:
description: "Time calibration file in HDF5 format on the disk"
type: File
Expand Down
9 changes: 6 additions & 3 deletions osa/provenance/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def parse_variables(class_instance):
# systematic_corr [3] .../20200101/pro/no_sys_corrected_calibration_scan_fit_20210514.0000.h5
# drive_file [4] .../DrivePositioning/drive_log_20_02_18.txt
# run_summary_file [5] .../RunSummary/RunSummary_20200101.ecsv
# pedestal_ids_file [6] .../RunSummary/RunSummary_20200101.ecsv
# pedestal_ids_file [6] .../path/to/interleaved/pedestal/events.h5
# run_str [7] 02006.0000

run_subrun_id = class_instance.args[7]
Expand All @@ -115,14 +115,17 @@ def parse_variables(class_instance):
class_instance.PedestalFile = pedestal_file
class_instance.TimeCalibrationFile = timecalibration_file
class_instance.SystematicCorrectionFile = systematic_correction_file
class_instance.PointingFile = os.path.realpath(class_instance.args[3])
class_instance.RunSummaryFile = os.path.realpath(class_instance.args[4])
class_instance.PointingFile = os.path.realpath(class_instance.args[4])
class_instance.RunSummaryFile = os.path.realpath(class_instance.args[5])
class_instance.DL1SubrunDataset = os.path.realpath(
f"{outdir_dl1}/dl1_LST-1.Run{run_subrun_id}.h5"
)
class_instance.MuonsSubrunDataset = os.path.realpath(
f"{muon_dir}/muons_LST-1.Run{run_subrun_id}.fits"
)
class_instance.InterleavedPedestalEventsFile = None
if class_instance.args[6] is not None:
class_instance.InterleavedPedestalEventsFile = os.path.realpath(class_instance.args[6])

if class_instance.__name__ == "dl1ab":
# run_str [0] 02006.0000
Expand Down
8 changes: 4 additions & 4 deletions osa/scripts/tests/test_osa_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ def test_simulate_processing(

with open(json_file_dl1) as file:
dl1 = yaml.safe_load(file)
assert len(dl1["entity"]) == 26
assert len(dl1["entity"]) == 16
assert len(dl1["activity"]) == 4
assert len(dl1["used"]) == 23
assert len(dl1["used"]) == 13
assert len(dl1["wasGeneratedBy"]) == 7

with open(json_file_dl2) as file:
dl2 = yaml.safe_load(file)
assert len(dl2["entity"]) == 35
assert len(dl2["entity"]) == 25
assert len(dl2["activity"]) == 6
assert len(dl2["used"]) == 31
assert len(dl2["used"]) == 21
assert len(dl2["wasGeneratedBy"]) == 12

rc = run_program("simulate_processing", "-p")
Expand Down