From 6cc2ccf3534ed4560e41a5ad3b53edb532abd184 Mon Sep 17 00:00:00 2001 From: salman Date: Wed, 25 Jan 2023 10:37:14 +0100 Subject: [PATCH] Fix bug in plotting multiple rge files. --- TrimSPlib.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/TrimSPlib.js b/TrimSPlib.js index f9e2800..098ff96 100644 --- a/TrimSPlib.js +++ b/TrimSPlib.js @@ -1222,7 +1222,6 @@ function CreateInpFile() { // Number of elements let LElem = "L"+i+"Elem"; All[LElem] = Object.keys(LElComp).length; - console.log(LElem,All[LElem]); // Densities of layers let Lrho="layer"+i+"rho"; @@ -1405,22 +1404,22 @@ function startSequence() { // Single run: Start let eingabe1=CreateInpFile(); if (eingabe1=="ERROR") {return(0);} - let FILENAME=All["workPath"]+"/"+All["fileNamePrefix"]+"_"+ScanName+SValue; - writeAsciiFile(FILENAME+".inp",eingabe1); + let FILENAME=All["fileNamePrefix"]+"_"+ScanName+SValue; + writeAsciiFile(All["workPath"]+"/"+FILENAME+".inp",eingabe1); if (!webOrApp) { // Prepare command and execute cmd = "cd " + All["workPath"]; - cmd += ";cp " + FILENAME + ".inp eingabe1.inp"; - cmd += ";" + trimBin; - cmd += "; mv -f ausgabe1.rge " + FILENAME + ".rge"; - cmd += "; mv -f ausgabe1.out " + FILENAME + ".out"; - cmd += "; mv -f ausgabe1.err " + FILENAME + ".err"; + //cmd += ";cp " + FILENAME + ".inp eingabe1.inp"; + cmd += ";" + trimBin + ' ' + FILENAME; + //cmd += "; mv -f ausgabe1.rge " + FILENAME + ".rge"; + //cmd += "; mv -f ausgabe1.out " + FILENAME + ".out"; + //cmd += "; mv -f ausgabe1.err " + FILENAME + ".err"; execute(cmd); } // Single run: End // Read stopping profiels - let [cols,data]= readDatFile(FILENAME+".rge"); + let [cols,data]= readDatFile(All["workPath"]+"/"+FILENAME+".rge"); // convert depth to nm and normalize stopping profile let depth=data[0]; let nmuons=data[1]; @@ -1457,7 +1456,8 @@ function startSequence() { // Remove redundant files and change the name fort.33 if (!webOrApp) { - cmd="cd " + All["workPath"] + ";rm -f eingabe1.inp; mv -f fort.33 " + seq_file; + // cmd="cd " + All["workPath"] + ";rm -f eingabe1.inp; mv -f fort.33 " + seq_file; + cmd="cd " + All["workPath"] + "; mv -f fort.33 " + seq_file; execute(cmd); } Progress=100; @@ -1504,16 +1504,16 @@ function plotProfiles(filenames) { var plotDiv=win.document.getElementById("newPlot"); // Extract energies from run files if available - var files= new Object(); + //var files= new Object(); var Es = []; for (let i=0;i