Ejemplo n.º 1
0
 def setUpClass(cls):
     os.chdir("madelung")
     out = file("pi.log", "w")
     process = subprocess.Popen("../../../bin/pi-qmc", 
         stdout=subprocess.PIPE, stdin=subprocess.PIPE, 
         stderr=subprocess.PIPE)
     stdout, stderr = process.communicate()
     process.wait()
     cls.h5file = pitools.openFile()
Ejemplo n.º 2
0
 def setUpClass(cls):
     os.chdir("sho")
     out = file("pi.log", "w")
     process = subprocess.Popen("../../../bin/pi-qmc",
                                stdout=subprocess.PIPE,
                                stdin=subprocess.PIPE,
                                stderr=subprocess.PIPE)
     stdout, stderr = process.communicate()
     process.wait()
     cls.h5file = pitools.openFile()
Ejemplo n.º 3
0
def dataFromH5File(project, filename):
  data = SimulationModel(project)
  data.filename = filename
  try:
    data.file = pitools.openFile(data.filename)
    data.temperature = data.file.getTemperature(Unit.K) 
    data.nslice = data.file.getNSlice() 
    data.superCell = data.file.getSuperCell(Unit.nm) 
    data.estimators = data.file.getEstimatorList()
  except IOError:
    return None
  return data
Ejemplo n.º 4
0
 def reloadData(self):
   self.file.close()
   # Retreive remote data if needed.
   if hasattr(self,"hostMachine") and hasattr(self,"hostDirectory"):
     self.statusMessage.emit("downloaded new data from %s:%s"
       % (self.hostMachine, self.hostDirectory),5000)
     os.system('scp "%s:%s/pimc.h5" %s'
                % (self.hostMachine, self.hostDirectory,
                   self.project.nameList[self.index]))
   try:
     self.file = pitools.openFile(self.filename)
     self.temperature = self.file.getTemperature(Unit.K) 
     self.nslice = self.file.getNSlice() 
     self.superCell = self.file.getSuperCell(Unit.nm) 
     self.estimators = self.file.getEstimatorList()
   except IOError:
     return None
   self.dataChanged.emit()