ecpi.database.interact_caldb module

Section author: ECLAIRs GP team

CALDB interface

Summary

Classes:

CaldbIo

(A)synchronous HTTP client

Class diagram:

Functions:

call_quzcif

CALDB request quzcif

download_file_from_caldb

Simple download with API REST interface / JM Colley .

execute

Simple subprocess run

receive_arf_file_from_caldb

Receive ARf file from the CALDB.

rename_arf

Rename arf with correct syntaxe

rename_arf_dc2

Rename arf with correct syntaxe

send_file_to_caldb

Send whatever file to CALDB.

Reference

class CaldbIo(search_url='https://fsc.svom.org/caldb/api', max_tries=5, ssl_context=None, asynchronous=False, loop=None, use_tokens=True)[source]

Bases: svom.messaging.httpio.HttpIo

(A)synchronous HTTP client

get_list_cal_files(class_type)[source]
save_caldb_last_fits_files(dir_name=None, **kwargs)[source]

Dumps fits file as {dirname}/{filename} for a given search. if the keyword args search leads to multiple entries filename should not be provided. Returns list of file paths

call_quzcif(filetype='ECL-RSP-ARF')[source]

CALDB request quzcif

download_file_from_caldb(dest_dir, file_calib, path_caldb='user/data/svom/ecl/cpf/arf_effarea')[source]

Simple download with API REST interface / JM Colley .. note: for the moment the download does not account for the port 5000. Otherwise it does not work. :param dest_dir: destination directory :type dest_dir: str :param file_calib: name of the calibration file to be downloaded :type file_calib: str :param path_caldb: root path in caldb :type path_caldb: str

execute(cmd)[source]

Simple subprocess run

receive_arf_file_from_caldb(dest_dir)[source]

Receive ARf file from the CALDB.

Parameters

dest_dir (str) – path of the destination directory

Returns

if the operation succeeded

Return type

bool

rename_arf(arf_path)[source]

Rename arf with correct syntaxe

rename_arf_dc2(arf_path)[source]

Rename arf with correct syntaxe

send_file_to_caldb(file)[source]

Send whatever file to CALDB. Usefull for tests. Not to be used in production.

Following keywords MUST appear in primary hdu file:

“TELESCOP” = “SVOM” “INSTRUME” = “ECL” “CCLS0001” = “BCF” “CDTP0001” = “DATA” “CCNM0001” = “ARF” “CVSD0001” = “1999-01-01” “CVST0001” = “00:00:00” “CDES0001” = “test dataset”

The KW CCNM0001 specifies the type in your request.

Parameters

file (str) – path to the file to be sent to CALDB