SWDatabase
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Variables
fetchchole.fetch_solarmonitor_chimera_chole Namespace Reference

Variables

string help_message
 
tuple date_begin = module_common.utc_today-datetime.timedelta(days=10)
 
tuple date_end = datetime.datetime(module_common.utc_today.year+1,12,31)
 
 last_data = False
 
 first_data = False
 
 download = True
 
int verbose = 0
 
string fetch_type = 'SOLARMONITOR_CHIMERA'
 
list local_dir = interface_fetch_chole.fetch_info[fetch_type]
 
list table_name = interface_fetch_chole.fetch_info[fetch_type]
 
tuple log_name = os.path.join('logs','fetch_chole_solarmonitor_chimera_' + '%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 time_in = module_timespace.Time()
 
tuple logs = database_chole.init_db(database_chole.database_path,1)
 
string message = '... Connecting to and reading /solarmonitor.org website...'
 
tuple server = interface_fetch_chole.connect_remote_server(fetch_type)
 
tuple all_remote_files = interface_fetch_chole.read_remote_server(fetch_type,server,date_min = date_begin,date_max = date_end)
 
list pattern = interface_fetch_chole.fetch_info[fetch_type]
 
tuple metafile = interface_fetch_chole.MetaFile()
 
list remote_files_fm1 = [ all_remote_files[-1] ]
 
tuple to_be_downloaded = interface_fetch_chole.vn2vnp1(remote_files_fm1,fetch_type,-1)
 
list downloaded_files = []
 
list remote_files_f0 = []
 
tuple metafile_f0 = interface_fetch_chole.MetaFile()
 
tuple to_be_f1_fetched = interface_fetch_chole.vn2vnp1(remote_files_f0,fetch_type,0,local_dir = local_dir)
 
list f1_fetched_paths = []
 
 file_f0 = metafile.name
 
 path_f0 = metafile.path
 
tuple file_f1 = interface_fetch_chole.set_name_np1(fetch_type,file_f0,0,local_dir = local_dir)
 
tuple path_f1 = os.path.join(local_dir,file_f1)
 
list f1_fetched_files = []
 
list remote_files_f1 = []
 
tuple metafile_f1 = interface_fetch_chole.MetaFile()
 
tuple name_f1 = interface_fetch_chole.set_name_np1(fetch_type,metafile_f0.name,0,local_dir = local_dir)
 
tuple to_be_f2_fetched = interface_fetch_chole.vn2vnp1(remote_files_f1,fetch_type,1)
 
list f2_fetched_paths = []
 
tuple file_f2 = interface_fetch_chole.set_name_np1(fetch_type,file_f1,1)
 
tuple path_f2 = os.path.join(local_dir,file_f2)
 
tuple choles_hpc = read_chole_solarmonitor_chimera.read_ascii(path_f1)
 
string observer = 'EARTH'
 
list rsun_apparent = choles_hpc[0]
 
list date_in = choles_hpc[0]
 
list choles_hgc = []
 
list points_hpc = []
 
tuple point_hpc = module_timespace.Coordinate()
 
tuple points_hgc = module_timespace.hpc_to_hgc(obs_coordinate_hgc[0],date_in,points_hpc,rsun_apparent)
 
tuple chole_hgc = read_chole_solarmonitor_chimera.CHIMERAChole()
 
list f2_fetched_files = []
 
 file_fx = metafile.name
 
 path_vx = metafile.path
 
tuple choles = read_chole_solarmonitor_chimera.read_ascii(path_vx)
 
tuple flevel = interface_fetch_chole.find_fetch_level(fetch_type,file_fx)
 
list strdate_begin = choles[0]
 
list strdate_end = choles[0]
 
tuple result = database_chole.find_element([table_name],conn,cur,filename = file_fx)
 
tuple n_contour = len(choles)
 
tuple modification_date = metafile.mdate.strftime('%Y-%m-%d %H:%M:%S')
 
tuple row_id
 

Variable Documentation

list fetchchole.fetch_solarmonitor_chimera_chole.all_remote_files = interface_fetch_chole.read_remote_server(fetch_type,server,date_min = date_begin,date_max = date_end)
tuple fetchchole.fetch_solarmonitor_chimera_chole.chole_hgc = read_chole_solarmonitor_chimera.CHIMERAChole()
tuple fetchchole.fetch_solarmonitor_chimera_chole.choles = read_chole_solarmonitor_chimera.read_ascii(path_vx)
list fetchchole.fetch_solarmonitor_chimera_chole.choles_hgc = []
tuple fetchchole.fetch_solarmonitor_chimera_chole.choles_hpc = read_chole_solarmonitor_chimera.read_ascii(path_f1)
tuple fetchchole.fetch_solarmonitor_chimera_chole.date_begin = module_common.utc_today-datetime.timedelta(days=10)
tuple fetchchole.fetch_solarmonitor_chimera_chole.date_end = datetime.datetime(module_common.utc_today.year+1,12,31)
list fetchchole.fetch_solarmonitor_chimera_chole.date_in = choles_hpc[0]
fetchchole.fetch_solarmonitor_chimera_chole.download = True
list fetchchole.fetch_solarmonitor_chimera_chole.downloaded_files = []
list fetchchole.fetch_solarmonitor_chimera_chole.f1_fetched_files = []
list fetchchole.fetch_solarmonitor_chimera_chole.f1_fetched_paths = []
list fetchchole.fetch_solarmonitor_chimera_chole.f2_fetched_files = []
list fetchchole.fetch_solarmonitor_chimera_chole.f2_fetched_paths = []
string fetchchole.fetch_solarmonitor_chimera_chole.fetch_type = 'SOLARMONITOR_CHIMERA'
fetchchole.fetch_solarmonitor_chimera_chole.file_f0 = metafile.name
fetchchole.fetch_solarmonitor_chimera_chole.file_f1 = interface_fetch_chole.set_name_np1(fetch_type,file_f0,0,local_dir = local_dir)
tuple fetchchole.fetch_solarmonitor_chimera_chole.file_f2 = interface_fetch_chole.set_name_np1(fetch_type,file_f1,1)
fetchchole.fetch_solarmonitor_chimera_chole.file_fx = metafile.name
fetchchole.fetch_solarmonitor_chimera_chole.first_data = False
tuple fetchchole.fetch_solarmonitor_chimera_chole.flevel = interface_fetch_chole.find_fetch_level(fetch_type,file_fx)
string fetchchole.fetch_solarmonitor_chimera_chole.help_message
Initial value:
1 = """
2 Download coronal hole file from fetch type SOLARMONITOR_CHIMERA.\n
3 Usage :\n
4 python fetchchole/fetch_solarmonitor_chimera_chole.py
5 [-h] : brief help
6 [-b YYYMMDD] : begin date from which it fetched data. Default today - 10 days.
7 [-e YYYMMDD] : end date from which it fetched data. Default is last day of next year.
8 [--last-data] : only the last available data will be fetch
9 [--first-data] : only the first available data will be fetch. Download only the data right after begin date.
10 [--format-vx] : format existing fetch level 0 file into fetch level n (n>0) format only, do not connect to server. Default: False.
11 [-v] : verbose mode. Default None.
12 """
fetchchole.fetch_solarmonitor_chimera_chole.last_data = False
list fetchchole.fetch_solarmonitor_chimera_chole.local_dir = interface_fetch_chole.fetch_info[fetch_type]
tuple fetchchole.fetch_solarmonitor_chimera_chole.log_id = open(log_name,'a')
tuple fetchchole.fetch_solarmonitor_chimera_chole.log_name = os.path.join('logs','fetch_chole_solarmonitor_chimera_' + '%04d'%(module_common.utc_today.year) + '%02d'%(module_common.utc_today.month) + '%02d'%(module_common.utc_today.day))
list fetchchole.fetch_solarmonitor_chimera_chole.logs = database_chole.init_db(database_chole.database_path,1)
string fetchchole.fetch_solarmonitor_chimera_chole.message = '... Connecting to and reading /solarmonitor.org website...'
tuple fetchchole.fetch_solarmonitor_chimera_chole.metafile = interface_fetch_chole.MetaFile()
tuple fetchchole.fetch_solarmonitor_chimera_chole.metafile_f0 = interface_fetch_chole.MetaFile()
tuple fetchchole.fetch_solarmonitor_chimera_chole.metafile_f1 = interface_fetch_chole.MetaFile()
tuple fetchchole.fetch_solarmonitor_chimera_chole.modification_date = metafile.mdate.strftime('%Y-%m-%d %H:%M:%S')
tuple fetchchole.fetch_solarmonitor_chimera_chole.n_contour = len(choles)
tuple fetchchole.fetch_solarmonitor_chimera_chole.name_f1 = interface_fetch_chole.set_name_np1(fetch_type,metafile_f0.name,0,local_dir = local_dir)
string fetchchole.fetch_solarmonitor_chimera_chole.observer = 'EARTH'
fetchchole.fetch_solarmonitor_chimera_chole.path_f0 = metafile.path
fetchchole.fetch_solarmonitor_chimera_chole.path_f1 = os.path.join(local_dir,file_f1)
tuple fetchchole.fetch_solarmonitor_chimera_chole.path_f2 = os.path.join(local_dir,file_f2)
fetchchole.fetch_solarmonitor_chimera_chole.path_vx = metafile.path
list fetchchole.fetch_solarmonitor_chimera_chole.pattern = interface_fetch_chole.fetch_info[fetch_type]
tuple fetchchole.fetch_solarmonitor_chimera_chole.point_hpc = module_timespace.Coordinate()
tuple fetchchole.fetch_solarmonitor_chimera_chole.points_hgc = module_timespace.hpc_to_hgc(obs_coordinate_hgc[0],date_in,points_hpc,rsun_apparent)
list fetchchole.fetch_solarmonitor_chimera_chole.points_hpc = []
list fetchchole.fetch_solarmonitor_chimera_chole.remote_files_f0 = []
list fetchchole.fetch_solarmonitor_chimera_chole.remote_files_f1 = []
list fetchchole.fetch_solarmonitor_chimera_chole.remote_files_fm1 = [ all_remote_files[-1] ]
tuple fetchchole.fetch_solarmonitor_chimera_chole.result = database_chole.find_element([table_name],conn,cur,filename = file_fx)
tuple fetchchole.fetch_solarmonitor_chimera_chole.row_id
Initial value:
1 = database_chole.add_element(table_name,conn,cur,dirname=local_dir,filename=file_fx,fetch_type=fetch_type.upper(),\
2  n_contour=len(choles),date_begin=strdate_begin,date_end=strdate_end,\
3  fetch_level=flevel,modification_date=metafile.mdate.strftime('%Y-%m-%d %H:%M:%S'))
list fetchchole.fetch_solarmonitor_chimera_chole.rsun_apparent = choles_hpc[0]
tuple fetchchole.fetch_solarmonitor_chimera_chole.server = interface_fetch_chole.connect_remote_server(fetch_type)
list fetchchole.fetch_solarmonitor_chimera_chole.strdate_begin = choles[0]
list fetchchole.fetch_solarmonitor_chimera_chole.strdate_end = choles[0]
list fetchchole.fetch_solarmonitor_chimera_chole.table_name = interface_fetch_chole.fetch_info[fetch_type]
tuple fetchchole.fetch_solarmonitor_chimera_chole.time_in = module_timespace.Time()
tuple fetchchole.fetch_solarmonitor_chimera_chole.to_be_downloaded = interface_fetch_chole.vn2vnp1(remote_files_fm1,fetch_type,-1)
tuple fetchchole.fetch_solarmonitor_chimera_chole.to_be_f1_fetched = interface_fetch_chole.vn2vnp1(remote_files_f0,fetch_type,0,local_dir = local_dir)
tuple fetchchole.fetch_solarmonitor_chimera_chole.to_be_f2_fetched = interface_fetch_chole.vn2vnp1(remote_files_f1,fetch_type,1)
int fetchchole.fetch_solarmonitor_chimera_chole.verbose = 0