ConnectTool
 All Classes Namespaces Files Functions Variables Pages
Variables
reformat_connect Namespace Reference

Convert Connectivity file from VX to the newest version. More...

Variables

string help_message
 
tuple today = datetime.datetime.today()
 
tuple log_name = os.path.join('logs','reformat_connect_' + '%04d'%(today.year) + '%02d'%(today.month) + '%02d'%(today.day))
 
tuple log_id = open(log_name,'a')
 
list sc_list = []
 
list magtype_list = []
 
int nsimu = -1
 
tuple date_inf = datetime.datetime(1800,1,1,0)
 
tuple date_sup = datetime.datetime(2200,1,1,0)
 
tuple folder_test = os.path.join('dir.test','REVIEW_SIMU_FP')
 
list available_simu = []
 
tuple simu_dir = module_io.output_dirname(mode,hmodel,cmodel,reftime)
 
tuple scraft = module_io.unformat_basename(os.path.splitext(os.path.basename(ifile))[0],'sc')
 
tuple magtype = module_io.unformat_basename(os.path.splitext(os.path.basename(ifile))[0],'magtype')
 
tuple date = module_io.unformat_basename(os.path.splitext(os.path.basename(ifile))[0],'date')
 
tuple mode = module_io.unformat_basename(available_simu[isimu],'mode')
 
tuple hmodel = module_io.unformat_basename(available_simu[isimu],'hmodel')
 
tuple cmodel = module_io.unformat_basename(available_simu[isimu],'cmodel')
 
tuple reftime = module_io.unformat_basename(available_simu[isimu],'reftime')
 
tuple time = module_timespace.Time()
 
tuple densitymaps_ssw = module_connectivity.build_density(fp_dict['ssw'])
 
tuple densitymaps_fsw = module_connectivity.build_density(fp_dict['fsw'])
 
list densitymaps = [densitymaps_ssw,densitymaps_fsw]
 
list times_sc = [module_timespace.Time()]
 
tuple ifile = open(os.path.join(simu_dir,available_simu[isimu]+'.ascii'),'w')
 

Detailed Description

Convert Connectivity file from VX to the newest version.

Rename the old .ascii file and replace it with the new one.

Author
M. Indurain
Date
01 Jan 2019

Variable Documentation

list reformat_connect.available_simu = []
tuple reformat_connect.cmodel = module_io.unformat_basename(available_simu[isimu],'cmodel')
tuple reformat_connect.date = module_io.unformat_basename(os.path.splitext(os.path.basename(ifile))[0],'date')
tuple reformat_connect.date_inf = datetime.datetime(1800,1,1,0)
tuple reformat_connect.date_sup = datetime.datetime(2200,1,1,0)
list reformat_connect.densitymaps = [densitymaps_ssw,densitymaps_fsw]
tuple reformat_connect.densitymaps_fsw = module_connectivity.build_density(fp_dict['fsw'])
tuple reformat_connect.densitymaps_ssw = module_connectivity.build_density(fp_dict['ssw'])
tuple reformat_connect.folder_test = os.path.join('dir.test','REVIEW_SIMU_FP')
string reformat_connect.help_message
Initial value:
1 = """
2 Usage :\n
3 python dir.main/reformat_connect.py
4 [-h] : brief help
5 [-n int] : number of simu (max) to be reviewed (all available by default)
6 [-sc scName] : only existing connectivity with scName will be reviewed ([PSP,STA,EARTH] by default)
7 [-m magType] : only existing connectivity with magType will be reviewed ([WSO,NSO,ADAPT] by default)
8 [-dinf YYYYMMDDHH] : minimum date
9 [-dsup YYYYMMDDHH] : maximum date
10 """
tuple reformat_connect.hmodel = module_io.unformat_basename(available_simu[isimu],'hmodel')
tuple reformat_connect.ifile = open(os.path.join(simu_dir,available_simu[isimu]+'.ascii'),'w')
tuple reformat_connect.log_id = open(log_name,'a')
tuple reformat_connect.log_name = os.path.join('logs','reformat_connect_' + '%04d'%(today.year) + '%02d'%(today.month) + '%02d'%(today.day))
tuple reformat_connect.magtype = module_io.unformat_basename(os.path.splitext(os.path.basename(ifile))[0],'magtype')
list reformat_connect.magtype_list = []
tuple reformat_connect.mode = module_io.unformat_basename(available_simu[isimu],'mode')
tuple reformat_connect.nsimu = -1
tuple reformat_connect.reftime = module_io.unformat_basename(available_simu[isimu],'reftime')
list reformat_connect.sc_list = []
tuple reformat_connect.scraft = module_io.unformat_basename(os.path.splitext(os.path.basename(ifile))[0],'sc')
tuple reformat_connect.simu_dir = module_io.output_dirname(mode,hmodel,cmodel,reftime)
tuple reformat_connect.time = module_timespace.Time()
list reformat_connect.times_sc = [module_timespace.Time()]
tuple reformat_connect.today = datetime.datetime.today()