CalibrationDB#

class lstcam_calib.io.database.CalibrationDB(**kwargs: Any)#

Bases: Component

Archive calibration meta-data in mongo database.

Attributes Summary

data_tree_root

Root of the data tree.

db_name

The mongo database name, by default it will be pixel_calibration_tel_{tel_id:03d}

db_url

Url of mongo database.

tel_id

ID of telescope

Methods Summary

add_calibration_file(path, provenance_path, ...)

Add a calibration file in the database.

add_calibration_service_id(**kwargs)

Add new calibration_service_id document.

add_drs4_baseline_file(path, ...)

Add a drs4 baseline file in the database.

add_drs4_time_sampling_file(path, ...)

Add a drs4 time sampling file in the database.

add_drs4_timelapse_file(path, ...)

Add a drs4 time lapse file in the database.

add_ffactor_systematics_file(path, ...)

Add a ffactor sytematics file in the database.

disable_file_usage(type, file[, ...])

Disable usage of file for calibration.

disconnect()

Disconnect from mongo database.

enable_file_usage(type, file)

Enable usage of file.

find_document_by_file(type, path)

Return the document of a given file.

find_document_by_run(type, run[, used, ...])

Return document by local run id.

find_document_by_usage_start(type, date[, ...])

Return document with usage_start equal to date .

find_used_document_in_date(type, date[, ...])

Return document used in that date.

invalidate_file_quality(type, file)

Set the status of file's document to INVALID after check of data quality.

relative_path(path)

Return path relative to data_tree_root.

remove_file(type, file)

Remove document relative to a calibration_file.

validate_file_quality(type, file)

Validate file in database after check of data quality.

Attributes Documentation

data_tree_root#

Root of the data tree. All paths will be stored relative to this root to allow moving data etc.

db_name#

The mongo database name, by default it will be pixel_calibration_tel_{tel_id:03d}

db_url#

Url of mongo database. Default is localhost with standard port. Can be overridden with the LSTCAM_CALIB_DB_URL environment variable

tel_id#

ID of telescope

Methods Documentation

add_calibration_file(path: Path, provenance_path: Path, drs4_baseline_path: Path, drs4_time_sampling_path: Path, ffactor_systematics_path: Path, **kwargs)#

Add a calibration file in the database.

add_calibration_service_id(**kwargs)#

Add new calibration_service_id document.

add_drs4_baseline_file(path: Path, provenance_path: Path, **kwargs)#

Add a drs4 baseline file in the database.

add_drs4_time_sampling_file(path: Path, provenance_path: Path, drs4_baseline_path: Path, **kwargs)#

Add a drs4 time sampling file in the database.

add_drs4_timelapse_file(path: Path, provenance_path: Path, **kwargs)#

Add a drs4 time lapse file in the database.

add_ffactor_systematics_file(path: Path, provenance_path: Path, **kwargs)#

Add a ffactor sytematics file in the database.

disable_file_usage(type, file, lstcam_calib_version=None)#

Disable usage of file for calibration.

disconnect()#

Disconnect from mongo database.

enable_file_usage(type, file)#

Enable usage of file.

Set the usage_start value and update the valid_stop of previous used file.

find_document_by_file(type, path: Path)#

Return the document of a given file.

find_document_by_run(type, run, used=True, valid=True, lstcam_calib_version=None)#

Return document by local run id.

If used = False, search also for files not in use. If valid = False search also for not validated files. If lstcam_calib_version is None, return the document corresponding to the last processed file.

find_document_by_usage_start(type, date: datetime, lstcam_calib_version=None)#

Return document with usage_start equal to date .

find_used_document_in_date(type, date: datetime, lstcam_calib_version=None)#

Return document used in that date.

invalidate_file_quality(type, file)#

Set the status of file’s document to INVALID after check of data quality.

relative_path(path: PathLike)#

Return path relative to data_tree_root.

remove_file(type, file)#

Remove document relative to a calibration_file.

validate_file_quality(type, file)#

Validate file in database after check of data quality.