SWDatabase
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Variables
fetchmap2D.fetch_wso_origin_cr Namespace Reference

Variables

string help_message
 
tuple date_begin = datetime.datetime(1900,1,1)
 
tuple date_end = datetime.datetime(module_common.utc_today.year+1,12,31)
 
 last_map = False
 
 first_map = False
 
 download = True
 
int verbose = 0
 
string fetch_type = 'WSO_ORIGIN_CR'
 
list local_dir = interface_fetch_map2D.fetch_info[fetch_type]
 
list table_name = interface_fetch_map2D.fetch_info[fetch_type]
 
list data_type = interface_fetch_map2D.fetch_info[fetch_type]
 
list map_type = interface_fetch_map2D.fetch_info[fetch_type]
 
list vmin = interface_fetch_map2D.fetch_info[fetch_type]
 
list vmax = interface_fetch_map2D.fetch_info[fetch_type]
 
tuple log_name = os.path.join('logs','fetch_map2D_wso_origin_cr_' + '%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 itime1 = module_timespace.Time()
 
tuple itime2 = module_timespace.Time()
 
tuple logs = database_map2D.init_db(database_map2D.database_path,1)
 
string message = '... Connecting to and reading wso.stanford.edu website...'
 
tuple server = interface_fetch_map2D.connect_remote_server(fetch_type)
 
tuple all_remote_files = interface_fetch_map2D.read_remote_server(fetch_type,server)
 
list pattern = interface_fetch_map2D.fetch_info[fetch_type]
 
tuple metafile = interface_fetch_map2D.MetaFile()
 
 ncar_begin = itime1.ncar
 
 ncar_end = itime2.ncar
 
list remote_files_fm1 = [ all_remote_files[-1] ]
 
tuple to_be_downloaded = interface_fetch_map2D.vn2vnp1(remote_files_fm1,fetch_type,-1)
 
list downloaded_files = []
 
list remote_files_f0 = []
 
tuple metafile_f0 = interface_fetch_map2D.MetaFile()
 
tuple to_be_f1_fetched = interface_fetch_map2D.vn2vnp1(remote_files_f0,fetch_type,0)
 
list f1_fetched_paths = []
 
 file_f0 = metafile.name
 
 path_f0 = metafile.path
 
tuple file_f1 = interface_fetch_map2D.set_name_np1(fetch_type,file_f0,0)
 
tuple path_f1 = os.path.join(local_dir,file_f1)
 
tuple data = module_wso_wso_map2D.read_v0(path_f0)
 
list f1_fetched_files = []
 
list remote_files_f1 = []
 
tuple metafile_f1 = interface_fetch_map2D.MetaFile()
 
tuple name_f1 = interface_fetch_map2D.set_name_np1(fetch_type,metafile_f0.name,0)
 
tuple to_be_f2_fetched = interface_fetch_map2D.vn2vnp1(remote_files_f1,fetch_type,1)
 
list f2_fetched_paths = []
 
tuple current_dir = os.getcwd()
 
tuple file_f2 = interface_fetch_map2D.set_name_np1(fetch_type,file_f1,1)
 
string command = 'ln -sf '
 
list f2_fetched_files = []
 
 file_fx = metafile.name
 
tuple flevel = interface_fetch_map2D.find_fetch_level(fetch_type,file_fx)
 
tuple result = database_map2D.find_element([table_name],conn,cur,filename = file_fx)
 
tuple row_id
 

Variable Documentation

list fetchmap2D.fetch_wso_origin_cr.all_remote_files = interface_fetch_map2D.read_remote_server(fetch_type,server)
string fetchmap2D.fetch_wso_origin_cr.command = 'ln -sf '
tuple fetchmap2D.fetch_wso_origin_cr.current_dir = os.getcwd()
tuple fetchmap2D.fetch_wso_origin_cr.data = module_wso_wso_map2D.read_v0(path_f0)
list fetchmap2D.fetch_wso_origin_cr.data_type = interface_fetch_map2D.fetch_info[fetch_type]
tuple fetchmap2D.fetch_wso_origin_cr.date_begin = datetime.datetime(1900,1,1)
tuple fetchmap2D.fetch_wso_origin_cr.date_end = datetime.datetime(module_common.utc_today.year+1,12,31)
fetchmap2D.fetch_wso_origin_cr.download = True
list fetchmap2D.fetch_wso_origin_cr.downloaded_files = []
list fetchmap2D.fetch_wso_origin_cr.f1_fetched_files = []
list fetchmap2D.fetch_wso_origin_cr.f1_fetched_paths = []
list fetchmap2D.fetch_wso_origin_cr.f2_fetched_files = []
list fetchmap2D.fetch_wso_origin_cr.f2_fetched_paths = []
string fetchmap2D.fetch_wso_origin_cr.fetch_type = 'WSO_ORIGIN_CR'
fetchmap2D.fetch_wso_origin_cr.file_f0 = metafile.name
fetchmap2D.fetch_wso_origin_cr.file_f1 = interface_fetch_map2D.set_name_np1(fetch_type,file_f0,0)
tuple fetchmap2D.fetch_wso_origin_cr.file_f2 = interface_fetch_map2D.set_name_np1(fetch_type,file_f1,1)
fetchmap2D.fetch_wso_origin_cr.file_fx = metafile.name
fetchmap2D.fetch_wso_origin_cr.first_map = False
tuple fetchmap2D.fetch_wso_origin_cr.flevel = interface_fetch_map2D.find_fetch_level(fetch_type,file_fx)
string fetchmap2D.fetch_wso_origin_cr.help_message
Initial value:
1 = """
2 Download and reformat magnetic carrington maps from fetch type WSO_ORIGIN_CR.\n
3 Usage :\n
4 python dir.fetch_map2D/fetch_wso_origin_cr.py
5 [-h] : brief help
6 [-b YYYMMDD] : begin date from which it fetched data. Default -Infinity.
7 [-e YYYMMDD] : end date from which it fetched data. Default is last day of next year.
8 [--last-map] : only the last available map will be fetch
9 [--first-map] : only the first available map will be fetch. Download only the map right after begin date.
10 [--format-vx] : format existing V0 file into Vn (n>0) format only, do not connect to server. Default: False.
11 [-v] : verbose mode. Default None.
12 """
tuple fetchmap2D.fetch_wso_origin_cr.itime1 = module_timespace.Time()
tuple fetchmap2D.fetch_wso_origin_cr.itime2 = module_timespace.Time()
fetchmap2D.fetch_wso_origin_cr.last_map = False
list fetchmap2D.fetch_wso_origin_cr.local_dir = interface_fetch_map2D.fetch_info[fetch_type]
tuple fetchmap2D.fetch_wso_origin_cr.log_id = open(log_name,'a')
tuple fetchmap2D.fetch_wso_origin_cr.log_name = os.path.join('logs','fetch_map2D_wso_origin_cr_' + '%04d'%(module_common.utc_today.year) + '%02d'%(module_common.utc_today.month) + '%02d'%(module_common.utc_today.day))
list fetchmap2D.fetch_wso_origin_cr.logs = database_map2D.init_db(database_map2D.database_path,1)
list fetchmap2D.fetch_wso_origin_cr.map_type = interface_fetch_map2D.fetch_info[fetch_type]
string fetchmap2D.fetch_wso_origin_cr.message = '... Connecting to and reading wso.stanford.edu website...'
tuple fetchmap2D.fetch_wso_origin_cr.metafile = interface_fetch_map2D.MetaFile()
tuple fetchmap2D.fetch_wso_origin_cr.metafile_f0 = interface_fetch_map2D.MetaFile()
tuple fetchmap2D.fetch_wso_origin_cr.metafile_f1 = interface_fetch_map2D.MetaFile()
tuple fetchmap2D.fetch_wso_origin_cr.name_f1 = interface_fetch_map2D.set_name_np1(fetch_type,metafile_f0.name,0)
fetchmap2D.fetch_wso_origin_cr.ncar_begin = itime1.ncar
fetchmap2D.fetch_wso_origin_cr.ncar_end = itime2.ncar
fetchmap2D.fetch_wso_origin_cr.path_f0 = metafile.path
tuple fetchmap2D.fetch_wso_origin_cr.path_f1 = os.path.join(local_dir,file_f1)
list fetchmap2D.fetch_wso_origin_cr.pattern = interface_fetch_map2D.fetch_info[fetch_type]
list fetchmap2D.fetch_wso_origin_cr.remote_files_f0 = []
list fetchmap2D.fetch_wso_origin_cr.remote_files_f1 = []
list fetchmap2D.fetch_wso_origin_cr.remote_files_fm1 = [ all_remote_files[-1] ]
tuple fetchmap2D.fetch_wso_origin_cr.result = database_map2D.find_element([table_name],conn,cur,filename = file_fx)
tuple fetchmap2D.fetch_wso_origin_cr.row_id
Initial value:
1 = database_map2D.add_element(table_name,conn,cur,dirname=local_dir,filename=file_fx,\
2  fetch_type=fetch_type.upper(),data_type=data_type.upper(),map_type=map_type.upper(),\
3  date_begin=itime1.datetime.strftime('%Y-%m-%d %H:%M:%S'),date_end=itime2.datetime.strftime('%Y-%m-%d %H:%M:%S'),cr=itime1.ncar,\
4  fetch_level=flevel,modification_date=metafile.mdate.strftime('%Y-%m-%d %H:%M:%S'),vmin=vmin,vmax=vmax)
tuple fetchmap2D.fetch_wso_origin_cr.server = interface_fetch_map2D.connect_remote_server(fetch_type)
list fetchmap2D.fetch_wso_origin_cr.table_name = interface_fetch_map2D.fetch_info[fetch_type]
tuple fetchmap2D.fetch_wso_origin_cr.to_be_downloaded = interface_fetch_map2D.vn2vnp1(remote_files_fm1,fetch_type,-1)
tuple fetchmap2D.fetch_wso_origin_cr.to_be_f1_fetched = interface_fetch_map2D.vn2vnp1(remote_files_f0,fetch_type,0)
tuple fetchmap2D.fetch_wso_origin_cr.to_be_f2_fetched = interface_fetch_map2D.vn2vnp1(remote_files_f1,fetch_type,1)
int fetchmap2D.fetch_wso_origin_cr.verbose = 0
list fetchmap2D.fetch_wso_origin_cr.vmax = interface_fetch_map2D.fetch_info[fetch_type]
list fetchmap2D.fetch_wso_origin_cr.vmin = interface_fetch_map2D.fetch_info[fetch_type]