SWDatabase
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Variables
fetchtimeserie.fetch_stereo_plastic Namespace Reference

Variables

string help_message
 
tuple date_begin = module_common.utc_today-datetime.timedelta(days=10)
 
 last_data = False
 
 download = True
 
string fetch_type = 'STEREOA_VELOCITY'
 
list local_dir = interface_fetch_timeserie.fetch_info[fetch_type]
 
list table_name = interface_fetch_timeserie.fetch_info[fetch_type]
 
tuple log_name = os.path.join('logs','fetch_timeserie_stereo_plastic_' + '%04d'%(module_common.utc_today.year) + '%02d'%(module_common.utc_today.month) + '%02d'%(module_common.utc_today.day))
 
tuple log_id = open(log_name,'a')
 
tuple logs = database_timeserie.init_db(database_timeserie.database_path,1)
 
tuple server = interface_fetch_timeserie.connect_remote_server(fetch_type)
 
tuple all_remote_files = interface_fetch_timeserie.read_remote_server(fetch_type,server,date_min = date_begin)
 
list pattern = interface_fetch_timeserie.fetch_info[fetch_type]
 
tuple metafile = interface_fetch_timeserie.MetaFile()
 
list remote_files_fm1 = [ all_remote_files[-1] ]
 
tuple to_be_downloaded = interface_fetch_timeserie.vn2vnp1(remote_files_fm1,fetch_type,-1)
 
list downloaded_files = []
 
list remote_files_f0 = []
 
tuple metafile_f0 = interface_fetch_timeserie.MetaFile()
 
tuple to_be_f1_fetched = interface_fetch_timeserie.vn2vnp1(remote_files_f0,fetch_type,0)
 
list f1_fetched_paths = []
 
 path_f0 = metafile.path
 
 file_f0 = metafile.name
 
tuple file_f1 = interface_fetch_timeserie.set_name_np1(fetch_type,file_f0,0)
 
tuple path_f1 = os.path.join(local_dir,file_f1)
 
list f1_fetched_files = []
 
 file_vx = metafile.name
 
tuple flevel = interface_fetch_timeserie.find_fetch_level(fetch_type,file_vx)
 
tuple date_in = interface_fetch_timeserie.get_datetime(fetch_type,flevel,file_vx)
 
tuple date_beg = datetime.datetime(date_in.year,date_in.month,date_in.day,0)
 
tuple date_end = datetime.datetime(date_in.year,date_in.month,date_in.day,23,59,59)
 
tuple result = database_timeserie.find_element([table_name],conn,cur,filename = file_vx)
 
tuple row_id
 

Variable Documentation

list fetchtimeserie.fetch_stereo_plastic.all_remote_files = interface_fetch_timeserie.read_remote_server(fetch_type,server,date_min = date_begin)
tuple fetchtimeserie.fetch_stereo_plastic.date_beg = datetime.datetime(date_in.year,date_in.month,date_in.day,0)
tuple fetchtimeserie.fetch_stereo_plastic.date_begin = module_common.utc_today-datetime.timedelta(days=10)
tuple fetchtimeserie.fetch_stereo_plastic.date_end = datetime.datetime(date_in.year,date_in.month,date_in.day,23,59,59)
tuple fetchtimeserie.fetch_stereo_plastic.date_in = interface_fetch_timeserie.get_datetime(fetch_type,flevel,file_vx)
fetchtimeserie.fetch_stereo_plastic.download = True
list fetchtimeserie.fetch_stereo_plastic.downloaded_files = []
list fetchtimeserie.fetch_stereo_plastic.f1_fetched_files = []
list fetchtimeserie.fetch_stereo_plastic.f1_fetched_paths = []
string fetchtimeserie.fetch_stereo_plastic.fetch_type = 'STEREOA_VELOCITY'
fetchtimeserie.fetch_stereo_plastic.file_f0 = metafile.name
tuple fetchtimeserie.fetch_stereo_plastic.file_f1 = interface_fetch_timeserie.set_name_np1(fetch_type,file_f0,0)
fetchtimeserie.fetch_stereo_plastic.file_vx = metafile.name
tuple fetchtimeserie.fetch_stereo_plastic.flevel = interface_fetch_timeserie.find_fetch_level(fetch_type,file_vx)
string fetchtimeserie.fetch_stereo_plastic.help_message
Initial value:
1 = """
2 Download and reformat timeserie from fetch type STEREOA_VELOCITY.\n
3 Usage :\n
4 python dir.fetch_timeserie/fetch_stereo_plastic.py
5 [-h] : brief help
6 [-b YYYMMDD] : begin date from which it fetched data. Default Today's date - 10 days.
7 [--last-data] : only the last available timeserie will be fetch
8 [--format-vx] : format existing V0 file into Vn (n>0) format only, do not connect to server. Default: False.
9 """
fetchtimeserie.fetch_stereo_plastic.last_data = False
list fetchtimeserie.fetch_stereo_plastic.local_dir = interface_fetch_timeserie.fetch_info[fetch_type]
tuple fetchtimeserie.fetch_stereo_plastic.log_id = open(log_name,'a')
tuple fetchtimeserie.fetch_stereo_plastic.log_name = os.path.join('logs','fetch_timeserie_stereo_plastic_' + '%04d'%(module_common.utc_today.year) + '%02d'%(module_common.utc_today.month) + '%02d'%(module_common.utc_today.day))
list fetchtimeserie.fetch_stereo_plastic.logs = database_timeserie.init_db(database_timeserie.database_path,1)
tuple fetchtimeserie.fetch_stereo_plastic.metafile = interface_fetch_timeserie.MetaFile()
tuple fetchtimeserie.fetch_stereo_plastic.metafile_f0 = interface_fetch_timeserie.MetaFile()
fetchtimeserie.fetch_stereo_plastic.path_f0 = metafile.path
tuple fetchtimeserie.fetch_stereo_plastic.path_f1 = os.path.join(local_dir,file_f1)
list fetchtimeserie.fetch_stereo_plastic.pattern = interface_fetch_timeserie.fetch_info[fetch_type]
list fetchtimeserie.fetch_stereo_plastic.remote_files_f0 = []
list fetchtimeserie.fetch_stereo_plastic.remote_files_fm1 = [ all_remote_files[-1] ]
tuple fetchtimeserie.fetch_stereo_plastic.result = database_timeserie.find_element([table_name],conn,cur,filename = file_vx)
tuple fetchtimeserie.fetch_stereo_plastic.row_id
Initial value:
1 = database_timeserie.add_element(table_name,conn,cur,dirname=local_dir,filename=file_vx,\
2  fetch_type=fetch_type.upper(),\
3  date_begin=date_beg,date_end=date_end,\
4  fetch_level=flevel,modification_date=metafile.mdate.strftime('%Y-%m-%d %H:%M:%S'))
tuple fetchtimeserie.fetch_stereo_plastic.server = interface_fetch_timeserie.connect_remote_server(fetch_type)
list fetchtimeserie.fetch_stereo_plastic.table_name = interface_fetch_timeserie.fetch_info[fetch_type]
tuple fetchtimeserie.fetch_stereo_plastic.to_be_downloaded = interface_fetch_timeserie.vn2vnp1(remote_files_fm1,fetch_type,-1)
tuple fetchtimeserie.fetch_stereo_plastic.to_be_f1_fetched = interface_fetch_timeserie.vn2vnp1(remote_files_f0,fetch_type,0)