parameters: (xmlPathTc, coreconf)
return_statement: return resultsModificationLayers
docstring: This method run the Classical physics core for each source independently and return the results
docstring_summary: This method run the Classical physics core for each source independently and return the results
docstring_tokens: This method run the Classical physics core for each source independently and return the results
function: def runTC(xmlPathTc, coreconf):
      """
          This method run the Classical physics core for each source independently and return the results
      """
      # TODO option to disable direct field computation
      #if not coreconf.const["ajouter_son_direct"]:
      #    return {}
      tcpath = os.path.normpath(os.path.join(os.getcwd(), "core", "classical_theory", "classicalTheory.exe"))
  
      if not os.path.exists(tcpath):
          print("Cant find classical theory program!\n %s" % tcpath, file=sys.stderr)
          exit()
      # One configuration file per source with different output path
      doc = xmlWriter.parse(xmlPathTc)
      simunode=doc.getElementsByTagName('simulation')[0]
      srclstnode=doc.getElementsByTagName('sources')[0]
      sources=srclstnode.getElementsByTagName('source')
      sub_tc=[]
      rootxml=xmlPathTc[0:xmlPathTc.rfind(os.sep)+1]
      for source in sources:
          srclstnode.removeChild(source)
      for source in sources:
          srclstnode.appendChild(source)
          idsource=source.getAttribute('id')
          s_xmlfile = os.path.join(rootxml, "config_s%s.xml" % idsource)
          s_folder='direct_s%s' % idsource
          if not os.path.exists(os.path.join(rootxml,s_folder)):
              os.mkdir(os.path.join(rootxml,s_folder))
          simunode.setAttribute('output_folder', s_folder)
          simunode.setAttribute('do_angular_weighting','0') #Pas de pondération selon l'angle d'incidence de la source
          writer = codecs.open(s_xmlfile, 'w', encoding="utf-8")
          doc.writexml(writer, encoding="utf-8")
          writer.close()
          sub_tc.append((int(idsource),s_xmlfile,s_folder))
          srclstnode.removeChild(source)
  
      # For each source we launch classical theory computation
      resultsModificationLayers = {}
      for tc_process in sub_tc:
          print(u"Execute classical theory program :\n%s %s" % (tcpath, tc_process[1]))
          sp.check_call([tcpath, tc_process[1]])
          # os.remove(tc_process[1])
          resultsModificationLayer = SoundLevelLayer()
          resultsModificationLayer.LoadData(tc_process[2], coreconf, ls)
          # os.removedirs(coreconf.paths["workingdirectory"] + tc_process[2] + os.sep)
          resultsModificationLayers[tc_process[0]] = resultsModificationLayer
      return resultsModificationLayers
function_tokens: def runTC ( xmlPathTc , coreconf ) : # TODO option to disable direct field computation #if not coreconf.const["ajouter_son_direct"]: #    return {} tcpath = os . path . normpath ( os . path . join ( os . getcwd ( ) , "core" , "classical_theory" , "classicalTheory.exe" ) ) if not os . path . exists ( tcpath ) : print ( "Cant find classical theory program!\n %s" % tcpath , file = sys . stderr ) exit ( ) # One configuration file per source with different output path doc = xmlWriter . parse ( xmlPathTc ) simunode = doc . getElementsByTagName ( 'simulation' ) [ 0 ] srclstnode = doc . getElementsByTagName ( 'sources' ) [ 0 ] sources = srclstnode . getElementsByTagName ( 'source' ) sub_tc = [ ] rootxml = xmlPathTc [ 0 : xmlPathTc . rfind ( os . sep ) + 1 ] for source in sources : srclstnode . removeChild ( source ) for source in sources : srclstnode . appendChild ( source ) idsource = source . getAttribute ( 'id' ) s_xmlfile = os . path . join ( rootxml , "config_s%s.xml" % idsource ) s_folder = 'direct_s%s' % idsource if not os . path . exists ( os . path . join ( rootxml , s_folder ) ) : os . mkdir ( os . path . join ( rootxml , s_folder ) ) simunode . setAttribute ( 'output_folder' , s_folder ) simunode . setAttribute ( 'do_angular_weighting' , '0' ) #Pas de pondération selon l'angle d'incidence de la source writer = codecs . open ( s_xmlfile , 'w' , encoding = "utf-8" ) doc . writexml ( writer , encoding = "utf-8" ) writer . close ( ) sub_tc . append ( ( int ( idsource ) , s_xmlfile , s_folder ) ) srclstnode . removeChild ( source ) # For each source we launch classical theory computation resultsModificationLayers = { } for tc_process in sub_tc : print ( u"Execute classical theory program :\n%s %s" % ( tcpath , tc_process [ 1 ] ) ) sp . check_call ( [ tcpath , tc_process [ 1 ] ] ) # os.remove(tc_process[1]) resultsModificationLayer = SoundLevelLayer ( ) resultsModificationLayer . LoadData ( tc_process [ 2 ] , coreconf , ls ) # os.removedirs(coreconf.paths["workingdirectory"] + tc_process[2] + os.sep) resultsModificationLayers [ tc_process [ 0 ] ] = resultsModificationLayer return resultsModificationLayers