Storing optical throughput data in DB
Summary
I had set-upped local DB and performed existing unittests + different manual tests for calculating optical efficiency and storing it in the DB for different telescopes (LST/MST). With proper config values of DB credentials, almost everything works correctly - it creates a table in the DB if none existed, and adds the rows with the required values (screenshot on the bottom).
What is the expected correct behavior?
What else I see here to do:
- Change timestamp format to datetime (now it is processing as a float), related Issue #103 (closed) and MR !90 (merged)
- We need to have some unique key for every row which will serve as
dataTable_idto connect it with appropriate metadata. I see it as e.g. auto-incremented value ofidfor each row. Or here can be implemented better solution? Related Issue #135 (closed) - Do we need additional field to describe instrument/camera (to distinguish between LST/NectarCam/FlashCam/SST)? Or at the end each particular telescope will have its unique
tel_idnumber so it will be enough to preserve only this value in DB. - Need to add correct processing of full
.yamlconfig in tests, instead of existing draft.jsonversion, appropriate.yamlconfig already downloaded to the repo, appropriate Issue #90 (closed) already was created. MR !62 (merged) with uploaded full config. - I found an existing problem in the function
update_throughput_db()fromtools/throughput_calibrator.pyin the case when nooptical_throughputfor the processed data was calculated. Then unexpected error is raised andthroughput_calibratortool is interrupted. Need to create the Bug Issue and solve the problem to correctly handle the case when no muons were fitted.
Relevant logs and/or screenshots
I tested also run_tool for throughput_calibrator with parameter write_db = True as I believe it should works finally - and it interact with DB as expected:
