ecpi.database.interact_sdb module

Section author: ECLAIRs GP team

SDB interface

Summary

Classes:

SdbParameters

#TODO: may be simpler solution can be used than a singleton

Class diagram:

Functions:

download_url_and_rename

return

if the operation succeeded

extract_type

from ECL-EVT-CAL_UTCtotootxxx.fits extract ECL-EVT-CAL

find_name_last_download

param obs_id

get_url_query

return url SDB query

get_url_with_namefile

param n_file

ping_sdb

Ping SDB server.

receive_event_att_files

Receive event ECL-EVT-SEC_XXX.fits or SVO-ATT-CNV_XXX.fits files from the SDB.

receive_qla1_files_with_sdb

param destination_dir

path to destination directory

send_product_ecpi

Send L1 product generated by the ECLAIRs pipeline to the SDB.

send_product_ecpi_to_sdb

Send L1 product generated by the ECLAIRs pipeline to the SDB.

Reference

class SdbParameters(*args, **kargs)[source]

Bases: object

#TODO: may be simpler solution can be used than a singleton

instance = None
download_url_and_rename(url_file, dest_dir, new_name='')[source]
Returns

if the operation succeeded

Return type

bool

extract_type(n_file)[source]

from ECL-EVT-CAL_UTCtotootxxx.fits extract ECL-EVT-CAL

Parameters

n_file

find_name_last_download(acronym)[source]
Parameters
  • obs_id

  • type_obj

get_url_query()[source]

return url SDB query

get_url_with_namefile(n_file, prod_acronyme='', level_obj='l1')[source]
Parameters
  • n_file

  • prod_acronyme

  • level_obj

ping_sdb(count=2)[source]

Ping SDB server.

receive_event_att_files(sdb_filename, dest_dir)[source]

Receive event ECL-EVT-SEC_XXX.fits or SVO-ATT-CNV_XXX.fits files from the SDB.

Parameters
  • sdb_filename (str) – name of file to be downloaded from SDB

  • dest_dir (str) – path of the destination directory

Returns

if the operation succeeded

Return type

bool

receive_qla1_files_with_sdb(destination_dir)[source]
Parameters

destination_dir – path to destination directory

Type

destination_dir: string

Returns

send_product_ecpi(path_product)[source]

Send L1 product generated by the ECLAIRs pipeline to the SDB.

Check if input file has registered CARD KW value for DC1: ECL-SKY-IMA, ECL-SOP-IMA, ECL-DET-UBC and ECL-EVT-CAL.

Parameters

path_product (str) – path to the .fits file to be sent.

Returns

if the operation succeeded

Return type

bool

send_product_ecpi_to_sdb(path_product)[source]

Send L1 product generated by the ECLAIRs pipeline to the SDB.

Check if input file has registered CARD KW value for DC1: ECL-SKY-IMA, ECL-SOP-IMA, ECL-DET-UBC and ECL-EVT-CAL.

Parameters

path_product (str) – path to the .fits file to be sent.

Returns

if the operation succeeded

Return type

bool