ConnectTool
 All Classes Namespaces Files Functions Variables Pages
Functions | Variables
search_database Namespace Reference

Search in database. More...

Functions

def db_error
 Common error if not taken into account by the database. More...
 

Variables

string help_message
 
list type_list = []
 
 log_id = None
 
tuple result = module_prompt.prompt_inlist(['PARKER'])
 Tree as a dictionnary dict_in = {} value = 'root '; dict_in[value.strip()] = ['Output']. More...
 
string table_name = 'simulation'
 
list hmodel = type_list[0]
 
list cmodel = type_list[1]
 
list reftime = type_list[2]
 
list magtype = type_list[3]
 
list scraft = type_list[4]
 
tuple time_in = module_timespace.Time()
 
tuple answer = module_prompt.prompt_datetime_or_integer('Date (YYYY-mm-dd HH) or Carrington rotation? ')
 
tuple results
 
 present_folder = True
 
tuple error_db = module_io.ErrorClass(False,'')
 
list simu_db = results[0]
 

Detailed Description

Search in database.

Interactive prompt.

Function Documentation

def search_database.db_error (   type_name)

Common error if not taken into account by the database.

Variable Documentation

tuple search_database.answer = module_prompt.prompt_datetime_or_integer('Date (YYYY-mm-dd HH) or Carrington rotation? ')
list search_database.cmodel = type_list[1]
tuple search_database.error_db = module_io.ErrorClass(False,'')
string search_database.help_message
Initial value:
1 = """
2 Search in database with an interactive prompt.
3 Usage :\n
4 python dir.main/search_database.py
5 """
list search_database.hmodel = type_list[0]
search_database.log_id = None
list search_database.magtype = type_list[3]
search_database.present_folder = True
list search_database.reftime = type_list[2]
tuple search_database.result = module_prompt.prompt_inlist(['PARKER'])

Tree as a dictionnary dict_in = {} value = 'root '; dict_in[value.strip()] = ['Output'].

value = 'Output ' ; dict_in[value.strip()] = ['PARKER']

value = 'PARKER '; dict_in[value.strip()] = ['PFSS']

value = 'PFSS '; dict_in[value.strip()] = ['SCTIME','SUNTIME']

mag_list = ['WSO','NSO','ADAPT'] value = 'SCTIME '; dict_in[value.strip()] = mag_list value = 'SUNTIME '; dict_in[value.strip()] = mag_list

sc_list = ['PSP','EARTH','STA','ALL'] value = 'WSO '; dict_in[value.strip()] = sc_list value = 'NSO '; dict_in[value.strip()] = sc_list value = 'ADAPT '; dict_in[value.strip()] = sc_list

Tree as a tree root = module_tree.dict2tree(dict_in)

module_tree.level = 0 module_tree.nice_print(root)

Interactive navigation within the tree node = root while node.get_nchildren() > 0: if node.children[0].id == 'None': swd_error('s'%(node.id)) if node.parent is not None: node = node.parent else: node = node if type_list != []: del type_list[-1] continue list_in = [] for child in node.children: list_in.append(child.id) list_in.append('back') result = module_prompt.prompt_inlist(list_in) if result == 'back': if node.parent is not None: node = node.parent else: node = node if type_list != []: del type_list[-1] else: print(result) type_list.append(result) i0 = list_in.index(result) node = node.children[i0]

tuple search_database.results
Initial value:
1 = module_db.find_element(table_name,connector,cursor,\
2  scraft = scraft,\
3  heliospheric_model = hmodel,\
4  coronal_model = cmodel,\
5  reference_time = reftime,\
6  magnetogram_type = magtype,\
7  date = time_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 search_database.scraft = type_list[4]
list search_database.simu_db = results[0]
string search_database.table_name = 'simulation'
tuple search_database.time_in = module_timespace.Time()
list search_database.type_list = []