|
@@ -125,7 +125,9 @@ class CorrelationCorrection(QtCore.QObject):
|
|
|
def __init__(self, path, scanX, scanY, delays, workingChannels=[0,1,2,3,4,5,6,7]):
|
|
|
super(CorrelationCorrection, self).__init__()
|
|
|
self.host = "ibpt-kapture1"
|
|
|
- self.remotepath = "/home/kapture/Kapture-GPU-Analyse/PeakReconstruction/"
|
|
|
+ self.remotePath = "/home/kapture/GPU-Analyse/PeakReconstruction/"
|
|
|
+ self.remoteUser = 'kapture'
|
|
|
+ self.remotePW = 'kapture123'
|
|
|
|
|
|
#self.dirToReconstruction = '../PeakReconstruction/'
|
|
|
|
|
@@ -160,7 +162,7 @@ class CorrelationCorrection(QtCore.QObject):
|
|
|
self.process.finished.connect(self._processFinished)
|
|
|
self.process.error.connect(self._processError)
|
|
|
|
|
|
- self.process.setWorkingDirectory(self.remotepath)
|
|
|
+ self.process.setWorkingDirectory(self.remotePath)
|
|
|
self.process.setProcessChannelMode(QtCore.QProcess.MergedChannels)
|
|
|
|
|
|
|
|
@@ -320,14 +322,14 @@ class CorrelationCorrection(QtCore.QObject):
|
|
|
|
|
|
else:
|
|
|
|
|
|
- remotefile = self.remotepath + "simulationData/"+ self.file
|
|
|
- localpath = os.path.abspath(self.path)
|
|
|
- localfile = os.path.abspath(os.path.join(self.path, self.file))
|
|
|
+ remoteFile = self.remotePath + "simulationData/"+ self.file
|
|
|
+ localPath = os.path.abspath(self.path)
|
|
|
+ localFile = os.path.abspath(os.path.join(self.path, self.file))
|
|
|
|
|
|
import paramiko
|
|
|
ssh = paramiko.SSHClient()
|
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
|
- ssh.connect(self.host, username='kapture', password='kapture123')
|
|
|
+ ssh.connect(self.host, username=self.remoteUser, password=self.remotePW)
|
|
|
|
|
|
print('put')
|
|
|
|
|
@@ -337,12 +339,12 @@ class CorrelationCorrection(QtCore.QObject):
|
|
|
|
|
|
|
|
|
scp = ssh.open_sftp()
|
|
|
- scp.put(localfile, remotefile)#, progress)
|
|
|
- scp.put(os.path.join(localpath, 'Measurement_board_6028.log'), self.remotepath+'simulationData/Measurement_board_6028.log', progress)
|
|
|
+ scp.put(localFile, remoteFile)#, progress)
|
|
|
+ scp.put(os.path.join(localPath, 'Measurement_board_6028.log'), self.remotePath+'simulationData/Measurement_board_6028.log', progress)
|
|
|
|
|
|
print('calc')
|
|
|
|
|
|
- stdin, stdout, stderr = ssh.exec_command("cd {} ; python3 -u {} -f {} -c d -v -o '' ".format(self.remotepath, "PeakReconstruction.py", remotefile))
|
|
|
+ stdin, stdout, stderr = ssh.exec_command("cd {} ; python3 -u {} -f {} -c d -v -o '' ".format(self.remotePath, "PeakReconstruction.py", remoteFile))
|
|
|
#stdout.channel.recv_exit_status()
|
|
|
while not stdout.channel.exit_status_ready():
|
|
|
o = stdout.readline()
|
|
@@ -358,7 +360,7 @@ class CorrelationCorrection(QtCore.QObject):
|
|
|
print('e', line[:-1])
|
|
|
|
|
|
print('get')
|
|
|
- scp.get(remotefile[:-4]+'_fit.hdf', localfile[:-4]+'_fit.hdf', progress)
|
|
|
+ scp.get(remoteFile[:-4]+'_fit.hdf', localFile[:-4]+'_fit.hdf', progress)
|
|
|
scp.close()
|
|
|
ssh.close()
|
|
|
|