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

For a given date, Sc/Planet, magnetogram type, write all connected, open and close fieldlines into 3 different ascii files. More...

Variables

tuple log_id = module_io.open_log(__file__)
 
tuple time_0 = datetime.datetime.today()
 
string help_message
 
string scraft = 'PSP'
 
tuple error_hmodel = module_io.check_hmodel(module_io.hmodel )
 
tuple error_cmodel = module_io.check_cmodel(module_io.cmodel )
 
tuple error_magtype = module_io.check_magtype(module_io.magtype)
 
tuple error_reftime = module_io.check_reftime(module_io.reftime)
 
tuple error_scraft = module_io.check_scraft(scraft)
 
tuple date_in = module_timespace.Time()
 
tuple results
 
 present_folder = True
 
string launch_message = 'Should launch this command:\npython dir.main/connect_tool.py -hmodel %s -cmodel %s -reftime %s -magtype %s -sc %s -y %d -m %d -d %d -H %d'
 
list simu_db = results[0]
 
tuple folder_parent = os.path.join('dir.output','TMP')
 
list operation_mode = simu_db['operation_mode']
 
tuple folder_output = module_io.output_localname(module_io.hmodel,module_io.cmodel,module_io.reftime,scraft,module_io.magtype,operation_mode,date_in.datetime)
 
tuple rand_int = str(int(random.uniform(0,1000)))
 
tuple path_output = os.path.join(folder_parent,folder_output)
 
tuple path_param = os.path.join(simu_db['dirname'],simu_db['file_parameter'])
 
tuple stream = open(path_param,'r')
 
tuple data_param = yaml.load(stream,Loader=yaml.FullLoader)
 
tuple path_fieldlines_connecttool = os.path.join(path_output,'fieldlines_ct.ascii')
 
tuple fieldlines_close = module_fieldline.closed_fieldline(fieldlines_bot)
 
tuple path_fieldlines_close = os.path.join(path_output,'fieldlines_close.ascii')
 
tuple path_fieldlines_open = os.path.join(path_output,'fieldlines_open.ascii')
 
tuple time_2 = datetime.datetime.today()
 

Detailed Description

For a given date, Sc/Planet, magnetogram type, write all connected, open and close fieldlines into 3 different ascii files.

Fetch the corresponding Connect-tool simulation and copy its fieldlines which are connected with the Sc/Planet.
Launch Corfield-PFSS on a defined grid, in bottom/top mode for close/open fieldlines.

Author
M. Indurain
Date
2019

Input

Usage:
python full_sphere_fieldline.py -hmodel heliospheric_model -cmodel coronal_model -magtype magnetic_type -reftime reference_time -sc sc_name -y year -m month -d day -H hour
where:

Variable Documentation

tuple full_sphere_fieldline.data_param = yaml.load(stream,Loader=yaml.FullLoader)
tuple full_sphere_fieldline.date_in = module_timespace.Time()
tuple full_sphere_fieldline.error_cmodel = module_io.check_cmodel(module_io.cmodel )
tuple full_sphere_fieldline.error_hmodel = module_io.check_hmodel(module_io.hmodel )
tuple full_sphere_fieldline.error_magtype = module_io.check_magtype(module_io.magtype)
tuple full_sphere_fieldline.error_reftime = module_io.check_reftime(module_io.reftime)
tuple full_sphere_fieldline.error_scraft = module_io.check_scraft(scraft)
tuple full_sphere_fieldline.fieldlines_close = module_fieldline.closed_fieldline(fieldlines_bot)
tuple full_sphere_fieldline.folder_parent = os.path.join('dir.output','TMP')
string full_sphere_fieldline.help_message
Initial value:
1 = """
2 For a given date, Sc/Planet, magnetogram type, write all connected, open and close fieldlines into 3 different ascii files.
3 Fetch the corresponding Connect-tool simulation and copy its fieldlines which are connected with the Sc/Planet.
4 Launch Corfield-PFSS on a defined grid, in bottom/top mode for close/open fieldlines.\n
5 Usage :\n
6 python full_sphere_fieldline.py -sc sc_name -hmodel heliospheric_model -cmodel coronal_model -magtype magnetic_type -reftime reference_time -sc sc_name -y year -m month -d day -H hour
7 [-h] : brief help
8 scName : SC/Planet name. PSP,STA,EARTH. Default PSP
9 heliospheric_model : Heliospheric model. PARKER. Default PARKER.
10 coronal_model : Coronal model. PFSS only.
11 magnetic_type : Type of magnetic data. WSO,NSO,ADAPT for PFSS coronal model. Default WSO.
12 reference_time : Referential time. SCTIME,SUNTIME. Default SCTIME.
13 year : year in UTC. Default today UTC year.
14 month : month in UTC. Default today UTC month.
15 day : day in UTC. Default today UTC day.
16 hour : hour in UTC. Default 0.
17 """
string full_sphere_fieldline.launch_message = 'Should launch this command:\npython dir.main/connect_tool.py -hmodel %s -cmodel %s -reftime %s -magtype %s -sc %s -y %d -m %d -d %d -H %d'
tuple full_sphere_fieldline.log_id = module_io.open_log(__file__)
list full_sphere_fieldline.operation_mode = simu_db['operation_mode']
tuple full_sphere_fieldline.path_fieldlines_close = os.path.join(path_output,'fieldlines_close.ascii')
tuple full_sphere_fieldline.path_fieldlines_connecttool = os.path.join(path_output,'fieldlines_ct.ascii')
tuple full_sphere_fieldline.path_fieldlines_open = os.path.join(path_output,'fieldlines_open.ascii')
tuple full_sphere_fieldline.path_output = os.path.join(folder_parent,folder_output)
tuple full_sphere_fieldline.path_param = os.path.join(simu_db['dirname'],simu_db['file_parameter'])
full_sphere_fieldline.present_folder = True
tuple full_sphere_fieldline.rand_int = str(int(random.uniform(0,1000)))
tuple full_sphere_fieldline.results
Initial value:
1 = module_db.find_element(module_db.database_table,connector,cursor,\
2  scraft = scraft,\
3  heliospheric_model = module_io.hmodel,\
4  coronal_model = module_io.cmodel,\
5  reference_time = module_io.reftime,\
6  magnetogram_type = module_io.magtype,\
7  date = date_in.datetime.strftime('%Y-%m-%d %H:%M:%S'),\
8  orderby='ASC',ordercol='operation_mode_id')
def find_element
Find an element in a table.
Definition: module_db.py:257
list full_sphere_fieldline.scraft = 'PSP'
list full_sphere_fieldline.simu_db = results[0]
tuple full_sphere_fieldline.stream = open(path_param,'r')
tuple full_sphere_fieldline.time_0 = datetime.datetime.today()
tuple full_sphere_fieldline.time_2 = datetime.datetime.today()