diff --git a/DesCar/Code/Dektak.py b/DesCar/Code/Dektak.py
new file mode 100644
index 0000000000000000000000000000000000000000..43060791574c69632c2ea962b540f9550caff904
--- /dev/null
+++ b/DesCar/Code/Dektak.py
@@ -0,0 +1,51 @@
+from filePath import * 
+from interpolate import *
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+# from plotRaman import  *
+import os
+import numpy as np
+from material import *
+
+from scipy.optimize import curve_fit
+import matplotlib.pyplot as plt
+import re
+import pyperclip3
+
+
+
+
+
+def dektakClean():
+    newpath=os.getcwd()+"\cleaned_dektak\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    print("\nStarting file parsing")
+    files=glob.glob("*.txt")
+    f_list=fileExtensionRemover(glob.glob("*.txt"))
+    for i,fp in enumerate(files):
+        flag=0
+        with open(fp) as file:
+            x=[]
+            y=[]
+            for line in file:
+                try:
+                    if(isinstance(int(line[0]),int)):
+                        values=line.split(",")
+                        x.append(float(values[0]))
+                        y.append(float(values[1]))
+                except:
+                    flag=1
+            if(flag):
+                print("Succesful text rejection on: ",files[i])
+                with open (newpath+f_list[i]+".txt",'w') as new_file:
+                    for k in range(len(x)):
+                        new_file.write(str(x[k])+" "+str(y[k])+"\n") 
+    print('\n---------------------------------------------------------------\n')        
+    pyperclip3.copy("path "+newpath)
+    print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+            
+                
+                
diff --git a/DesCar/Code/DesCar.py b/DesCar/Code/DesCar.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f5e62427b1f752d39b68ae1da16089d5089dbf4
--- /dev/null
+++ b/DesCar/Code/DesCar.py
@@ -0,0 +1,399 @@
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+from filePath import *
+from siliconPeakRemover import *
+from StressEstimation import *
+#from stringSeparation import *
+from Intro import*
+from material import *
+from plotPolytek import *
+from interpolate import *
+from plotGeneral import *
+from comsol import *
+from basicDataModifier import *
+from Dektak import*
+from extractionIV import *
+
+
+
+class Plot(cmd.Cmd):
+
+    prompt='DesCar>'
+    
+    
+    
+    def __init__(self):
+        super().__init__()
+        self.material_path=os.getcwd()+"\material_data.txt"
+        self.descar_path=os.getcwd()
+        
+        plot_config=np.genfromtxt(os.getcwd()+"\\plot_config.txt",delimiter=',',dtype='str')
+        print(plot_config)
+        
+        try:
+            while(1):
+                print("\nWelcome to DesCar ! \n----------------------------------------------\nSaved configuration: ")
+                with open(self.descar_path+"\\boot.txt","r") as file:
+                        fpi,spi=file.readlines()[0].split(',')
+                print("-File path: "+fpi)
+                print("-Save path: "+spi)
+                print("-Plot style: "+plot_config[0])
+                print("-Plot title: "+plot_config[1])
+                print("-Plot x: "+plot_config[2])
+                print("-Plot y: "+plot_config[3])
+                start_path=input("\n(Enter) to keep the configuration or (1) to edit: ")
+                if(start_path==""):
+                    with open(self.descar_path+"\\boot.txt","r") as file:
+                        fpi,spi=file.readlines()[0].split(',')
+                        self.file_dir=fpi
+                        self.save_dir=spi
+                        plot_style(plot_config[0],self.descar_path)
+                        plot_title(plot_config[1],self.descar_path)
+                        plot_x(plot_config[2],self.descar_path)
+                        plot_y(plot_config[3],self.descar_path)
+                        break
+                if(start_path=="1"):
+                    self.file_dir=input('File path: ')
+                    self.save_dir=input('Save path: ')
+                    print("\nClearing plot settings. Please set in session.")
+                    plot_clear(self.descar_path)
+                    break
+                else:
+                    print("Command not recognised. Resuming ...")
+
+        
+            if not os.path.exists(self.file_dir):
+                raise Exception("file dir does not exists")
+            if not os.path.exists(self.save_dir):
+                raise Exception("save dir does not exists")
+        
+        except:
+            print("\nBoot file corrupted or path does not exist. Please enter path now: \n")
+            self.file_dir=input('\nFile path: ')
+            self.save_dir=input('\nSave path: ')
+
+        
+        complete_file_path(self.file_dir,self.descar_path)
+        complete_save_path(self.save_dir,self.save_dir,self.descar_path)
+        
+        intro()
+    
+    
+    
+
+    def do_getDir(self,nul):
+        'Returns the current source directory. Should not be used. Please use filePath instead'
+        self.nul=nul
+        print("The current working directory is: " , os.getcwd())
+    # def do_raman(self,plotT):
+        # 'Allows you to plot raman files.\n-Type raman to launch the wizard\n-Type raman rifle to automatically plot every file in the folder individually (one file per plot)\n-Type raman select to plot a selection of file\n-Type raman all to plot all files on a single plot '
+        # self.plotT=plotT
+        # plot_raman(plotT,self.save_dir)
+        
+        
+    def do_filePath(self,fp):
+        'filePath without argument: gives you the current file path and the ability to upgrade it. filePath + argument changes the file path to the argument after automatically correcting it. No need to worry for the \. Syntax: filePath or filePath something. returns the filePath'
+        complete_file_path(fp,self.descar_path)
+        
+        
+    def do_savePath(self,sp):
+        'savePath without argument: gives you the current save path and the ability to upgrade it. savePath + argument changes the save path to the argument after automatically correcting it. No need to worry for the \. Syntax: savePath or savePath something. returns the savePath'
+        self.save_dir=complete_save_path(sp,self.save_dir,self.descar_path)
+    
+    def do_path(self,path):
+        'Changes both the save and file path. Type path to enter the utility or path + the desired file path to change them directly'
+        self.save_dir=complete_save_path(path,self.save_dir,self.descar_path)
+        complete_file_path(path,self.descar_path)
+        
+        
+    def do_siliconRemove(self,nul):
+        'This routine finds the source .txt files of your raman experiment in the source folder you gave, opens them, removes the silicon peak and saves the modified txts in a new folder\n-The routine create the new folder for you\n-The routine renames the new .txt for you\n-The routine does not modify the original .txt files\n-The removal of the silicon peak is done by substracting a Lorentz fit of the peak (hence no loss of information).'
+        self.nul=nul
+        peak_remover()
+    def do_thermalStress(self,nul):
+        'This routine allows you to compute the theoretical thermal stress between two materials in a stack originating from the CTE mismatch\n-The routine gives a first order estimation of the thermal stress based on the given mechanical properties\n-This routine is a simple implementation of the Stoney\'s equation\n-The result of this routine does not replace experimental data\n-The routine saves the result in a txt'
+        self.nul=nul
+        thermalStessWiz(self.save_dir)
+    def do_stressCompensation(self,nul):
+        'This routine allows you to compute an estimation of stack parameter to build in order to have a stress free/compensated membrane.\n-This routine only gives a first order estimation and does not replace a proper simulation\n-This routine is a simple implementation of the Stoney\'s equation'
+        self.nul=nul
+        stressCompensation(self.save_dir)
+        
+    def do_stoney(self,nul):
+        "Computes the thermal stress in a thin film based on Dektak files and the derivative version of the stoney's equation. Material mode supported by this routine => uss material mode to set the substrate properties"
+        self.nul=nul
+        derivative_stoney(self.save_dir)
+    
+
+    def do_material(self,material):
+        '\n Help on material:\nMaterial helping routine. Running this command followed by the name of a supported material puts DesCar in the material analysis mode. \n\n-Type material followed by run to enter the wizare\n-Type material followed by the name of the material to enter this material analysis mode\n-Type material exit to exit the analysis mode.\n-Currently supported material: VO2 (type VO2 or vo2), Si \n-The routine allows to overlay the expected material peaks on the raman plots (can be auto saved or not)\n-Upcoming feature: auto detection of the given material in raman plots\n-Type material exit to exit material mode \n'
+        materialWiz(material,self.material_path)
+    def do_parsePolytec(self,nul):
+        '\nAutomatic detection and parsing of the line and map type file from the polytec. Polytec .txt files are cleaned and rewritten to new directory under the generic format of x,y,z column with a dot as coma and a blank as separator\n'
+        self.nul=nul
+        polyParsAndCorrect()
+        #plot_polytek(plotT,self.save_dir)
+    def do_approximate(self,nul):
+        '\nApproximation of any order or sqrt of a given set of point.'
+        self.nul=nul
+        approximate()
+    def do_plot(self,plotT):
+        '\nAllows you to plot .txt files provided in a clean xyz coumn fashion.\n-Type plot to launch the wizard\n-Type plot rifle to automatically plot every file in the folder individually (one file per plot)\n-Type plot select to plot a selection of file\n-Type plot all to plot all files on a single plot\n-Different style possible: individual point, connected data points, fancy connected data point,... \n'
+        self.plotT=plotT
+        plot(plotT,self.save_dir)
+        
+    def do_level(self,nul):
+        "\nAllows you to level a measurement provided under the form of a clean x,y file . You'll need to provide a range at the beginning and the end of the data.\n"
+        self.nul=nul
+        level()
+        
+    def do_levelL(self,left):
+        "Allows to set the left leveling range for all subsequent leveling routine run. The routine will not ask for the left range if this is set"
+        self.left=left
+        setLeft(left)
+    
+    def do_levelR(self,right):
+        "Allows to set the right leveling range for all subsequent leveling routine run. The routine will not ask for the right range if this is set"
+        self.right=right
+        setRight(right)
+     
+    def do_levelClear(self,nul):
+        "Resets both leveling ranges."
+        self.nul=nul
+        levelClear()
+        
+    
+    def do_deflection(self,nul):
+        "\nFor membrane deflection in polytec. Data must be leveled for best result. Takes a clean x,y file as input. The routine generates a clean x,y txt file with x=the pressure and y=deflection. File name must contain the pressure information). The routine will sort the files automatically (increassing pressure)\n"
+        self.nul=nul
+        deflection()
+        
+        
+        
+    def do_resistanceP(self,nul):
+        "\nGets the resistance value from file constaining the x data in their name => typically one IV curve per pressure point\n"
+        self.nul=nul
+        rPressure()
+        
+    def do_ramanPressure(self,nul):
+        "\nFor membrane deflection under the Raman. The routine takes a clean x,y txt file and provide a txt file of the pressure (x) and the max peak position.!!! For silicon only !!! Pressure data must be contained in the file name\n"
+        self.nul=nul
+        ramanSiliconPressure()
+        
+    def do_ramanMap(self,nul):
+        "\nTakes RAW raman map measurement and outputs a clean x,y txt file. Takes the n points of the maping and averages them\n"
+        self.nul=nul
+        ramanMapCleanAndAvg()
+        
+    def do_comsolClean(self,nul):
+        '\nTakes RAW comsol column files and outputs a clean x,y txt file\n'
+        self.nul=nul
+        comsolClean()
+        
+    def do_avg(self,nul):
+        '\nCompute the average of all the provided files. Takes clean x y txt files\n'
+        self.nul=nul
+        avg()
+    
+    def do_colMult(self,coef):
+        "\nAllows to multiply a column from a clean x y .txt file by any float constant. Creates a modified copy of the inittial file\n"
+        self.coef=coef
+        colMult(coef)
+        
+    def do_colAdd(self,shift):
+        "\nAllows to add a cst to every item in a column from a clean x y .txt file. Cst can be any float cst. Creates a modified copy of the initial file\n"
+        self.shift=shift
+        colAdd(shift)
+        
+    def do_gfc(self,nul):
+        "Generic File Cleaning routine to clean input txt file (support coma and space separation) and outputs clean space separated xyz txt"
+        self.nul=nul
+        generic_data_cleaner()
+    
+    def do_gfcColName(self,colName):
+        "Sets the column name for all gfc run"
+        self.colName=colName
+        col_name(colName)
+    
+    def do_gfcExport(self,colExport):
+        "Sets the combination of column to export for all gfc run"
+        self.colExport=colExport
+        col_export(colExport)
+    
+    def do_gfcSkip(self,skip):
+        "Sets the number of lines to skip in file for all gfc run"
+        self.skip=skip
+        skip_row(skip)
+        
+    def do_gfcClear(self,nul):
+        "Clears global gfc settings"
+        self.nul=nul
+        gfClear()
+        
+        
+    def do_setExtOld(self,old):
+        "Set an extension to be replaced"
+        self.old=old
+        old_ext(old)
+        
+    def do_setExtNew(self,new):
+        "Set the replacement extension"
+        self.new=new
+        new_ext(new)
+        
+    def do_clearExt(self,nul):
+        "Clears extension settings"
+        self.nul=nul
+        extClear()
+
+
+    
+    def do_dataCycle(self,nul):
+        "\nAlligns successive up and down cycles. Will take the last value of the first  up and shift the first  down to allign with it. Then takes the first value of  down1 and alligns the first value of up2 with it. Works on clean xy txt file. Leveling the polytec profiles using the level tool is recommended. Files should be named up1,down1,up2,down2... Will output shifted version of the original files.\n"
+        self.nul=nul
+        dCycle()
+        
+    def do_plotTitle(self,title):
+        "\nSets global title for plotting routine. Plot routine will not ask for a title if globaly set using this command. Set by typing plotTitle or plotTitle + your title. Reset by using clearPlot\n"
+        self.title=title
+        plot_title(title,self.descar_path)
+        
+    def do_plotX(self,x):
+        "\nSets global x axis text for plotting routine. Plot routine will not ask for a x axis text if globaly set using this command. Set by typing plotX or plotX + your x text. Reset by using clearPlot\n"
+        self.x=x
+        plot_x(x,self.descar_path)
+        
+    def do_plotY(self,y):
+        "\nSets global y axis text for plotting routine. Plot routine will not ask for a y axis text if globaly set using this command. Set by typing plotY or plotY + your plotY text. Reset by using clearPlot\n"
+        self.y=y
+        plot_y(y,self.descar_path)
+        
+    def do_plotStyle(self,style):
+        "\nSets global plot style for plotting routine. Plot routine will not ask for a plot style if globaly set using this command. Set by typing plotStyle or plotStyle + your style. Reset by using clearPlot\n"
+        self.style=style
+        plot_style(style,self.descar_path)
+        
+    
+
+    
+        
+    def do_clearPlot(self,nul):
+        "\nResets global plot parameters\n"
+        self.nul=nul
+        plot_clear(self.descar_path)
+        
+        
+    def do_dektakClean(self,nul):
+        "\nTake raw dektak measurement and outputs clean x,y txt. Supports .txt only. Use the extension command to convert the dektak csv to txt prior to using the command\n"
+        self.nul=nul
+        dektakClean()
+        
+    def do_extension(self,nul):
+        "\nAllow the user to change the extension of all files in a directory. For instance replacing all .csv by a .txt\n"
+        self.nul=nul
+        extension()
+        
+        
+    def do_trimFN(self,trim):
+        "\nRemoves a given sequence of characters from the fine name\n"
+        self.trim=trim
+        trimFN(trim)
+        
+        
+    def do_normalise(self,nul):
+        "\nNormalises all file in folder by the curve max\n"
+        self.nul=nul
+        normalise()
+        
+        
+        
+        
+        
+        
+        
+            
+    # DesCar automation routines
+    
+    
+    def do_setExtension(self,nul):
+        "Sets the extension replacement old and new"
+        self.nul=nul
+        extClear()
+        old_ext("")
+        new_ext("")
+        print("Extension replacement settings set succesfully !")
+        
+    
+    def do_setLevel(self,nul):
+        "Sets both left and right leveling range"
+        self.nul=nul
+        levelClear()
+        setLeft("")
+        setRight("")
+        print("General level baseline settings set succesfully !")
+    
+    
+    
+    def do_setGFC(self,nul):
+        "Sets all the global gfc parameters"
+        self.nul=nul
+        gfClear()
+        skip_row("")
+        col_name("")
+        col_export("")
+        print("General file clean parameters set succesfully !")
+        
+    
+    def do_setPlot(self,nul):
+        "\n-Allows the user to set global plot parameter. Running this command will ask the user for a general title, x axis, y axis and plot style to be set. \n-Parameters can be set independantly by running plotStyle, plotX, plotY or plotTitle. \n-Set parameters will be used by all plot rifle. The plot routine will not ask for x,y,title or style if globaly set.\n-Reset all plot style by using plotClear\n"
+        self.nul=nul
+        plot_clear(self.descar_path)
+        plot_style("",self.descar_path)
+        plot_title("",self.descar_path)
+        plot_x("",self.descar_path)
+        plot_y("",self.descar_path)
+        
+        
+    
+    
+        
+        
+    def do_ramanStrain(self,nul):
+        "\nTakes raw raman map files and runs a complete procedure to output raman as function of pressure files\n"
+        self.nul=nul
+        ramanMapCleanAndAvg()
+        self.save_dir=complete_save_path(os.getcwd()+"\\corrected_raman_map",self.save_dir,self.descar_path)
+        complete_file_path(os.getcwd()+"\\corrected_raman_map",self.descar_path)
+        ramanSiliconPressure()
+        self.save_dir=complete_save_path(os.getcwd()+"\\raman_peak_shift",self.save_dir,self.descar_path)
+        complete_file_path(os.getcwd()+"\\raman_peak_shift",self.descar_path)
+        print("\nRoutine completed successfully ! Path changed to result folder\n")
+        
+  
+    def do_polytecDeflection(self,nul):
+        "\nRuns a full polytec analysis routine to obtaine a deflection plot. \n-Takes raw polytec line or map data with the applied pressure given in the name of each txt file\n-Parse and cleans the files\n-Runs a leveling routine\n-Produces a deflection plot \n"
+        self.nul=nul
+        polyParsAndCorrect()
+        self.save_dir=complete_save_path(os.getcwd()+"\\clean_polytec\line",self.save_dir,self.descar_path)
+        complete_file_path(os.getcwd()+"\\clean_polytec\line",self.descar_path)
+        print("\nPlotting raw line files\n")
+        plot_rifle(self.save_dir)
+        level()
+        self.save_dir=complete_save_path(os.getcwd()+"\\leveled_data",self.save_dir,self.descar_path)
+        complete_file_path(os.getcwd()+"\\leveled_data",self.descar_path)
+        print("\nPlotting leveled line file\n")
+        plot_rifle(self.save_dir)
+        deflection()
+        self.save_dir=complete_save_path(os.getcwd()+"\\deflection_data",self.save_dir,self.descar_path)
+        complete_file_path(os.getcwd()+"\\deflection_data",self.descar_path)
+        print("\nRoutine completed successfully ! Path changed to result folder\n")
+
+
+
+Plot().cmdloop()
+
+
diff --git a/DesCar/Code/Intro.py b/DesCar/Code/Intro.py
new file mode 100644
index 0000000000000000000000000000000000000000..8ff4e72bd8c4f42d79f04cf6b89d99fd2252df55
--- /dev/null
+++ b/DesCar/Code/Intro.py
@@ -0,0 +1,38 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+
+
+
+
+def intro():
+    ve="2.12.2"
+    date="09/08/24"
+    print("\n-------------------------------------------")
+    print("\nWelcome to DesCar version ",ve," ! (Uploaded: ",date,")")
+    print("\nCurrently supported features:\n")
+    print("\n-Generic plot routine: plot all, rifle or select with different graphic style (line, point, fancy, ...). Adding new designs should be intuitive. Possibility to set all plot generic parameter once and not at each run of a plot command")
+    print("-Raman: automatic silicon peak removal, automatic raman peak display (NO auto peak detection in ",ve," but data from material propreties). Detection and lrtz fit of silicon peaks")
+    print("-Stress: Theoretical thermal stress computation, theoretical stress compensation routine, Experimental thermal stress estimation based on the differential stoney equation.")
+    print("-Automatic saving of results, easy path managment (changing save/file path one by one or at the same time),saving of new path to the clipboard, autoload at boot of last path used in previous descar session,Extension modifier (with global parameter modifier),File name modification")
+    print("-Material mode: Puts DesCar in a configuration related to the selected material. Material data such as the Young modulus, the Poisson ratio, the Raman spectrum are available to the entire program in a .txt file. Allows for the easy addition of new materials in DesCar.")
+    print("-Polytec: raw data cleaning to a neat column  xyz .txt type file, automatic detection of maximal deflection, automatic generation of delfection fct of P in a .txt")
+    print("-Generic mathematical tool: normalisation routine, approximation to any desired order on any given range of the input data,sqrt approximation, averaging of multiple clean xy files, data modifier (col mult or add), polynomial leveling of curves")
+    print("-Comsol: column type export data cleaning\n-Dektak file cleaning routine")
+    print("-DesCar automation: ramanStrain (from map raman measurement to strain fct pressure plot),polytecDeflection (from polytec measurement to deflection fct pressure plot),setPlot allowing to set all plot parameter in one command")
+    print("-Dektak file cleaning routine")
+    print("-Generic file cleaning routine. Should work with any txt input files to output clean xyz column file")
+    print("-Configuration log: DesCar remembers the last file and save path as well as plot configuration between sessions")
+    # print("\n-------------------------------------------")
+    # print("\nUpcoming work: The Polytec and Raman plot routines (all, rifle and select) are currently coded in the same exact way. The files are almost a copy paste of each other. The code should be rewritten so that rifle, all and select become the base routines and the machines (raman, polytec, ...) are taken as modifiers")
+    print("\n-------------------------------------------")
+    print("\nWork by Lahaye Loïc")
+    print("\n-------------------------------------------")
+    print("\nContributions: Nicolas Roisin for the extraction of silicon raman peaks based on Lorenztian fit")
+    print("\n-------------------------------------------")
+    print("\nType help or ? to list commands. Type help followed by the command to get help on the command\n")
\ No newline at end of file
diff --git a/DesCar/Code/StressEstimation.py b/DesCar/Code/StressEstimation.py
new file mode 100644
index 0000000000000000000000000000000000000000..8fb6b5608f3bb526ef9e44d28c4ff1d6d889e805
--- /dev/null
+++ b/DesCar/Code/StressEstimation.py
@@ -0,0 +1,287 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+import pyperclip3
+from material import *
+
+
+
+
+
+
+
+def thermalStress(Ef,Vf,alpha_f,alpha_s,high,low):
+    return ((Ef*(10**9))/(1-Vf))*(alpha_f-alpha_s)*(10**-6)*(high-low)
+    
+def diffStoney(Es,Vs,ts,tf,dp):
+    return ((Es*(10**9))/(6*(1-Vs)))*(((ts*(10**-9))**2)/(tf*(10**-9)))*dp
+    
+    
+def thermalStessWiz(save_dir):
+    print("\nThis wizard allows you to compute the theoretical thermal stress induced by the thermal expansion coefficient mismatch. \nNote that the actual value is VERY process dependant. This estimation does not replace proper experimental data !. \nIf you use a polymer as thin film please mind the relaxation.")
+    print("\n--------------------------------------------------")
+    print("Here are some common values for silicon:")
+    print("Young modulus of silicon: Isotropic and linearly elastic (165 GPa), <100> (180-200 GPa). \n Consider that it is function of the crystal, doping, ... please chose the value that suits your specific needs. \n In general:Young's modulus = [62,202]GPa (https://www.memsnet.org/material/siliconsibulk/)")
+    print("Thermal expansion of silicon: 2.6 ppm (Franssila)")
+    print("Poisson ratio of silicon: 0.27 [-] (Franssila). Varies between 0.22 and 0.278. Check for your specific case!")
+    print("\n--------------------------------------------------")
+    a=input("Do you want to use silicon as your substrate ? (yes/no):")
+    if(a=='yes' or a=='y'):
+        print("The thermal expansion coef for the substrate will be of 2.6 ppm")
+        alpha_f=float(input("What is the thermal expansion coefficient of your thin film [ppm]: "))
+        Ef=float(input("What is the young's modulus of your thin film [GPa]: "))
+        Vf=float(input("What is the poisson ratio of your material [-]: "))
+        high=float(input("What is high temperature [°C]: "))
+        low=float(input("What is room temperature [°C]: "))
+        name=input("What is the name of your thin film: ")
+        sigma=thermalStress(Ef,Vf,alpha_f,2.6,high,low)*(10**-6)
+        print("A thin film of ",name," on silicon will generate a thermal stress of ",round(sigma,3)," MPa")
+        b=input("Do you want to save this result as .txt ? (yes/no): ")
+        if(b=="yes" or b=="y"):
+            c=input("Do you want to add a comment ? (enter if not): ")
+            temp=os.getcwd()
+            os.chdir(save_dir)
+            with open (os.getcwd()+"\\"+name+" on silicon.txt",'w') as file:
+                file.write("A thin film of "+name+" on a silicon substrate will generate a thermal stress of "+str(round(sigma,3))+" MPa. The parameters used are: \nThermal expansion of silicon: 2.6 [ppm]\nThermal expansion of "+name+": "+str(alpha_f)+" [ppm]\nYoung's Modulus of "+name+": "+str(Ef)+" [GPa]\nPoisson ratio of "+name+": "+str(Vf)+"  [-]\nHigh and low temp of "+name+": "+str(high)+" and "+str(low)+" [°C]"+"\nComment: "+c)
+            os.chdir(temp)    
+    else:
+        if(a=="no" or a=="n"):
+            name_s=input("What is the name of your substrate: ")
+            alpha_s= float(input("What is the thermal expansion coefficient of "+name_s+" [ppm]: "))
+            name=input("What is the name of your thin film: ")
+            alpha_f=float(input("What is the thermal expansion coefficient of your thin film [ppm]: "))
+            Ef=float(input("What is the young's modulus of your thin film [GPa]: "))
+            Vf=float(input("What is the poisson ratio of your material [-]: "))
+            high=float(input("What is high temperature [°C]: "))
+            low=float(input("What is room temperature [°C]: "))           
+            sigma=thermalStress(Ef,Vf,alpha_f,alpha_s,high,low)*(10**-6)
+            print("A thin film of ",name," on ",name_s," will generate a thermal stress of ",round(sigma,3)," MPa")
+            b=input("Do you want to save this result as .txt ? (yes/no): ")
+            if(b=="yes" or b=="y"):
+                c=input("Do you want to add a comment ? (enter if not): ")
+                temp=os.getcwd()
+                os.chdir(save_dir)
+                with open (os.getcwd()+"\\"+name+" on silicon.txt",'w') as file:
+                    file.write("A thin film of "+name+" on a ",name_s," substrate will generate a thermal stress of "+str(round(sigma,3))+" MPa. The parameters used are: \nThermal expansion of ",name_s," : ",alpha_s," [ppm]\nThermal expansion of "+name+": "+str(alpha_f)+" [ppm]\nYoung's Modulus of "+name+": "+str(Ef)+" [GPa]\nPoisson ratio of "+name+": "+str(Vf)+"  [-]\nHigh and low temp of "+name+": "+str(high)+" and "+str(low)+" [°C]"+"\nComment: "+c)
+                    os.chdir(temp)
+        else:
+            print("Command not recognised. Exiting...")
+    return sigma        
+           
+def stressCompensation(save_dir):
+    print("")
+    print("This wizard helps you to compensate the thermal stresses in a two layers stack. \nBE CAREFUL with the numbers given by this assistant ! This code relies on a first order estimation of the required thichnesses based on the Stoney Formula.\nThe provided estimation DO NOT replace the need to properly simulate the exact stack geometry.")
+    print("\n--------------------------------------------------")
+    name_1=input("The first layer in the stack is: ")
+    name_2=input("The second layer in the stack is: ")
+    param=input("Which quantity do you need to estimate: t_1,t_2,sigma_1,sigma_2 (type 1, 2, 3 or 4):")
+    if(param=="1"):
+        sigma_1=(input("Residual stresses of "+name_1+" in [MPa]. Press enter without entries if you do not know) [MPa]: "))
+        if(sigma_1==""):
+            sigma_1=thermalStessWiz()
+        sigma_1=float(sigma_1)
+        t2=float(input("What is the thickness of "+name_2+" [nm]: "))
+        sigma_2=(input("Residual stresses of "+name_2+" in [MPa]. Press enter without entries if you do not know) [MPa]: "))
+        if(sigma_2==""):
+            sigma_2=thermalStessWiz()
+        sigma_2=float(sigma_2)
+        t1=t2*(sigma_2/sigma_1)
+        print("To compensate ",t2," [nm] of a ",sigma_2," [MPa] layer of  ",name_2," you will need ",t1," [nm] of a",sigma_1," [MPa] layer of",name_1 )
+    elif(param=="2"):
+        sigma_1=(input("Residual stresses of "+name_1+" in [MPa]. (Press enter without entries if you do not know) [MPa]: "))
+        if(sigma_1==""):
+            sigma_1=thermalStessWiz()
+        sigma_1=float(sigma_1)
+        t1=float(input("What is the thickness of "+name_1+" [nm]: "))
+        sigma_2=(input("Residual stresses of "+name_2+" in [MPa]. (Press enter without entries if you do not know) [MPa]: "))
+        if(sigma_2==""):
+            sigma_2=thermalStessWiz()
+        sigma_2=float(sigma_2)
+        t2=t1*(sigma_1/sigma_2)
+        print("To compensate ",t1," [nm] of a ",sigma_1," [MPa] layer of  ",name_1," you will need ",t2," [nm] of a",sigma_2," [MPa] layer of",name_2 )
+    elif(param=="3"):
+        t1=float(input("What is the thickness of "+name_1+" [nm]: "))
+        t2=float(input("What is the thickness of "+name_2+" [nm]: "))
+        sigma_2=(input("Residual stresses of "+name_2+" in [MPa]. (Press enter without entries if you do not know) [MPa]: "))
+        if(sigma_2==""):
+            sigma_2=thermalStessWiz()
+        sigma_2=float(sigma_2)
+        sigma_1=sigma_2*(t2/t1)
+        print("To compensate ",t2," [nm] of a ",sigma_2," [MPa] layer of  ",name_2," you will need ",t1," [nm] of a",sigma_1," [MPa] layer of",name_1 )
+    elif(param=="4"):
+        t1=float(input("What is the thickness of "+name_1+" [nm]: "))
+        t2=float(input("What is the thickness of "+name_2+" [nm]: "))
+        sigma_1=(input("Residual stresses of "+name_2+" in [MPa]. (Press enter without entries if you do not know) [MPa]: "))
+        if(sigma_1==""):
+            sigma_1=thermalStessWiz()
+        sigma_1=float(sigma_1)
+        sigma_2=sigma_1*(t1/t2)
+        print("To compensate ",t1," [nm] of a ",sigma_1," [MPa] layer of  ",name_1," you will need ",t2," [nm] of a",sigma_2," [MPa] layer of",name_2 )
+    else:
+        print("Command not recognised. Exiting...")
+    a=input("Do you want to save this result as a .txt ? (yes/no): ")
+    c=input("Do you want to add a comment ? (enter if not): ")
+    if(a=="yes" or a=="y"):
+        temp=os.getcwd()
+        os.chdir(save_dir)
+        with open (os.getcwd()+"\\Compensation of "+name_2+" on "+name_1+".txt",'w') as file:
+            file.write("To compensate "+str(round(t1))+" [nm] of a "+str(round(sigma_1,3))+" [MPa] layer of  "+name_1+" you will need "+str(round(t2))+" [nm] of a "+str(round(sigma_2,3))+" [MPa] layer of "+name_2+"\nComment: "+c)
+        os.chdir(temp)
+    
+    
+    
+    
+ 
+ 
+ 
+def derivative_stoney(save_dir):
+    
+    newpath=os.getcwd()+"\\Stoney_report"+"\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    
+    if(global_material.get_material()!=None):
+        print("\nGlobal material mode set to: ",global_material.get_material(),"! Using it as reference substrate")
+        material=global_material.get_material()
+        young=global_material.get_young()
+        poisson=global_material.get_poisson()
+        print("Substrate set to: ",material)
+        print("Poisson ratio set to: ",poisson," [-]")
+        print("Young modulus set to: ",young," [GPa]\n")
+    else:
+        material=input("\nWhat material do you want to use as substrate: ")
+        young=input("Provide the young modulus of the material [GPa]: ")
+        poisson=input("Provide the poisson's ration of the material [-]: ")
+    
+
+    
+    
+    flag=0
+    thermal_stress=[]
+    temp=os.getcwd() 
+    try:
+        while(flag==0):
+            if(input("\nPlease put the dektak measurement in folders with the following name convention:\n-Position in the stack (0 for substrate)_Name of the last layer in the stack _ thickness in nm =>0_silicon_380000,1_sio2_514 for example\n-No float input fot the thicknesses\n\n=>Enter once done")==""):
+                flag=1
+                folders=glob.glob("*")
+                folders.remove("Stoney_report")
+                position=[]
+                layer_temp=[]
+                thick_temp=[]
+                for i in range(len(folders)):
+                    values=folders[i].split("_")     
+                    position.append(values[0])
+                    layer_temp.append(values[1])
+                    thick_temp.append(values[2])
+                
+                stack=np.argsort(position)
+                layer=[]
+                thick=[]
+                for i in range(len(stack)):
+                    layer.append(layer_temp[stack[i]])
+                    thick.append(thick_temp[stack[i]])
+                print("\nDetected stack:\n-Layer 0 (substrate): ",layer[0]," with a thickness of ",thick[0]," nm\n-Layer 1 (thin film): ",layer[1]," with a thickness of ",thick[1]," nm\n")
+            else:
+                print("Invalid command! Resuming ...")
+
+
+        layer0_path=temp+"\\"+str(stack[0])+"_"+str(layer[0])+"_"+str(thick[0])+"\\"
+        layer1_path=temp+"\\"+str(stack[1])+"_"+str(layer[1])+"_"+str(thick[1])+"\\"
+        os.chdir(layer0_path)
+        files0=glob.glob("*.txt")
+        nbre=len(files0)
+        os.chdir(layer1_path)
+        files1=glob.glob("*.txt")
+
+
+        
+        for i in range(nbre):
+            fig=plt.figure()
+            ax=fig.add_subplot()
+            x1=[]
+            y1=[]
+            x0=[]
+            y0=[]
+            x=[]
+            y=[]
+            os.chdir(layer1_path)
+            with open(files1[i]) as file:
+                for line in file:
+                    values=line.split()
+                    x1.append(float(values[0])*(10**-6))
+                    y1.append(float(values[1])*(10**-9))
+            os.chdir(layer0_path)
+            with open(files0[i]) as file:
+                for line in file:
+                    values=line.split()
+                    x0.append(float(values[0])*(10**-6))
+                    y0.append(float(values[1])*(10**-9))
+            for j in range(len(x0)):
+                x.append(x1[j])
+                y.append(y1[j]-y0[j])
+
+            # fig=plt.figure()
+            # ax=fig.add_subplot()
+            # ax.plot(x,y)
+            # ax.plot(x,y1)
+            # ax.plot(x,y0)
+            # plt.show()
+            
+            Coef_1=np.polyfit(x,y,2)
+            F1=np.poly1d(Coef_1)
+            F2=np.polyder(F1,2)
+            # print(thick[0])
+            # print(thick[1])
+            # print(F2[0])
+
+            
+        
+            # thermal_stress=round((-1)*((float(young)*(10**9)*(float(thick[0])*(10**(-9)))**2)/(6*(1-float(poisson))*(float(thick[1])*(10**(-9)))))*float(F2[0]),2) #les floats sont moches mais what you gonna do
+            # youngf=float(young)
+            # poissonf=float(poisson)
+            # thickf=float(thick[1])
+            # thicks=float(thick[0])
+            # dp=float(F2[0])
+            # thermal_stress=diffStoney(youngf,poissonf,thicks,thickf,dp)
+            thermal_stress.append(round(diffStoney(float(young),float(poisson),float(thick[0]),float(thick[1]),float(F2[0])),2))
+            
+            print("The thermal stresses in the top ",layer[1]," layer of ",files0[i]," are estimated to be around: ",str(thermal_stress[i]*10**-6)," MPa")
+
+            ax.plot(x,y)
+            ax.plot(x,F1(x))
+            titles=fileExtensionRemover(glob.glob("*.txt"))  
+            ax.set_title(titles[i])
+            tempi=os.getcwd()
+            os.chdir(newpath)
+            plt.savefig(titles[i]+".png",format = 'png')
+            plt.clf()
+            plt.close()
+            os.chdir(tempi)
+
+        try:
+            tempi=os.getcwd()
+            os.chdir(newpath)
+            with open (os.getcwd()+"\\Stoney_report.txt",'w') as file:
+                for i in range(nbre):
+                    file.write("-The thermal stresses in the top "+layer[1]+" layer of "+files0[i]+" are estimated to be around: "+str(thermal_stress[i]*10**-6)+" MPa\n")
+                file.write("\n\n\n=>Parameters of substrate:\n\n-Material: "+str(material)+"\n-Young: "+str(young)+"[GPa]\n-Poisson: "+str(poisson)+" [-]")
+            os.chdir(tempi)
+        except:
+            print("\n-------------------------------------------------------------\n")
+            print("\nError in data export loop. \n\n=>Exiting ...\n\n")
+        os.chdir(temp)
+        
+    except:
+        print("\n-------------------------------------------------------------\n")
+        print("Error in file path managment or in the main loop execution. Check the following:\n\n-The name convention of the dektak measurement folder as specified above\n-The extension .txt of measurement file. Not .csv. Use the extension command to convert your csv to txt\n-Did you clean the raw dektak file ? Use the dektakClean or gfc command to do so.\n\n=>Exiting ...\n")
+        os.chdir(temp)
+
+        
+        
+
+
diff --git a/DesCar/Code/basicDataModifier.py b/DesCar/Code/basicDataModifier.py
new file mode 100644
index 0000000000000000000000000000000000000000..2e2331b9f975341f95bc3add0707a04264f152b6
--- /dev/null
+++ b/DesCar/Code/basicDataModifier.py
@@ -0,0 +1,335 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+from scipy.optimize import curve_fit
+from scipy.interpolate import interp1d
+import pyperclip3
+
+
+
+
+
+def avg():
+    print("\nImportant remark: Might bug with polytec file\n")
+    
+    
+    
+    newpath=os.getcwd()+"\\avg_data"+"\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    files=glob.glob("*.txt")
+    a=len(files)
+    current_file=""
+    try:
+
+        x=np.zeros(file_length(files[1]))
+        y=np.zeros(file_length(files[1]))
+        print("Opening and averaging ",len(files)," files")
+        for i,fp in enumerate(files): #retourne l'index dans i et retourne le premiere element (T1.txt par exemple) dans fp
+            current_file=files[i]
+            if(((i+1)%a)==0):
+                # print("this is i ",i)
+                print(files[i])
+                with open(fp) as file:
+                    x_temp = []
+                    y_temp = []
+                    for line in file:
+                        values = line.split()
+                        x_temp.append(float(values[0]))
+                        y_temp.append(float(values[1]))
+                    sort=np.argsort(x_temp)
+                    x_temp1=[]
+                    y_temp1=[]
+                    for k in range(len(sort)):
+                        x_temp1.append(x_temp[sort[k]])
+                        y_temp1.append(y_temp[sort[k]])                        
+                    x=np.array(x_temp1)
+                    # print("this is Y before sum loop if",y)
+                    y=y+np.array(y_temp1)
+                    # print("this is y after sum: loop if",y)
+                # print("this is what will be plotted x",x)
+                y=y/a
+                # print("this is what will be plotted y/a",y)
+                # ax.plot(x,y/a)
+                
+                    
+              
+            else:
+                with open(fp) as file:
+                    print(files[i],"is used with")
+                    x1 = []
+                    y1 = []
+                    for line in file:
+                        values = line.split()
+                        x1.append(float(values[0]))
+                        y1.append(float(values[1]))
+                        
+                    sort1=np.argsort(x1)
+                    x2=[]
+                    y2=[]
+                    for k in range(len(sort1)):
+                        x2.append(x1[sort1[k]])
+                        y2.append(y1[sort1[k]])     
+                     
+                     
+                    # print("this is y before sum loop else",y)
+                    y=y+np.array(y2)
+                    # print("this is y after loop else:",y)               
+        fileName=input("\nPlease provide a file name without the extension:")
+        with open (newpath+fileName+".txt",'w') as new_file:
+            for k in range(len(x)):
+                new_file.write(str(x[k])+" "+str(y[k])+"\n")
+        
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+
+    except:
+        print('\n---------------------------------------------------------------')
+        print('\nError: Operation was halted. Files probably have different length. Please check your files before proceeding. Operation stopped while working on: ',current_file,'\n')
+
+
+
+
+def colMult(coef):
+    try:
+        if(coef!=None and coef!=" " and coef!=""):
+            cstx,csty=coef.split(",")
+            cstx=float(cstx)
+            csty=float(csty)
+            flag=0
+        else:
+            cstx,csty=input("Please provide a coef (x,y): ").split(",")
+            cstx=float(cstx)
+            csty=float(csty)
+            flag=0
+    except:
+        flag=1
+    if(flag==0):
+        newpath=os.getcwd()+"\\multiplied_data"+"\\"
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+        files=glob.glob("*.txt")
+        f_list=fileExtensionRemover(glob.glob("*.txt"))
+        for i,fp in enumerate(files):
+            print("Working on: ",files[i])
+            with open(fp) as file:
+                x = []
+                y = []
+                for line in file:
+                    values = line.split()
+                    x.append(float(values[0]))
+                    y.append(float(values[1]))
+                for j in range(len(x)):
+                    x[j]=x[j]*cstx
+                    y[j]=y[j]*csty
+            with open (newpath+f_list[i]+".txt",'w') as new_file:
+                for k in range(len(x)):
+                    new_file.write(str(x[k])+" "+str(y[k])+"\n")
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+    else:
+        print("Improper input. Exiting ...")
+
+    
+
+
+def colAdd(shift):
+    try:
+        if(shift!=None and shift!=" " and shift!=""):
+            cstx,csty=shift.split(",")
+            cstx=float(cstx)
+            csty=float(csty)
+            flag=0
+
+        else:
+            cstx,csty=input("Please provide an offset (x,y): ").split(",")
+            cstx=float(cstx)
+            csty=float(csty)
+            flag=0
+    
+    except:
+        flag=1
+    if(flag==0):
+        newpath=os.getcwd()+"\\shifted_data"+"\\"
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+        files=glob.glob("*.txt")
+        f_list=fileExtensionRemover(glob.glob("*.txt"))
+        for i,fp in enumerate(files):
+            print("Working on: ",files[i])
+            with open(fp) as file:
+                x = []
+                y = []
+                for line in file:
+                    values = line.split()
+                    x.append(float(values[0]))
+                    y.append(float(values[1]))
+                for j in range(len(x)):
+                    x[j]=x[j]+cstx
+                    y[j]=y[j]+csty
+            with open (newpath+f_list[i]+".txt",'w') as new_file:
+                for k in range(len(x)):
+                    new_file.write(str(x[k])+" "+str(y[k])+"\n")
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+    else:
+        print("Improper input. Exiting...")
+
+
+
+                
+                
+
+def generic_data_cleaner():
+    print("\nThis routine allows to output clean dual column xy txt from generic input file. \nPlease describe your file:")
+    newpath=os.getcwd()+"\\"
+    files=glob.glob("*.txt")
+    f_list=fileExtensionRemover(glob.glob("*.txt"))
+    flag=0
+    try:
+        if(cleanset.skipRows==None):
+            row=int(input("\nHow many rows to skip: "))
+        else:
+            row=int(cleanset.skipRows)
+        column=[]
+        if(cleanset.colName==None):
+            column.append(input("\nPlease provide the name of the columns (coma separated): ").split(','))
+        else:
+            column.append(cleanset.colName.split(','))
+        temp=[]
+        if(cleanset.colExport==None):
+            temp.append(input("\nWhat column combination would you like to export (formating 0+1,0+2, ...): ").split(","))
+        else:
+            temp.append(cleanset.colExport.split(','))
+        export=[]
+        for i in range(len(temp[0])):
+            export.append(temp[0][i].split('+'))
+    except:
+        flag=1
+        print("\nError in input interpretation. Check input or your general gfClean settings. Exiting ...")
+    csv=0
+    if(flag==0):
+        try:
+            print("\nStarting procedure ...\n---------------------------------------------------\n")
+            for i,fp in enumerate(files):
+                print("Working on ",files[i])
+                try:
+                    data_str=np.loadtxt(files[i],skiprows=row,comments="END_DB",dtype=str)
+                    # data_str=np.loadtxt(files[i],skiprows=row,comments="END_DB",dtype=str,delimiter=',')
+                except:
+                    print("\n!! Error with !!",files[i],"\n")
+                    continue   
+                for k in range(len(temp[0])):
+                    path=newpath+"("+column[0][int(export[k][0])]+"_"+column[0][int(export[k][1])]+")"
+                    if not os.path.exists(path):
+                            os.makedirs(path)
+                    # with open (newpath+f_list[i]+"_("+column[0][int(export[k][0])]+"_"+column[0][int(export[k][1])]+").txt",'w') as file:
+                    with open (path+"\\"+f_list[i]+"_("+column[0][int(export[k][0])]+"_"+column[0][int(export[k][1])]+")"+".txt",'w') as file:
+                        for j in range(len(data_str[:,0])):
+                            file.write(data_str[j,int(export[k][0])].replace(',','.')+" "+data_str[j,int(export[k][1])].replace(',','.')+"\n")
+        except:
+            print("\n---------------------------------------\n")
+            print("\nError in main txt decoding loop. Trying csv decoding.\n")
+            csv=1
+        if(csv==1):
+            try:
+                print("\nStarting csv backup procedure ...\n---------------------------------------------------\n")
+                for i,fp in enumerate(files):
+                    print("Working on ",files[i])
+                    try:
+                        # data_str=np.loadtxt(files[i],skiprows=row,comments="END_DB",dtype=str)
+                        data_str=np.loadtxt(files[i],skiprows=row,comments="END_DB",dtype=str,delimiter=',')
+                    except:
+                        print("\n!! Error with !!",files[i],"\n")
+                        continue   
+                    for k in range(len(temp[0])):
+                        path=newpath+"("+column[0][int(export[k][0])]+"_"+column[0][int(export[k][1])]+")"
+                        if not os.path.exists(path):
+                                os.makedirs(path)
+                        # with open (newpath+f_list[i]+"_("+column[0][int(export[k][0])]+"_"+column[0][int(export[k][1])]+").txt",'w') as file:
+                        with open (path+"\\"+f_list[i]+"_("+column[0][int(export[k][0])]+"_"+column[0][int(export[k][1])]+")"+".txt",'w') as file:
+                            for j in range(len(data_str[:,0])):
+                                file.write(data_str[j,int(export[k][0])].replace(',','.')+" "+data_str[j,int(export[k][1])].replace(',','.')+"\n")
+            except:
+                print("\n---------------------------------------\n")
+                print("\nDecoding failed. Exiting ...\n")
+                flag=1
+    if(flag==0): 
+        print('\n---------------------------------------------------------------\n')        
+        print("\nOperation successful!\n")
+                
+            
+
+class Clean:
+
+        def __init__(self):
+            self.skipRows=None
+            self.colExport=None
+            self.colName=None
+        
+        def set_colName(self,colName):
+            self.colName=colName
+        
+        def get_colName(self):
+            return self.colName
+            
+        def set_colExport(self,colExport):
+            self.colExport=colExport
+        
+        def get_colExport(self):
+            return self.colExport
+            
+        def set_skipRows(self,skipRows):
+            self.skipRows=skipRows
+            
+        def get_skipRows(self):
+            return self.skipRows
+            
+        def clear(self):
+            self.skipRows=None
+            self.colExport=None
+            self.colName=None
+            
+cleanset=Clean()
+
+def col_export(col_export):
+    if(col_export==''):
+        a=input("\nWhat column combination would you like to export (formating 0+1,0+2, ...): ")
+        cleanset.set_colExport(a)
+        print("Exported column set to: ",a,"\n")
+    else:
+        cleanset.set_colExport(col_export)
+        print("Exported column set to: ",col_export,"\n")
+      
+def col_name(col_name):
+    if(col_name==''):
+        a=input("\nPlease provide the name of the columns (coma separated): ")
+        cleanset.set_colName(a)
+        print("Col name set to: ",a,"\n")
+    else:
+        cleanset.set_colName(col_name)
+        print("Col names set to: ",col_name,"\n")
+        
+        
+def skip_row(skip):
+    if(skip==''):
+        a=input("\nNumber of rows to skip: ")
+        cleanset.set_skipRows(a)
+        print("Skip set to: ",a,"\n")
+    else:
+        cleanset.set_skipRows(skip)
+        print("Skip set to: ",skip,"\n")
+        
+def gfClear():
+    cleanset.clear()
+    print("\nGeneral file clean settings cleared succesfully !\n")
+        
+    
\ No newline at end of file
diff --git a/DesCar/Code/boot.txt b/DesCar/Code/boot.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6368bc6046ecf1923c785e4c969bc2fa151c2a5d
--- /dev/null
+++ b/DesCar/Code/boot.txt
@@ -0,0 +1 @@
+F:\OneDrive - UCL\Documents\PhD\Thesis\Process\Flex VO2\Flex VO2\20250214_vo2_deposition_post_aja_new_controle\Raman\si_peak_removed\,F:\OneDrive - UCL\Documents\PhD\Thesis\Process\Flex VO2\Flex VO2\20250214_vo2_deposition_post_aja_new_controle\Raman\si_peak_removed\
\ No newline at end of file
diff --git a/DesCar/Code/comsol.py b/DesCar/Code/comsol.py
new file mode 100644
index 0000000000000000000000000000000000000000..c5097c2d3469566f718bf7ef437525a3c251d784
--- /dev/null
+++ b/DesCar/Code/comsol.py
@@ -0,0 +1,51 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+from material import *
+import pandas as pd
+import pyperclip3
+
+
+
+def comsolClean():
+    print("\nThe comsolClean routine expects all files to be raw column comsol export")
+    a=input("\nAre you sure all .txt files in the directory are raw column comsol export ? (y/n): ")
+    if(a.lower()=='y'):
+        newpath=os.getcwd()+"\\cleaned_comsol"+"\\"
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+        files=glob.glob("*.txt")
+        f_list=fileExtensionRemover(glob.glob("*.txt"))
+        for i,fp in enumerate(files):
+            print("Working on \"",files[i],"\"")
+            data_list=[]
+            with open(fp) as file: 
+                for line in file:
+                    if(line[0]!='%'):
+                        values = [float(val) for val in line.strip().split()]
+                        data_list.append(values)    
+                x=[]
+                for j in range(len(data_list[0])):
+                    y=[]
+                    for l in range(len(data_list)):
+                        if(j==0):
+                            x.append(float(data_list[l][j]))
+                        else:
+                            y.append(float(data_list[l][j]))
+                    if(j!=0):
+                        with open (newpath+f_list[i]+".txt",'w') as file1:
+                            for m in range(len(x)):
+                                file1.write(str(x[m])+" "+str(y[m])+"\n") 
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+                         
+    elif(a.lower()=='n'):
+        print("\nPlease remove non raw column comsol export files before proceeding. Exiting ...")
+    else:
+        print("\nCommand not recognised. Exiting ...")               
\ No newline at end of file
diff --git a/DesCar/Code/extractionIV.py b/DesCar/Code/extractionIV.py
new file mode 100644
index 0000000000000000000000000000000000000000..e96a1946f29347d47b0c5533e177d0d6b1a5ceb4
--- /dev/null
+++ b/DesCar/Code/extractionIV.py
@@ -0,0 +1,80 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+import pyperclip3
+from material import *
+
+
+
+
+def resistance(path,aRange):
+    try:
+        with open(path) as file:
+            data=np.loadtxt(file)
+            v=data[:,0]
+            i=data[:,1]
+            r=np.polyfit(i[v>aRange],v[v>aRange],1)[0]
+        return r
+    except:
+        print('\n---------------------------------------------------------------\n')
+        print("\nError in resistance polyfit. Exiting...\n")
+
+
+
+
+# def rPressure():
+    # newpath=os.getcwd()+"\resistance"+"\\"
+    # if not os.path.exists(newpath):
+        # os.makedirs(newpath)
+    # a=int(input(""))
+    # b=input("On what voltage range would you like to compute the resistance (coma separated): ").split(",")
+    # b[0]=float(b[0])
+    # b[1]=float(b[1])
+    # files=glob.glob("*.txt")
+    # f_list=fileExtensionRemover(glob.glob("*.txt"))
+    # pData=[]
+    # for i in range(len(files):
+        # pData.append()
+    
+    # for i,fp in enumerate(files):
+        # r.append(float(f_list[i][]))
+
+
+def rPressure():
+    try:
+        print("\n!!Attention: The resistanceP routine will take the pressure information into the name of the file. File name should not contain numbers except the pressure info. For instance 0.5kpa, 0.5_kpa, my_measure_0.5kpa will all work but 20231127_0.5Kpa or 0.5Kpa(1) will not !!\n")
+        newpath=os.getcwd()+"\\resistance"+"\\"
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+        files=glob.glob("*.txt")
+        b=float(input("What starting voltage do you want to use to compute the resistance: "))
+        x_temp=[]
+        y_temp=[]
+        for i,fp in enumerate(files):
+            print("currently running on: ",files[i])
+            x_temp.append(float(re.findall(r'\d+',files[i])[0])) #re.findall allows to find letters in a string
+            path=os.getcwd()+"\\"+files[i]
+            y_temp.append(resistance(path,b))
+        sort=np.argsort(x_temp)
+        x=[]
+        y=[]
+        for k in range(len(sort)):
+            x.append(x_temp[sort[k]])
+            y.append(y_temp[sort[k]])
+                
+        with open (newpath+"resistance_data.txt",'w') as file:
+            for j in range(len(x)):
+                file.write(str(x[j])+" "+str(y[j])+"\n")
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+    except:
+        print('\n---------------------------------------------------------------\n')
+        print("\nError in main loop. Check manual entries. Exiting...\n")
+
+
diff --git a/DesCar/Code/filePath.py b/DesCar/Code/filePath.py
new file mode 100644
index 0000000000000000000000000000000000000000..a38cfd04a8e57e08426f75653d5185fb87104e1b
--- /dev/null
+++ b/DesCar/Code/filePath.py
@@ -0,0 +1,304 @@
+import glob
+import os
+import shutil 
+
+
+def filePathCorr(filePath):
+    if(filePath[-1]=='\\'):
+        return filePath
+    else:
+        return filePath+'\\'
+        
+def fileExtensionSingle(fileNameList):
+    if(len(fileNameList)<4):
+        fileNameList=fileNameList+".txt"
+    else:
+        if(fileNameList!=".txt"):
+            fileNameList=fileNameList+".txt"
+    return fileNameList 
+
+
+ 
+def fileExtension(fileNameList):
+    for i in range(len(fileNameList)):
+        int_file=fileNameList[i]
+        if(len(int_file)<4):
+            fileNameList[i]=fileNameList[i]+".txt"
+        else:
+            if(int_file[-4:]!=".txt"):
+                fileNameList[i]=fileNameList[i]+".txt"
+    return fileNameList
+    
+def fileExtensionRemover(fileNameList):
+    for i in range(len(fileNameList)):
+        int_file=fileNameList[i]
+        if(int_file[-4:]==".txt"):
+            fileNameList[i]=fileNameList[i].replace(".txt","")
+            # fileNameList[i]=fileNameList[i].replace("_"," ")
+    return fileNameList
+
+    
+def inFolder(file_name): #takes an array
+    file_list=glob.glob("*.txt")
+    count=0
+    for i in range(len(file_name)):
+        flag=0
+        while(flag==0):
+            for fp in enumerate(file_list):
+                if(file_name[i]==fp[1]):
+                    print(file_name[i]," found in dir")
+                    count=count+1
+                    flag=1
+            if(flag==0):
+                print(file_name[i]," not in dir")
+                flag=1
+    if(count==len(file_name)): 
+        print("all files found in dir. Ok to continue...")
+        return 1
+    else:
+        print("missing files in dir.Resuming...")
+        return 0
+    
+
+
+def descarFileConfig(fp,sp,descar_path):
+    with open(descar_path+"\\boot.txt","r") as file:
+        fpi,spi=file.readlines()[0].split(',')
+    if(fp!="null" and sp!="null"):
+        fpi=fp
+        spi=sp
+    if(fp!="null" and sp=="null"):
+        fpi=fp
+    elif(fp=="null" and sp!="null"): 
+        spi=sp
+    elif(fp=="null" and sp=="null"):
+        print("Path configuration unchanged")
+    else:
+        print("\n!!CRITICAL ERROR!! Unable to access, load or write the DesCar path confifg file: boot.txt\nUsing DesCar past this error might result in data overwritte\n")
+    
+    with open(descar_path+"\\boot.txt","w") as file:  
+        file.write(fpi+","+spi)
+
+    
+        
+
+
+    
+
+def complete_file_path(fp,descar_path):
+    if(fp!=""):
+        os.chdir(filePathCorr(fp))
+        descarFileConfig(fp,"null",descar_path)
+        print("\nFile path changed to:",filePathCorr(fp))
+        return fp
+    else:
+        print("\nThe current file path is:\n", os.getcwd())
+        while(1):
+            a=input(' Do you want to keep it ? (y/n): ')
+            if(a=='n'):
+                fpi=filePathCorr(input("Please provide a file path to the data source folder: "))
+                os.chdir(fpi)
+                descarFileConfig(fp,"null",descar_path)
+                print("The path has been changed to: ", fpi)
+                break
+            elif(a=='y'):
+                fpi=filePathCorr(os.getcwd())
+                print("Current file directory kept")
+                break
+            else:
+                print("Command not recognised. Resuming...")
+        return fpi
+ 
+
+
+def complete_save_path(sp,csp,descar_path):
+    if(sp!=""):
+        save_dir=filePathCorr(sp)
+        descarFileConfig("null",sp,descar_path)
+        print("\nSave path changed to: ",filePathCorr(save_dir))
+        return save_dir
+    else:
+        print("\nThe current save path is:\n", csp)
+        while(1):
+            a=input(' Do you want to keep it ? (y/n): ')
+            if(a=='n'):
+                spi=filePathCorr(input("Please provide a save path: "))
+                descarFileConfig("null",sp,descar_path)
+                print("The path has been changed to: ", spi)
+                break
+            elif(a=='y'):
+                spi=filePathCorr(csp)
+                print("Current save directory kept")
+                break
+            else:
+                print("Command not recognised. Resuming...")
+        return spi 
+    
+
+def file_length(file):
+    with open(file) as fp:
+        x=[]
+        for line in fp:
+            values = line.split()
+            x.append(float(values[0]))       
+    return len(x)
+
+
+
+def legend(file_list):
+    while(1):
+        a=input("Do you want to display the automatic legend ? (y/n): ")
+        if(a=="y"):
+            print("The legend will be:",fileExtensionRemover(file_list))
+            legend=fileExtensionRemover(file_list)
+            break
+        elif(a=="n"):
+            legend=input("What legend do you want to give to the curve sir ? (S1,S2,): ")
+            legend=legend.split(',') 
+            print("The legend will be:",legend)
+            break
+        else:
+            print("Command not recognised. Resuming")
+    return legend
+  
+
+def file_duplication():
+    files=glob.glob("*.txt")
+    print("Found files:",files)
+    newpath=os.getcwd()+"\modified_files"+"\\"
+    print("The current path:",os.getcwd())
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    for i, fp in enumerate(files):
+        shutil.copy2(os.getcwd()+"\\"+files[i],newpath)
+    print("All filed copied to: ",newpath)
+    os.chdir(newpath)
+    files=glob.glob("*.txt")
+    for i, fp in enumerate(files):
+        os.rename(files[i],"no_Si_peaks_"+files[i])
+    return(newpath)
+    
+    
+    
+
+class Extension: 
+    def __init__(self):
+        self.old=None
+        self.new=None
+
+    def set_old(self,old):
+        self.old=old
+    
+    def get_old(self):
+        return self.old
+        
+    def set_new(self,new):
+        self.new=new
+    
+    def get_new(self):
+        return self.new
+        
+    def clear_extension(self):
+        self.old=None
+        self.new=None
+        
+extensionset=Extension()
+    
+    
+def old_ext(old_ext):
+    if(old_ext==''):
+        a=input("\nPlease provide the old extension (.txt, .csv, ...) with the dot: ")
+        extensionset.set_old(a)
+        print("Old extenstion set to: ",a,"\n")
+    else:
+        extensionset.set_old(old_ext)
+        print("Old extenstion set to: ",old_ext,"\n")
+        
+        
+def new_ext(new_ext):
+    if(new_ext==''):
+        a=input("\nPlease provide the new extension (.txt, .csv, ...) with the dot: ")
+        extensionset.set_new(a)
+        print("New extenstion set to: ",a,"\n")
+    else:
+        extensionset.set_new(new_ext)
+        print("New extenstion set to: ",new_ext,"\n")
+        
+def extClear():
+    extensionset.clear_extension()
+    print("\nGeneral extension settings cleared succesfully !\n")
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+    
+    
+
+def extension():
+    try:
+        if(extensionset.get_old()==None):
+            old=input("\nWhat extension do you want to replace (.csv, .txt, ...): ")
+        else:
+            old=extensionset.get_old()
+        files=glob.glob("*"+old)
+        f_list=fileExtensionRemover(glob.glob("*"+old))
+        print("\n")
+        for i in range(len(files)):
+            print("Found: ",files[i])
+            
+        if(extensionset.get_new()==None):
+            new=input("\nWhat extension do you want to use (.csv, .txt, ...): ")
+        else:
+            new=extensionset.get_new()    
+            
+            
+        
+        print("\n")
+        for i,fp in enumerate(files):
+            with open(fp) as file:
+                values=[]
+                for line in file:
+                    values.append(line)
+            with open (f_list[i].replace(old,new),'w') as new_file:
+                print("Outputing ",f_list[i].replace(old,new))
+                for k in range(len(values)):
+                    new_file.write(values[k])
+        print('\n---------------------------------------------------------------\n') 
+        print("\nOperation successful!\n")
+    except:
+        print('\n---------------------------------------------------------------\n') 
+        print("\nError in the mail loop. Exiting ...\n")
+                
+                
+def trimFN(trim):
+    try:
+        if(trim==""):
+            trim=input("\nSequence to remove from the file name: ")
+        files=glob.glob("*.txt")
+        f_list=fileExtensionRemover(glob.glob("*.txt"))
+        for i,fp in enumerate(files):
+            if(trim in fp):
+                print("Found: ",fp)
+        print("\n")
+        print("\nRemoving characters ...\n")
+        for i,fp in enumerate(files):
+            if(trim in fp):
+                with open(fp) as file:
+                    values=[]
+                    for line in file:
+                        values.append(line)
+                with open (f_list[i].replace(trim,"")+".txt",'w') as new_file:
+                    print("Outputing: ",f_list[i].replace(trim,""))
+                    for k in range(len(values)):
+                        new_file.write(values[k]) 
+        print('\n---------------------------------------------------------------\n') 
+        print("\nOperation successful!\n")
+    except:
+        print('\n---------------------------------------------------------------\n') 
+        print("\nError in the mail loop. Exiting ...\n")
\ No newline at end of file
diff --git a/DesCar/Code/interpolate.py b/DesCar/Code/interpolate.py
new file mode 100644
index 0000000000000000000000000000000000000000..b2d006f3e9996db5c25e5b864b89225ff23b847f
--- /dev/null
+++ b/DesCar/Code/interpolate.py
@@ -0,0 +1,340 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+from scipy.optimize import curve_fit
+from scipy.interpolate import interp1d
+import pyperclip3
+
+
+
+def approximateOrder(order):
+    if(order==""):
+        try:
+           order=int(input("\nOrder of approximation:" ))
+        except:
+            print("\nImproper order of approximation: Exiting ...\n")
+            return None
+    else:
+        try:
+           order=int(order)
+        except:
+            print("\nImproper order of approximation: Exiting ...\n")
+            return None
+    return order
+            
+
+
+def approximateRange():
+    try:
+        interpo_range=input("\nOn what range would you like to approximate ? (Enter for all range (not supported by level routine) or x_min,x_max): ")
+        if(interpo_range==""):
+            return None
+        else:
+            interpo_range=interpo_range.split(",")
+            interpo_range[0]=float(interpo_range[0])
+            interpo_range[1]=float(interpo_range[1])
+            return interpo_range
+    except:
+        print("\nImproper range of approximation: Exiting ...\n")
+        return 'Error'
+
+
+
+
+
+
+
+def approximate():
+    try:
+        newpath=os.getcwd()+"\\fitted_data"+"\\"
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+        Type=input("Available fit: sqrt, sqrt3, poly, invX, ludwik: ")
+        index=approximateRange()
+        flag=0     
+        if(Type.lower()=="poly"):
+            order=approximateOrder(input("Polynomial order: "))
+        if(index!='Error' and (Type.lower()=="poly" or Type.lower()=="sqrt" or Type.lower()=="sqrt3" or Type.lower()=="invx" or Type.lower()=='ludwik')):
+            files=glob.glob("*.txt")
+            for i,fp in enumerate(files):
+                print("currently running on: ",files[i])
+                with open(fp) as file:
+                    x = []
+                    y = []
+                    for line in file:
+                        values = line.split()
+                        x.append(float(values[0]))
+                        y.append(float(values[1]))        
+                x_filter = []
+                y_filter = []
+                if(index==None):
+                    for k in range(len(x)):
+                        x_filter.append(x[k])
+                        y_filter.append(y[k])    
+                else:
+                    for j in range(len(x)):
+                        if((x[j]>float(index[0]))&(x[j]<float(index[1]))):
+                            x_filter.append(x[j])
+                            y_filter.append(y[j])
+                
+                if(Type.lower()=='sqrt'):
+                    p1=curve_fit(sqrt,x_filter,y_filter)[0]
+                    x_lin=np.linspace(x_filter[0],x_filter[-1],1000)
+                    f_list=fileExtensionRemover(glob.glob("*.txt"))
+                    with open (newpath+f_list[i]+"_fitted_data.txt",'w') as file:
+                        for i in range(len(x_lin)):
+                            file.write(str(x_lin[i])+" "+str(sqrt(x_lin[i],p1[0],p1[1]))+"\n")
+                    flag=1
+                    
+                elif(Type.lower()=='sqrt3'):
+                    p1=curve_fit(sqrt3,x_filter,y_filter)[0]
+                    x_lin=np.linspace(x_filter[0],x_filter[-1],1000)
+                    f_list=fileExtensionRemover(glob.glob("*.txt"))
+                    with open (newpath+f_list[i]+"_fitted_data.txt",'w') as file:
+                        for i in range(len(x_lin)):
+                            file.write(str(x_lin[i])+" "+str(sqrt3(x_lin[i],p1[0],p1[1]))+"\n")
+                    flag=1
+           
+                elif(Type.lower()=='invx'):
+                    p1=curve_fit(invX,x_filter,y_filter)[0]
+                    x_lin=np.linspace(x_filter[0],x_filter[-1],1000)
+                    f_list=fileExtensionRemover(glob.glob("*.txt"))
+                    with open (newpath+f_list[i]+"_fitted_data.txt",'w') as file:
+                        for i in range(len(x_lin)):
+                            file.write(str(x_lin[i])+" "+str(invX(x_lin[i],p1[0],p1[1]))+"\n")
+                    flag=1
+                
+                     
+                elif(Type.lower()=='poly'):
+                    if(order != None):  
+                        Coef_1=np.polyfit(x_filter,y_filter,int(order))
+                        F1=np.poly1d(Coef_1)
+                        x_lin=np.linspace(x_filter[0],x_filter[-1],1000)
+                        # x_lin=np.linspace(0,48,49)
+                        f_list=fileExtensionRemover(glob.glob("*.txt"))
+                        with open (newpath+f_list[i]+"_fitted_data.txt",'w') as file:
+                            for i in range(len(x_lin)):
+                                file.write(str(x_lin[i])+" "+str(F1(x_lin[i]))+"\n")
+                        flag=1
+                        
+                        
+                elif(Type.lower()=='ludwik'):
+                    p1=curve_fit(ludwik,x_filter,y_filter,maxfev=10000)[0]
+                    x_lin=np.linspace(x_filter[0],x_filter[-1],1000)
+                    f_list=fileExtensionRemover(glob.glob("*.txt"))
+                    print("\n-Yield strain=",p1[0],"\n-Strength coefficient= ",p1[1],'\n-Hardening coefficient= ',p1[2])
+                    with open (newpath+f_list[i]+"_fitted_data.txt",'w') as file:
+                        for i in range(len(x_lin)):
+                            file.write(str(x_lin[i])+" "+str(ludwik(x_lin[i],p1[0],p1[1],p1[2]))+"\n")
+                    flag=1             
+
+              
+                else:
+                    print("\nError in main loop. Exiting ...\n")    
+        else:
+            print("\nCommand not recognised. Exiting ...\n") 
+            
+        if(flag==1):
+            print('\n---------------------------------------------------------------\n')        
+            pyperclip3.copy("path "+newpath)
+            print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+    except:
+        print("\nSomething went wrong in approximation routine. Exiting ...\n")
+        
+
+
+class Level:
+
+    def __init__(self):
+        self.left=None
+        self.right=None
+        
+    
+    def set_left(self,left):
+        self.left=left
+    
+    def set_right(self,right):
+        self.right=right
+        
+    def clear(self):
+        self.left=None
+        self.right=None
+        
+levelSet=Level()
+        
+
+def setLeft(left):
+    if(left==''):
+        a=input("\nOn what range to the left of the curve would you like to fit you baseline (coma separated): ")
+        a=a.split(",")
+        a[0]=float(a[0])
+        a[1]=float(a[1])
+        levelSet.set_left(a)
+        print("Left range set to: ",a,"\n")
+    else:
+        left=left.split(",")
+        left[0]=float(left[0])
+        left[1]=float(left[1])
+        levelSet.set_left(left)
+        print("Left range set to: ",left,"\n")
+    
+def setRight(right):
+    if(right==''):
+        a=input("\nOn what range to the right of the curve would you like to fit you baseline (coma separated): ")
+        a=a.split(",")
+        a[0]=float(a[0])
+        a[1]=float(a[1])
+        levelSet.set_right(a)
+        print("Right range set to: ",a,"\n")
+    else:
+        right=right.split(",")
+        right[0]=float(right[0])
+        right[1]=float(right[1])
+        levelSet.set_right(right)
+        print("Right range set to: ",right,"\n")
+    
+def levelClear():
+    levelSet.clear()
+    print("\nGeneral level baseline settings cleared succesfully\n")
+
+
+
+
+def level():
+    order=approximateOrder(input("Polynomial order: "))
+    newpath=os.getcwd()+"\leveled_data"+"\\"
+    report_path=os.getcwd()+"\\report_level"+"\\"
+    if not os.path.exists(report_path):
+        os.makedirs(report_path)
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    
+    
+        
+    if(levelSet.left==None):
+        print("\nLeft fitting range: ")
+        left=approximateRange()
+        if(left==None):
+            print("Full range not supported by this function. X low and high range required for leveling routine. Exiting...")
+        else:
+            print(left)
+    else:
+        left=levelSet.left
+     
+    if(levelSet.right==None):
+        print("\nRight fitting range: ")
+        right=approximateRange()
+        if(right==None):
+            print("Full range not supported by this function. X low and high range required for leveling routine. Exiting...")
+        else:
+            print(right)
+    else:
+        right=levelSet.right
+     
+    # right=approximateRange()
+    # if(right==None):
+        # print("Full range not supported by this function. X low and high range required for leveling routine. Exiting...")
+    # else:
+        # print(right)
+            
+    f_list=fileExtensionRemover(glob.glob("*.txt"))
+    if(left!='Error' and left!=None and right!='Error' and right!=None):        
+        files=glob.glob("*.txt")
+        for i,fp in enumerate(files):
+            print("currently running on: ",files[i])
+            with open(fp) as file:
+                x = []
+                y = []
+                for line in file:
+                    values = line.split()
+                    x.append(float(values[0]))
+                    y.append(float(values[1])) 
+            x_filter = []
+            y_filter = []
+            for j in range(len(x)):
+                if((x[j]>float(left[0]))&(x[j]<float(left[1]))):
+                    x_filter.append(x[j])
+                    y_filter.append(y[j])
+                elif((x[j]>float(right[0]))&(x[j]<float(right[1]))):
+                    x_filter.append(x[j])
+                    y_filter.append(y[j])
+            # fig=plt.figure()
+            # ax=fig.add_subplot()
+            Coef_1=np.polyfit(x_filter,y_filter,int(order))
+            F1=np.poly1d(Coef_1)
+            # x_lin=np.linspace(left[0],right[1],1000) #-1 = takes the last element THE CODE DOES NOT WORK WITH THE X LIN VERSION
+            # ax.plot(x,y,ls="",marker=".")   
+            # ax.plot(x_lin,F1(x_lin),ls="",marker=".")
+            # ax.plot(x,y-F1(x),ls="",marker=".")
+            with open (report_path+f_list[i]+"_leveling_curve.txt",'w') as file:
+                    for j in range(len(x)):
+                        file.write(str(x[j])+" "+str(F1(x[j]))+"\n") 
+            with open (newpath+f_list[i]+"_leveled.txt",'w') as file:
+                    for j in range(len(x)):
+                        file.write(str(x[j])+" "+str(y[j]-F1(x[j]))+"\n") 
+                      
+    print('\n---------------------------------------------------------------\n')        
+    pyperclip3.copy("path "+newpath)
+    print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+
+                                
+                    # ax.plot(x_filter,y_filter,ls="",marker=".")
+                    # ax.set_xlabel("Position (x)")
+                    # ax.set_ylabel("Deflection")
+                    # titles=fileExtensionRemover(glob.glob("*.txt"))
+                    # ax.set_title("Deflection of "+titles[i])
+                    # temp=os.getcwd()
+                    # os.chdir(save_dir)
+                    # showRamanMaterial(global_material.get_material(),ax)
+                    # plt.savefig(titles[i]+".png",format = 'png')
+                    # plt.savefig(titles[i]+".eps",format = 'eps')
+                    # plt.clf()
+                    # plt.close()
+                    # os.chdir(temp) 
+
+
+def sqrt(x,a,b):
+    return a*np.sqrt(x)+b
+    
+
+def sqrt3(x,a,b):
+    return a*np.cbrt(x)+b
+    
+def invX(x,a,b):
+    return a+b/x
+    
+   
+def ludwik(x,a,b,c):
+    return a+b*x**c
+    
+    
+
+
+def normalise():
+    newpath=os.getcwd()+"\\normalised"+"\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    a=approximateRange()
+    files=glob.glob("*.txt")
+    f_list=fileExtensionRemover(glob.glob("*.txt"))
+    for i in range(len(files)):
+        data_raw=np.loadtxt(files[i], delimiter=" ")
+        index=(data_raw[:,0]>float(a[0])) & (data_raw[:,0]<float(a[1]))
+        x=data_raw[index,0]
+        y=data_raw[index,1]/np.max(data_raw[index,1])
+    
+        with open (newpath+f_list[i]+"_normalised.txt",'w') as file:
+            for j in range(len(x)):
+                file.write(str(x[j])+" "+str(y[j])+"\n") 
+        
+    print('\n---------------------------------------------------------------\n')        
+    pyperclip3.copy("path "+newpath)
+    print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+
+        
+    
\ No newline at end of file
diff --git a/DesCar/Code/machines.py b/DesCar/Code/machines.py
new file mode 100644
index 0000000000000000000000000000000000000000..83e09212000f8703b9b1ce34ed1dfbe312aa694b
--- /dev/null
+++ b/DesCar/Code/machines.py
@@ -0,0 +1,33 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+import sys
+
+
+
+class Machines:
+    
+    def __init__(self):
+        self.machine = None 
+
+        
+    def set_machine(self,machine):
+        self.machine=machine
+
+    def get_machine(self):
+        return self.machine
+
+        
+    
+
+global_material=Material()
+
+
+
+        
+
diff --git a/DesCar/Code/material.py b/DesCar/Code/material.py
new file mode 100644
index 0000000000000000000000000000000000000000..d25e57d4ea3ccbb2f4a904c341d41eff086e247d
--- /dev/null
+++ b/DesCar/Code/material.py
@@ -0,0 +1,131 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+import sys
+
+
+
+class Material:
+    
+    def __init__(self):
+        self.material = None 
+        self.material_path=None
+        self.raman=None
+        self.poisson=None
+        self.young=None
+        self.thermal_exp=None
+        self.comment=None
+        
+    def set_fullMaterial(self,Material,Raman,Young,Poisson,Thermal,Comment):
+        self.material=Material
+        self.raman=Raman
+        self.young=Young
+        self.poisson=Poisson
+        self.thermal=Thermal
+        self.comment=Comment
+    
+    def get_young(self):
+        return self.young
+
+    def get_poisson(self):
+        return self.poisson
+
+    
+    def get_comment(self):
+        return self.comment
+     
+    def set_material(self,material):
+        self.material=material
+    
+    def get_material(self):
+        return self.material
+     
+    def set_materialPath(self,material_path):
+        self.material_path=material_path
+    
+    def get_materialPath(self):
+        return self.material_path
+
+
+    def get_Raman(self):
+        return self.raman
+        
+    def get_thermal(self):
+        return self.thermal
+    
+    
+global_material=Material()
+
+
+
+
+def materialWiz(material,material_path):
+    if(material.lower()=="exit"):
+        global_material.set_fullMaterial(None,None,None,None,None,None)
+        print("\nMaterial analysis mode exited successfully\n")
+    else:
+        material_vect=loadMaterial(material_path)
+        materialName=None
+        Young=None
+        Poisson=None
+        Raman=None
+        Thermal=None
+        Comment=None
+        flag=0
+        for i in range(len(material_vect)):
+            if(material_vect[i][0].lower()==material.lower()):
+                print("\nGlobal material mode set to: ",material_vect[i][0])
+                materialName=material_vect[i][0]
+                flag=1
+                for j in range(len(material_vect[i])):
+                    match material_vect[i][j]:
+                        case "(Young)": 
+                            Young=material_vect[i][j+1]
+                        case "(Poisson)":
+                            Poisson=material_vect[i][j+1]
+                        case "(Comment)":
+                            Comment=material_vect[i][j+1]
+                        case "(Raman)":
+                            Raman=material_vect[i][j+1]
+                        case "(Thermal)":
+                            Thermal=material_vect[i][j+1]
+                global_material.set_fullMaterial(materialName,Raman,Young,Poisson,Thermal,Comment)
+        if(flag==0):
+            print("\nMaterial not found. Please check the spelling or the material txt file. Note that the uppercases do not matter\n")
+        elif(flag==1):
+            print(global_material.get_comment(),"\n")     
+            
+    
+
+def loadMaterial(material_path):
+    file=open(material_path)
+    material_vect=[]
+    for line in file:
+        values=line.split(",")
+        material_vect.append(values)
+    return material_vect
+
+def showRamanMaterial(material,ax):
+    try:
+        if(global_material.get_material()!=None):
+            Raman=global_material.get_Raman().split()
+            xdata=ax.get_lines()[0].get_xdata()
+            ydata=ax.get_lines()[0].get_ydata()
+            ax.set_ylim(ax.get_ylim())
+            for i in range(len(Raman)):
+                ytext=ydata[xdata>=float(Raman[i])][0]
+                ax.plot(float(Raman[i])*np.ones(2),[ax.get_ylim()[0],ytext],color='k',linestyle=':',alpha=0.5)
+                # ax.text(float(Raman[i]),ytext*1.1,'     %d '%(float(Raman[i])),rotation=90,ha="left",va="bottom",alpha=0.5)
+            print("Adding spectrum data")
+                
+        else:
+            print("No material data to diplay")
+    except:
+        print("Adding spectrum data not possible in this context. Skipping ...")
+        
+
diff --git a/DesCar/Code/material_data.txt b/DesCar/Code/material_data.txt
new file mode 100644
index 0000000000000000000000000000000000000000..19d9985ec7ea9eee1f79087416d00ba482f4f15c
--- /dev/null
+++ b/DesCar/Code/material_data.txt
@@ -0,0 +1,3 @@
+VO2,(Raman),140 192 223 260 308 338 387 395 440 482 497 588 613 661 823,(Thermal),3.93e-6,(Comment),Material properties to come later
+Silicon,(Young),169,(Poisson),0.27,(Comment),Young and Poisson value taken for (100) silicon in the X and Y orientation,(Raman),520,(Thermal),2.6e-6
+Plastification,(Raman),50
\ No newline at end of file
diff --git a/DesCar/Code/plotGeneral.py b/DesCar/Code/plotGeneral.py
new file mode 100644
index 0000000000000000000000000000000000000000..09905f0beb1d862071d772a5f060c7826e0aebcb
--- /dev/null
+++ b/DesCar/Code/plotGeneral.py
@@ -0,0 +1,552 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+import matplotlib as mpl
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+from material import *
+import pyperclip3
+
+########################################
+#       Nicolas Roisin
+#
+
+mpl.rcParams['font.family']='serif'
+# cmfont = font_manager.FontProperties(fname=mpl.get_data_path() + '/fonts/ttf/cmr10.ttf')
+# mpl.rcParams['font.serif']=cmfont.get_name()
+# mpl.rcParams['mathtext.fontset']='cm'
+mpl.rcParams['axes.unicode_minus']=False
+# mpl.rcParams['lines.marker']="o"
+# mpl.rcParams['lines.linestyle']="-"
+# mpl.rcParams['lines.markeredgecolor']="k"
+# mpl.rcParams['lines.markersize']=3.5
+# mpl.rcParams['lines.alpha']=0.5
+
+SMALL_SIZE = 10
+MEDIUM_SIZE = 13
+BIGGER_SIZE = 15
+plt.rcParams["font.family"] = "serif"
+plt.rcParams["mathtext.rm"] = "serif"
+plt.rcParams["mathtext.it"] = "serif"
+plt.rcParams["mathtext.sf"] = "serif"
+plt.rcParams["mathtext.fontset"] = "dejavuserif"
+plt.rc('font', size=MEDIUM_SIZE)          # controls default text sizes
+plt.rc('axes', titlesize=MEDIUM_SIZE)     # fontsize of the axes title
+plt.rc('axes', labelsize=MEDIUM_SIZE)    # fontsize of the x and y labels
+#plt.rc('font', weight="normal")    # fontsize of the x and y labels
+plt.rc('xtick', labelsize=MEDIUM_SIZE)    # fontsize of the tick labels
+plt.rc('ytick', labelsize=MEDIUM_SIZE)    # fontsize of the tick labels
+plt.rc('legend', fontsize=SMALL_SIZE)    # legend fontsize
+plt.rc('figure', titlesize=MEDIUM_SIZE)  # fontsize of the figure title 
+
+#
+#       Nicolas Roisin
+########################################
+ 
+
+
+
+
+def plot(plotT,save_dir):
+    if(plotT!=""):
+        if(plotT=="select"):
+            plot_select(save_dir)
+        elif(plotT=="all"):
+            plot_all(save_dir)
+        elif(plotT=="rifle"):
+            plot_rifle(save_dir)
+    else:
+        print("welcome to the generic plot tool of DesCar. This wizard allows you to plot one or more curves on one plot. Avalaible commands include: \n-rifle: plot every file in the folder separatly\n-all: plot all file in the folder on the same plot\n-select: plot a selection of file in the folder on the same plot")
+        a=input("Do you want to plot a selection of files or all files in folder. ? (rifle/select/all)")
+        if(a=="select"):
+            plot_select(save_dir)
+        elif(a=="all"):
+            plot_all(save_dir)
+        elif(a=="rifle"):
+            plot_rifle(save_dir)
+        else:
+            print("Command not recognised. Resuming...")
+
+def plot_rifle(save_dir):
+    files=glob.glob("*.txt")
+    if(plotstyle.get_style()==None):
+        disp=input("\nDisplay type for each curve (separated data points or connected line. Type l, p, f, d, x, lx or lp separated by a coma. Type line, point, fancy, dash, cross, lineCross or linePoint to set a setting for all or Enter to unspecified): ").split(',')
+        disp[0]=disp[0].lower()
+    else:
+        disp=plotstyle.get_style().split()#cheap trick for the code to stay compatible with previous line (legacy)
+        disp[0]=disp[0].lower()
+    axes = ["",""]
+    if(plotstyle.get_x()==None or plotstyle.get_y()==None):
+        axes=input("What is the name of the X and Y axes (coma separated x,y): ").split(',')
+    else:
+        axes=plotstyle.get_x(),plotstyle.get_y()
+    for i,fp in enumerate(files):
+        print("currently running on: ",files[i])
+        fig=plt.figure()
+        ax=fig.add_subplot()
+        with open(fp) as file:
+            x_temp = []
+            y_temp = []
+            for line in file:
+                values = line.split()
+                x_temp.append(float(values[0]))
+                y_temp.append(float(values[1])) 
+            sort=np.argsort(x_temp)
+            x=[]
+            y=[]
+            for k in range(len(sort)):
+                x.append(x_temp[sort[k]])
+                y.append(y_temp[sort[k]])
+            try:
+                if(disp[0]=="point"):
+                    ax.plot(x,y,ls="",marker=".")
+                elif(disp[0]=="line"):
+                    ax.plot(x,y)
+                elif(disp[0]=="fancy"):
+                    ax.plot(x,y,ls="-",marker=".",markersize="8",markeredgecolor="k")
+                elif(disp[0]=="linepoint"):
+                    ax.plot(x,y,ls="-",marker=".") 
+                elif(disp[0]=="dash"):
+                    ax.plot(x,y,ls='--')
+                elif(disp[0]=="cross"):
+                    ax.plot(x,y,ls='',marker="x")
+                elif(disp[0]=="linecross"):
+                    ax.plot(x,y,ls='-',marker="x")
+                else:
+                    if(disp[i].lower()=="l"):
+                        ax.plot(x,y)
+                    elif(disp[i].lower()=="p"):
+                        ax.plot(x,y,ls="",marker=".")
+                    elif(disp[i]=="f"):
+                        ax.plot(x,y,ls="-",marker=".",markersize="8",markeredgecolor="k")
+                    elif(disp[i]=="lp"):
+                        ax.plot(x,y,ls="-",marker=".")
+                    elif(disp[i]=="d"):
+                        ax.plot(x,y,ls='--')
+                    elif(disp[i]=="x"):
+                        ax.plot(x,y,ls='',marker="x")
+                    elif(disp[0]=="lx"):
+                        ax.plot(x,y,ls='-',marker="x")
+                    else:
+                        print("Display style \"",disp[i],"\" not recognised. Printing \"",files[i],"\" with connected lines")
+                        ax.plot(x,y)
+            except:
+                print("No style detected for \"",files[i],"\" Printing with connected lines")
+                ax.plot(x,y)
+        try:
+            ax.set_xlabel(axes[0])
+            ax.set_ylabel(axes[1])
+        except:
+            print("No X or Y label provided")
+            ax.set_xlabel("")
+            ax.set_ylabel("")
+        titles=fileExtensionRemover(glob.glob("*.txt"))
+        ax.set_title(titles[i])
+        ax.grid()
+        #plt.legend(files[i])
+        temp=os.getcwd()
+        os.chdir(save_dir)
+        showRamanMaterial(global_material.get_material(),ax)
+        plt.savefig(titles[i]+".png",format = 'png')
+        # plt.savefig(titles[i]+".eps",format = 'eps')
+        plt.clf()
+        plt.close()
+        os.chdir(temp)
+        
+
+
+
+
+
+
+    
+def plot_select(save_dir):
+    print("Type the name of a file with or without the .txt or the name of multiple files separated with a coma")
+    trf=fileExtension((input("What file do you wanna plot today ?  ")).split(','))
+    if(inFolder(trf)!=1):
+        print("Missing files: Exiting")
+    else:
+        if(plotstyle.get_style()==None):
+            disp=input("\nDisplay type for each curve (separated data points or connected line. Type l, p, f, d, x, lx or lp separated by a coma. Type line, point, fancy, dash, cross, lineCross or linePoint to set a setting for all Enter to unspecified): ").split(',')
+            disp[0]=disp[0].lower()
+        else:
+            disp=plotstyle.get_style().split()#cheap trick for the code to stay compatible with previous line (legacy)
+            disp[0]=disp[0].lower()
+    
+        if(plotstyle.get_title()==None):
+            title=input("What title should we give to the plot  ? ") 
+        else:
+            title=plotstyle.get_title()   
+        axes = ["",""]
+        if(plotstyle.get_x()==None or plotstyle.get_y()==None):
+            axes=input("What is the name of the X and Y axes (coma separated x,y): ").split(',')
+        else:
+            axes=plotstyle.get_x(),plotstyle.get_y()
+        fig=plt.figure()
+        ax=fig.add_subplot()
+        for i,fp in enumerate(trf):
+            with open(fp) as file:
+                x_temp = []
+                y_temp = []
+                for line in file:
+                    values = line.split()
+                    x_temp.append(float(values[0]))
+                    y_temp.append(float(values[1]))
+                sort=np.argsort(x_temp)
+                x=[]
+                y=[]
+                for k in range(len(sort)):
+                    x.append(x_temp[sort[k]])
+                    y.append(y_temp[sort[k]])
+                try:
+                    if(disp[0]=="point"):
+                        ax.plot(x,y,ls="",marker=".")
+                    elif(disp[0]=="line"):
+                        ax.plot(x,y)
+                    elif(disp[0]=="fancy"):
+                        ax.plot(x,y,ls="-",marker=".",markersize="8",markeredgecolor="k")
+                    elif(disp[0]=="linepoint"):
+                        ax.plot(x,y,ls="-",marker=".")  
+                    elif(disp[0]=="dash"):
+                        ax.plot(x,y,ls='--')      
+                    elif(disp[0]=="linecross"):
+                        ax.plot(x,y,ls='-',marker="x")  
+                    elif(disp[0]=="cross"):
+                        ax.plot(x,y,ls='',marker="x")                        
+                    else:
+                        if(disp[i].lower()=="l"):
+                            ax.plot(x,y)
+                        elif(disp[i].lower()=="p"):
+                            ax.plot(x,y,ls="",marker=".")
+                        elif(disp[i]=="f"):
+                            ax.plot(x,y,ls="-",marker=".",markersize="8",markeredgecolor="k")
+                        elif(disp[i]=="lp"):
+                            ax.plot(x,y,ls="-",marker=".")
+                        elif(disp[i]=="d"):
+                            ax.plot(x,y,ls='--')
+                        elif(disp[i]=="x"):
+                            ax.plot(x,y,ls='',marker="x")
+                        elif(disp[i]=="lx"):
+                            ax.plot(x,y,ls='-',marker="x")
+                        else:
+                            print("\nDisplay style \"",disp[i],"\" not recognised. Printing \"",trf[i],"\" with connected lines\n")
+                            ax.plot(x,y)
+                except:
+                    print("\nNo style detected for \"",trf[i],"\" Printing with connected lines\n")
+                    ax.plot(x,y)
+        try:
+            ax.set_xlabel(axes[0])
+            ax.set_ylabel(axes[1])
+        except:
+            print("No X or Y label provided")
+            ax.set_xlabel("")
+            ax.set_ylabel("")
+        ax.set_title(title)
+        ax.grid()
+        lgd=legend(trf)
+        if(lgd!=['']):
+            ax.legend(lgd)
+        temp=os.getcwd()
+        os.chdir(save_dir)
+        showRamanMaterial(global_material.get_material(),ax)
+        plt.savefig(title+".png",format = 'png')
+        # plt.savefig(title+".eps",format = 'eps')
+        plt.show()
+        plt.clf()
+        plt.close()
+        os.chdir(temp)
+ 
+ 
+ 
+def plot_all(save_dir):
+    print("This wizard allows you to plot all the files in the folder.")
+    files=glob.glob("*.txt")
+    print("\nRoutine will work in the following order:\n")
+    for l in range(len(files)):
+        print(files[l]) 
+    if(plotstyle.get_style()==None):
+        disp=input("\nDisplay type for each curve (separated data points or connected line. Type l, p, f, lp, x, lx or d separated by a coma. Type line, point, fancy, linePoint, cross, lineCross or dash to set a setting for all.\nEntry or Enter to unspecified): ").split(',')
+        disp[0]=disp[0].lower()
+    else:
+        disp=plotstyle.get_style().split()#cheap trick for the code to stay compatible with previous line (legacy)
+        disp[0]=disp[0].lower()
+
+    if(plotstyle.get_title()==None):
+        title=input("What title should we give to the plot  ? ") 
+    else:
+        title=plotstyle.get_title()   
+    axes = ["",""]
+    if(plotstyle.get_x()==None or plotstyle.get_y()==None):
+        axes=input("What is the name of the X and Y axes (coma separated x,y): ").split(',')
+    else:
+        axes=plotstyle.get_x(),plotstyle.get_y()
+    auto_lgd=''
+    fig=plt.figure()
+    ax=fig.add_subplot()
+    for i,fp in enumerate(files): #retourne l'index dans i et retourne le premiere element (T1.txt par exemple) dans fp
+        print("currently running on: ",files[i])
+        with open(fp) as file:
+            auto_lgd=auto_lgd+","+fp
+            x_temp=[]
+            y_temp=[]
+            for line in file:
+                values = line.split()
+                x_temp.append(float(values[0]))
+                y_temp.append(float(values[1]))
+        sort=np.argsort(x_temp)
+        x=[]
+        y=[]
+        for k in range(len(sort)):
+            x.append(x_temp[sort[k]])
+            y.append(y_temp[sort[k]])
+        try:
+            if(disp[0]=="point"):
+                ax.plot(x,y,ls="",marker=".")
+            elif(disp[0]=="line"):
+                ax.plot(x,y)
+            elif(disp[0]=="fancy"):
+                ax.plot(x,y,ls="-",marker=".",markersize="8",markeredgecolor="k")
+            elif(disp[0]=="linepoint"):
+                ax.plot(x,y,ls="-",marker=".")  
+            elif(disp[0]=="dash"):
+                ax.plot(x,y,ls='--')
+            elif(disp[0]=="cross"):
+                ax.plot(x,y,ls='',marker="x")
+            elif(disp[0]=="linecross"):
+                ax.plot(x,y,ls='-',marker="x")
+            else:
+                if(disp[i].lower()=="l"):
+                    ax.plot(x,y)
+                elif(disp[i].lower()=="p"):
+                    ax.plot(x,y,ls="",marker=".")
+                elif(disp[i]=="f"):
+                    ax.plot(x,y,ls="-",marker=".",markersize="8",markeredgecolor="k")
+                elif(disp[i]=="lp"):
+                    ax.plot(x,y,ls="-",marker=".")
+                elif(disp[i]=="d"):
+                    ax.plot(x,y,ls='--')
+                elif(disp[i]=="x"):
+                    ax.plot(x,y,ls='',marker="x")
+                elif(disp[i]=="lx"):
+                    ax.plot(x,y,ls='-',marker="x")
+                else:
+                    print("\nDisplay style \"",disp[i],"\" not recognised. Printing \"",files[i],"\" with connected lines\n")
+                    ax.plot(x,y)
+        except:
+            print("\nNo style detected for \"",files[i],"\" Printing with connected lines\n")
+            ax.plot(x,y)  
+    try:
+        ax.set_xlabel(axes[0])
+        ax.set_ylabel(axes[1])
+    except:
+        print("No X or Y label provided")
+        ax.set_xlabel("")
+        ax.set_ylabel("")
+    ax.set_title(title) 
+    ax.grid()
+    lgd=legend(auto_lgd.split(",")[1:])    
+    if(lgd!=['']):
+        ax.legend(lgd)
+    temp=os.getcwd()
+    os.chdir(save_dir)
+    showRamanMaterial(global_material.get_material(),ax)
+    plt.savefig(title+".png",format = 'png')
+    # plt.savefig(title+".eps",format = 'eps')
+    plt.show()
+    plt.clf()
+    plt.close()
+    os.chdir(temp)
+                    
+ 
+ 
+
+
+
+class Plot:
+
+    def __init__(self):
+            self.x=None
+            self.y=None
+            self.title=None
+            self.legend=None
+            self.style=None
+            self.lgd=None
+    
+    def set_title(self,title):
+        self.title=title
+        
+    def set_x(self,x):
+        self.x=x
+
+    def set_y(self,y):
+        self.y=y
+    
+    def set_style(self,style):
+        self.style=style
+        
+    def clear(self):
+        self.x=None
+        self.y=None
+        self.title=None
+        self.legend=None
+        self.style=None
+        self.lgd=None
+        
+    def get_style(self):
+        return self.style
+           
+    def get_x(self):
+        return self.x
+
+    def get_y(self):
+        return self.y
+    
+    def get_title(self):
+        return self.title
+    
+    # def set_lgd(self,lgd):
+        # self.lgd=lgd
+
+
+plotstyle=Plot()
+
+
+def write_plot_config(plot_config,descar_path):
+    with open(descar_path+"\\plot_config.txt",w) as file:
+        file.write(plot_config)
+        
+
+
+
+
+# def plot_lgd(lgd):
+    # if(lgd==""):
+        # a=input("\nWhat general lgd do you want to use: ")
+        # if(a.lower()=="fancy" or a.lower()=="linepoint" or a.lower()=="line" or a.lower()=="point"):
+            # plotstyle.set_lgd(a)
+            # print("\nGeneral lgd set to: ",a,"\n")
+        # else:
+            # print("\nlgd not supported by plot general settings. Exiting ...")
+    # else:
+        # if(lgd.lower()=="fancy" or lgd.lower()=="linepoint" or lgd.lower()=="line" or lgd.lower()=="point"):
+            # plotstyle.set_lgd(lgd)
+            # print("\nGeneral lgd set to: ",lgd,"\n")
+        # else:
+            # print("\nlgd not supported by plot general settings. Exiting ...")
+
+def plot_style(style,descar_path):
+    if(style==""):
+        a=input("\nWhat general style do you want to use: ")
+        if(a.lower()=="fancy" or a.lower()=="linepoint" or a.lower()=="line" or a.lower()=="point" or a.lower()=="dash" or a.lower()=="cross" or a.lower()=="linecross"):
+            plotstyle.set_style(a)
+            plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+            style=a.lower()
+            title=plot_config[1]
+            x=plot_config[2]
+            y=plot_config[3]
+            with open(descar_path+"\\plot_config.txt",'w') as file:
+                file.write(style+','+title+','+x+','+y)
+            print("\nGeneral style set to: ",a,"\n")
+            
+        else:
+            print("\nStyle not supported by plot general settings. Exiting ...")
+    else:
+        if(style.lower()=="fancy" or style.lower()=="linepoint" or style.lower()=="line" or style.lower()=="point" or style.lower()=="dash" or style.lower()=="cross" or style.lower()=="linecross"):
+            plotstyle.set_style(style)
+            plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+            style=style.lower()
+            title=plot_config[1]
+            x=plot_config[2]
+            y=plot_config[3]
+            with open(descar_path+"\\plot_config.txt",'w') as file:
+                file.write(style+','+title+','+x+','+y)
+            print("\nGeneral style set to: ",style,"\n")
+        else:
+            print("\nStyle not supported by plot general settings. Exiting ...")
+        
+        
+def plot_x(x,descar_path):
+    if(x==""):
+        a=input("\nWhat general x axis text do you want to use: ")
+        plotstyle.set_x(a)
+        print("x axis text set to: ",a,"\n")
+        plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+        style=plot_config[0]
+        title=plot_config[1]
+        x=a
+        y=plot_config[3]
+        with open(descar_path+"\\plot_config.txt",'w') as file:
+            file.write(style+','+title+','+x+','+y)
+    else:
+        plotstyle.set_x(x)
+        print("x axis text set to: ",x,"\n")
+        plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+        style=plot_config[0]
+        title=plot_config[1]
+        x=x
+        y=plot_config[3]
+        with open(descar_path+"\\plot_config.txt",'w') as file:
+            file.write(style+','+title+','+x+','+y)
+    
+
+def plot_y(y,descar_path):
+    if(y==""):
+        a=input("\nWhat general y axis text do you want to use: ")
+        plotstyle.set_y(a)
+        print("y axis text set to: ",a,"\n")
+        plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+        style=plot_config[0]
+        title=plot_config[1]
+        x=plot_config[2]
+        y=a
+        with open(descar_path+"\\plot_config.txt",'w') as file:
+            file.write(style+','+title+','+x+','+y)
+    else:
+        plotstyle.set_y(y)
+        print("y axis text set to: ",y,"\n")
+        plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+        style=plot_config[0]
+        title=plot_config[1]
+        x=plot_config[2]
+        y=y
+        with open(descar_path+"\\plot_config.txt",'w') as file:
+            file.write(style+','+title+','+x+','+y)
+          
+    
+def plot_title(title,descar_path):
+    if(title==""):
+        a=input("\nWhat title do you want to give to all the upcoming plots: ")
+        plotstyle.set_title(a)
+        print("Title set to: ",a)
+        plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+        style=plot_config[0]
+        title=a
+        x=plot_config[2]
+        y=plot_config[3]
+        with open(descar_path+"\\plot_config.txt",'w') as file:
+            file.write(style+','+title+','+x+','+y)
+    else:
+        plotstyle.set_title(title)
+        print("Title set to: ",title,"\n")
+        plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+        style=plot_config[0]
+        title=title
+        x=plot_config[2]
+        y=plot_config[3]
+        with open(descar_path+"\\plot_config.txt",'w') as file:
+            file.write(style+','+title+','+x+','+y)
+    
+
+def plot_clear(descar_path):
+    plotstyle.clear()
+    print("\nGeneral plot style cleared succesfully !\n")
+    plot_config=np.genfromtxt(descar_path+"\\plot_config.txt",delimiter=',',dtype='str')
+    style=''
+    title=''
+    x=''
+    y=''
+    with open(descar_path+"\\plot_config.txt",'w') as file:
+        file.write(style+','+title+','+x+','+y)
diff --git a/DesCar/Code/plotPolytek.py b/DesCar/Code/plotPolytek.py
new file mode 100644
index 0000000000000000000000000000000000000000..838f8aed20264ac5f3cf93e6253ccf5e7b18d253
--- /dev/null
+++ b/DesCar/Code/plotPolytek.py
@@ -0,0 +1,261 @@
+from filePath import * 
+from interpolate import *
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+# from plotRaman import  *
+import os
+import numpy as np
+from material import *
+
+from scipy.optimize import curve_fit
+import matplotlib.pyplot as plt
+import re
+import pyperclip3
+
+
+
+def lineOrMap(fp):
+    with open(fp) as file:
+        lines=file.readlines()
+        if(lines[0][0]!="ï"):
+            print(fp," has been detected to be a map type file")
+            return 0
+        else:
+            print(fp," has been detected to be a line type file")
+            return 1
+    
+
+
+
+def polyParsAndCorrect():  
+    print("\nThe Polytec Parse And Correct routine expects all files to either be raw line or map files from the polytec")
+    a=input("\nAre you sure all .txt files in the directory are from the polytec ? (y/n): ")
+    if(a.lower()=='y'):
+        print("\nStarting file parsing")
+        files=glob.glob("*.txt")
+        f_list=fileExtensionRemover(glob.glob("*.txt"))
+        newpath=os.getcwd()+"\clean_polytec"+"\\"
+        path_line=newpath+"\line\\"
+        if not os.path.exists(path_line):
+            os.makedirs(path_line)
+        path_map=newpath+"\map\\"
+        if not os.path.exists(path_map):
+            os.makedirs(path_map)
+        for i,fp in enumerate(files):
+            if(lineOrMap(fp)==1):
+                flag=0
+                with open(fp) as file:
+                    x=[]
+                    z=[]
+                    for line in file:
+                        try:
+                            if(isinstance(int(line[6]),int)):
+                                values=line.replace('              ','0').split('\t')
+                                x.append(float(values[0].replace(',','.')))
+                                z.append(float(values[1].replace(',','.')))
+                        except:
+                            flag=1
+                    if(flag):
+                        print("currently running on: ",fp)
+                        with open (path_line+f_list[i]+"_line_data_cleaned.txt",'w') as new_file:
+                            for k in range(len(x)):
+                                new_file.write(str(x[k])+" "+str(z[k])+"\n")
+                    # print("Cleaned line data saved to: ",path_line)
+            else:
+                print("currently running on: ",fp)
+                with open(fp) as file:
+                    lines=file.readlines()
+                    x=[]
+                    y=[]
+                    z=[]
+                    for j in range(len(lines)):
+                        values=lines[j].split()
+                        x.append(float(values[0].replace(',','.')))
+                        y.append(float(values[1].replace(',','.')))
+                        z.append(float(values[2].replace(',','.')))
+                                            
+                     
+                    with open (path_map+f_list[i]+"_map_data_cleaned.txt",'w') as new_file:
+                        for k in range(len(x)):
+                            new_file.write(str(x[k])+" "+str(y[k])+" "+str(z[k])+"\n")
+                    # print("Cleaned map data saved to: ",path_map)
+                
+                
+                
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+    elif(a.lower()=='n'):
+        print("\nPlease remove non polytec files before proceeding. Exiting ...")
+    else:
+        print("\nCommand not recognised. Exiting ...")
+        
+    
+    
+        
+
+    
+
+ 
+def deflection():
+    print("\n!!Attention: The deflection routine will take the pressure information into the name of the polytec line measurement. File name should not contain numbers except the pressure info. For instance 0.5kpa, 0.5_kpa, my_measure_0.5kpa will all work but 20231127_0.5Kpa or 0.5Kpa(1) will not !!\n")
+    newpath=os.getcwd()+"\deflection_data"+"\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    files=glob.glob("*.txt")
+    x_peak=[]
+    y_peak=[]
+    for i,fp in enumerate(files):
+        print("currently running on: ",files[i])
+        x_peak.append(float(re.findall(r'\d+',files[i])[0])) #re.findall allows to find letters in a string
+        with open(fp) as file:
+            x = []
+            y = []
+            for line in file:
+                values = line.split()
+                # x.append(float(values[0]))
+                y.append(float(values[1])) 
+            y_peak.append(y[np.argmax(y)])
+        
+        
+    sort=np.argsort(x_peak)
+    x=[]
+    y=[]
+    for k in range(len(sort)):
+        x.append(x_peak[sort[k]])
+        y.append(y_peak[sort[k]])
+            
+    with open (newpath+"deflection_data.txt",'w') as file:
+        for j in range(len(x)):
+            file.write(str(x[j])+" "+str(y[j])+"\n")
+    print('\n---------------------------------------------------------------\n')        
+    pyperclip3.copy("path "+newpath)
+    print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+
+
+      
+            
+def dCycle():
+
+    newpath=os.getcwd()+"\looped_data\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    
+      
+    print("\n!!Attention: files should be named up1, down1, up2, ... for this routine to work!! Automating checking starting ...\n")
+    flag=0
+    try:
+        files=glob.glob("*.txt")
+        flag=0
+        for i in range(len(files)):
+            if((files[i][:2]=="up")):
+                if(isinstance(int(files[i][2]),int) and len(files[i])==7):
+                    print(files[i]," detected. Format ok")
+                else:
+                    print(files[i]," detected. !!Wrong format!! Starting auto correction attempt ... ")
+                    os.rename(os.getcwd()+"\\"+str(files[i]),os.getcwd()+"\\"+str(files[i][:3]+".txt"))
+            elif(files[i][:4]=="down"):
+                if(isinstance(int(files[i][4]),int) and len(files[i])==9):
+                    print(files[i]," detected. Format ok")
+                else:
+                    print(files[i]," detected. !!Wrong format!! Starting auto correction attempt ... ")
+                    os.rename(os.getcwd()+"\\"+str(files[i]),os.getcwd()+"\\"+str(files[i][:5]+".txt"))
+    except:
+        print("\nError in data interpretation loop. Exiting...")
+        flag=1
+    if(flag==0):
+        try:
+            shift_x=0
+            shift_y=0
+
+            with open("up1.txt") as file:
+                print("Working on up1")
+                x_temp=[]
+                y_temp=[]  
+                for line in file:
+                    values = line.split()
+                    x_temp.append(float(values[0]))
+                    y_temp.append(float(values[1]))
+                sort=np.argsort(x_temp)
+                x=[]
+                y=[]
+                for k in range(len(sort)):
+                    x.append(x_temp[sort[k]])
+                    y.append(y_temp[sort[k]])
+                # shift_x=x[-1]
+                shift_y=y[-1]
+                with open (newpath+"up1.txt",'w') as new_file:
+                    for k in range(len(x)):
+                        new_file.write(str(x[k])+" "+str(y[k])+"\n")
+
+            counter=1
+            for i in range(len(files)):
+                if(i==0):
+                    print("Skipping up1 (already done)")
+                elif(i%2==0 and i!=0):
+                   with open("up"+str(counter)+".txt") as file:
+                        print("Working on: \"up"+str(counter)+".txt\".")
+                        # print("Working on: \"up"+str(counter)+".txt\". (i="+str(i)+" and Counter="+str(counter)+")")
+                        x_temp=[]
+                        y_temp=[]  
+                        for line in file:
+                            values = line.split()
+                            x_temp.append(float(values[0]))
+                            y_temp.append(float(values[1]))
+                        sort=np.argsort(x_temp)
+                        x=[]
+                        y=[]
+                        for k in range(len(sort)):
+                            x.append(x_temp[sort[k]])
+                            y.append(y_temp[sort[k]]) 
+                        # shift_x=shift_x-x[0]
+                        shift_y=shift_y-y[0]
+                        for j in range(len(x)):
+                            # x[j]=x[j]+shift_x
+                            y[j]=y[j]+shift_y
+                        # shift_x=x[-1]
+                        shift_y=y[-1]
+                        with open (newpath+"up"+str(counter)+".txt",'w') as new_file:
+                            for k in range(len(x)):
+                                new_file.write(str(x[k])+" "+str(y[k])+"\n") 
+                elif(i%2==1):
+                    with open("down"+str(counter)+".txt") as file:
+                        print("Working on: \"down"+str(counter)+".txt\".")
+                        # print("Working on: \"down"+str(counter)+".txt\". (i="+str(i)+" and Counter="+str(counter)+")")
+                        x_temp=[]
+                        y_temp=[]  
+                        for line in file:
+                            values = line.split()
+                            x_temp.append(float(values[0]))
+                            y_temp.append(float(values[1]))
+                        sort=np.argsort(x_temp)
+                        x=[]
+                        y=[]
+                        for k in range(len(sort)):
+                            x.append(x_temp[sort[k]])
+                            y.append(y_temp[sort[k]])
+                        # shift_x=shift_x-x[-1]
+                        shift_y=shift_y-y[-1]
+                        for j in range(len(x)):
+                            # x[j]=x[j]+(shift_x)
+                            y[j]=y[j]+(shift_y)
+                        # shift_x=x[0]
+                        shift_y=y[0]
+                        with open (newpath+"down"+str(counter)+".txt",'w') as new_file:
+                            for k in range(len(x)):
+                                new_file.write(str(x[k])+" "+str(y[k])+"\n")
+                        counter=counter+1
+                    
+                else:
+                    print("Should not happen")
+                    
+            print('\n---------------------------------------------------------------\n')        
+            pyperclip3.copy("path "+newpath)
+            print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+            
+        except:
+            print("\nError in main loop. Name correction attempts might have failed if initial names were wrong or data format are wrong. Exiting...")
+    
+        
\ No newline at end of file
diff --git a/DesCar/Code/plotRaman.py b/DesCar/Code/plotRaman.py
new file mode 100644
index 0000000000000000000000000000000000000000..86562463018fdba06ee788f9bd2729bfec399278
--- /dev/null
+++ b/DesCar/Code/plotRaman.py
@@ -0,0 +1,216 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+from material import *
+import re 
+from scipy.optimize import curve_fit
+from scipy.interpolate import interp1d
+import pyperclip3
+
+
+
+
+
+
+def ramanMapCleanAndAvg():
+    newpath=os.getcwd()+"\\corrected_raman_map"+"\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    files=glob.glob("*.txt")
+    f_list=fileExtensionRemover(glob.glob("*.txt"))
+    flag=0
+    a=float(input("How much data point do you have in the map?: "))
+    for i,fp in enumerate(files):
+        print("Working on \"",files[i],"\"")
+        with open(fp) as file:
+            for line in file:
+                if(line[0]!='#'):
+                    if(flag==1):
+                        y_temp=np.zeros(len(line.split()))
+                        y_temp=line.split()
+                        y_temp2=y_temp[2:]
+                        for k in range(len(y_temp2)):
+                                y[k]=y[k]+float(y_temp2[k])
+                    else:
+                        x=np.zeros(len(line.split()))
+                        y=np.zeros(len(line.split()))
+                        x=line.split()
+                        flag=1
+            y=y/a
+            with open (newpath+f_list[i]+"_corrected_map.txt",'w') as file:
+                for j in range(len(x)):
+                    file.write(str(x[j])+" "+str(y[j])+"\n")
+    print('\n---------------------------------------------------------------\n')        
+    pyperclip3.copy("path "+newpath)
+    print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+
+
+
+
+
+def ramanSiliconPressure():
+    newpath=os.getcwd()+"\\raman_peak_shift"+"\\"
+    if not os.path.exists(newpath):
+        os.makedirs(newpath)
+    files=glob.glob("*.txt")
+    x_pressure=[]
+    y_1peak_pos=[]
+    y_2peak_pos1=[]
+    y_2peak_pos2=[]
+    error=[]
+    for i,fp in enumerate(files):
+        with open(fp) as file:
+            print("Working on ","\"",files[i],"\"")
+            x_temp = []
+            y_temp = []
+            for line in file:
+                values = line.split()
+                x_temp.append(float(values[0]))
+                y_temp.append(float(values[1]))
+            
+            try:
+                y_1peak_pos.append(find_1peak(x_temp,y_temp)) #LO
+                y_2peak_pos1.append(find_2peaks(x_temp,y_temp)[0]) #TO
+                y_2peak_pos2.append(find_2peaks(x_temp,y_temp)[1]) #LO
+                x_pressure.append(float(re.findall(r'\d+',files[i])[0]))
+            except:
+                print("\n!!Fit error!!",files[i],"was skipped\n")
+
+                
+            
+    sort=np.argsort(x_pressure)
+
+    x=[]
+    y=[]
+    for k in range(len(sort)):
+        x.append(x_pressure[sort[k]])
+        y.append(y_1peak_pos[sort[k]])   
+    with open (newpath+"raman_peak_lorentzian1.txt",'w') as file:
+        for j in range(len(x)):
+            file.write(str(x[j])+" "+str(y[j])+"\n")
+    
+    with open (newpath+"LO_Ferran_Urena_and_all_uniAxial.txt",'w') as file:
+        for j in range(len(x)):
+            file.write(str(x[j])+" "+str((520.7-y[j])/(343))+"\n")
+    
+    with open (newpath+"LO_Nicolas_Roisin_and_all_uniAxial.txt",'w') as file:
+        for j in range(len(x)):
+            file.write(str(x[j])+" "+str((520.7-y[j])/(175.77))+"\n")
+            
+    
+    
+            
+    
+    
+    x1=[]
+    y1=[]
+    for k in range(len(sort)):
+        x1.append(x_pressure[sort[k]])
+        y1.append(y_2peak_pos1[sort[k]])   
+    with open (newpath+"raman_peak1_lorentzian2.txt",'w') as file:
+        for j in range(len(x1)):
+            file.write(str(x1[j])+" "+str(y1[j])+"\n")
+     
+    # with open (newpath+"LO_Ferran_Urena_and_all(TP).txt",'w') as file:
+        # for j in range(len(x1)):
+            # file.write(str(x1[j])+" "+str((520.7-y1[j])/(485))+"\n")
+    
+    # with open (newpath+"LO_Nicolas_Roisin_and_all(TP).txt",'w') as file:
+        # for j in range(len(x1)):
+            # file.write(str(x1[j])+" "+str((520.7-y1[j])/(400))+"\n")    
+            
+            
+            
+    x2=[]
+    y2=[]        
+    for k in range(len(sort)):
+        x2.append(x_pressure[sort[k]])
+        y2.append(y_2peak_pos2[sort[k]])   
+    # with open (newpath+"TO_Ferran_Urena_and_all(TP).txt",'w') as file:
+        # for j in range(len(x2)):
+            # file.write(str(x2[j])+" "+str((520.7-y2[j])/(485))+"\n")
+    
+    
+    # with open (newpath+"TO_Nicolas_Roisin_and_all(TP).txt",'w') as file:
+        # for j in range(len(x2)):
+            # file.write(str(x2[j])+" "+str((520.7-y2[j])/(400))+"\n")
+            
+    with open (newpath+"raman_peak2_lorentzian2.txt",'w') as file:
+        for j in range(len(x2)):
+            file.write(str(x2[j])+" "+str(y2[j])+"\n")
+            
+    print('\n---------------------------------------------------------------\n')        
+    pyperclip3.copy("path "+newpath)
+    print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+    
+   
+#Code bellow from Nicolas Roisin. PhD student uclouvain 2023      
+            
+
+def lorentzian( x, a,b,c ):
+    return b * c**2 / ( c**2 + ( x - a )**2)
+
+ 
+
+def lorentzian2( x, a1,b1,c1,a2,b2,c2  ):
+    return b1 * c1**2 / ( c1**2 + ( x - a1 )**2)+b2 * c2**2 / ( c2**2 + ( x - a2 )**2)
+
+
+
+#We here try to detect a single peak. A single peak would be mainly the LO (LL 20231212)
+
+#We do a quadratic interpolation of the Raman spectrum then we detect the max. The >450 is to take the median and remove the baseline.
+# Taking >450 removes some weird effect that can appear bellow 450 
+
+def find_1peak(x,y):
+    x=np.array(x)
+    y=np.array(y)
+    x_interp=np.linspace(x[0],x[-1],10000)
+    # y=y-np.median(y[(x<500) & (x>480)])
+    y=y-np.median(y[(x>450)])
+    y=y/np.max(y)
+    f = interp1d(x, y,kind='quadratic')   
+    x0=x_interp[f(x_interp)==np.max(f(x_interp[x_interp>450]))][0]
+    p1=curve_fit(lorentzian,x_interp,f(x_interp),p0=[x0,0.7,1],bounds=[(515,0,0.5),(525,1,3)],maxfev=10000)[0]
+    return p1[0] #returns the position only
+    # return p1 #returns the position, height and width
+
+#We here try to find two peaks: LO and TO. The LO is the one that moves the less compared to the 520.7 original position of the peak. The TO moves away to
+# the left of this position. Not always possible to find it. Under high levels of strain the two peaks do separate. Not so much with smaller levels of deformation
+# p2[0] => TO and p2[3] => LO (LL 20231212)
+
+#We do a quadratic interpolation of the Raman spectrum then we detect the max. The >450 is to take the median and remove the baseline.
+# Taking >450 removes some weird effect that can appear bellow 450 
+
+def find_2peaks(x,y):
+    x=np.array(x)
+    y=np.array(y)
+    x_interp=np.linspace(x[0],x[-1],10000)
+    y=y-np.median(y[x<450])
+    y=y/np.max(y)
+    f = interp1d(x, y,kind='quadratic')   
+    x0=x_interp[f(x_interp)==np.max(f(x_interp[x_interp>450]))][0]
+    p2=curve_fit(lorentzian2,x_interp,f(x_interp),p0=[x0-0.1,0.7,1,x0+0.1,0.7,1],bounds=[(515,0,0.5,515,0,0.5),(525,1,3,525,1,3)],maxfev=10000)[0]
+    return p2[0],p2[3]
+
+
+
+
+#We do a quadratic interpolation of the Raman spectrum then we detect the max. The >450 is to take the median and remove the baseline.
+# Taking >450 removes some weird effect that can appear bellow 450 
+
+def find_peak_max(x,y):
+    x=np.array(x)
+    y=np.array(y)
+    x_interp=np.linspace(x[0],x[-1],10000)
+    # y=y-np.median(y[(x<500) & (x>480)])
+    y=y-np.median(y[(x>450)]) 
+    y=y/np.max(y)
+    f = interp1d(x, y,kind='quadratic')   
+    x0=x_interp[f(x_interp)==np.max(f(x_interp[x_interp>450]))][0]
+    return x0
\ No newline at end of file
diff --git a/DesCar/Code/plot_config.txt b/DesCar/Code/plot_config.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5dbf92ae32df5b3277bc26adb5a0d472aba8ea21
--- /dev/null
+++ b/DesCar/Code/plot_config.txt
@@ -0,0 +1 @@
+line,Raman analysis of VO2,Position [cm-1],Count [a.u.]
\ No newline at end of file
diff --git a/DesCar/Code/siliconPeakRemover.py b/DesCar/Code/siliconPeakRemover.py
new file mode 100644
index 0000000000000000000000000000000000000000..d60647954e7483532172b463c6c325661fcf2f4b
--- /dev/null
+++ b/DesCar/Code/siliconPeakRemover.py
@@ -0,0 +1,73 @@
+from filePath import * 
+import cmd #cmd in small letters is the name of the module. do cmd.Cmd.any_function() to run a function from the class from the module
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+import glob
+from plotRaman import  *
+import os
+import numpy as np
+from scipy.optimize import curve_fit
+from scipy.interpolate import interp1d
+import re
+import pyperclip3
+
+
+
+def lorentz(x,x0,A,W):
+    return 2*A/(np.pi*W)/(1+((x-x0)/(W/2))**2)
+    #return A/(1+((x-x0)/(W/2))**2)
+    
+
+
+
+def peak_remover():
+    #newpath=file_duplication()
+    #temp_path=os.getcwd()
+    #os.chdir(newpath)
+    
+    
+    print("\nThe Raman Silicon Remove routine expects all files to be Raman data")
+    a=input("\nAre you sure all .txt files in the directory are from the Raman ? (y/n): ")
+    if(a.lower()=='y'):
+        newpath=os.getcwd()+"\si_peak_removed"+"\\"
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+        
+        files = glob.glob("*.txt")
+        f_list=fileExtensionRemover(glob.glob("*.txt"))
+        for i,fp in enumerate(files):
+            print("Removing silicon peak on: ",files[i])
+            data=np.loadtxt(files[i])
+            #data[:,1]=data[:,1]-np.min(data[:,1])
+            f=interp1d(data[:,0],data[:,1])
+            peak_x=np.linspace(515,525,100)
+            win=5
+            xmin=peak_x[np.argmax(f(peak_x))]-win
+            xmax=peak_x[np.argmax(f(peak_x))]+win
+            inter_x=np.linspace(xmin,xmax,1000)   
+            inter_y=f(inter_x)
+            inter_y=inter_y-np.min(inter_y)
+            print("Detected peak at: [cm-1]",peak_x[np.argmax(f(peak_x))])
+            
+            p=curve_fit(lorentz, inter_x, inter_y, p0=[peak_x[np.argmax(f(peak_x))],np.max(f(peak_x)),5],maxfev=10000)[0]
+            
+
+            data[:,1]=f(data[:,0])-lorentz(data[:,0],p[0],p[1],p[2])-np.min(f(data[:,0]))
+            
+            
+            with open (newpath+f_list[i]+" (Si peak removed).txt",'w') as file:
+                for i in range(len(data[:,0])):
+                    file.write(str(data[i,0])+" "+str(data[i,1])+"\n")
+            
+        print('\n---------------------------------------------------------------\n')        
+        pyperclip3.copy("path "+newpath)
+        print("\nOperation successful! Created path and path command copied to clipboard. Paste to move DesCar to the created directory\n")
+            
+        # print('\n---------------------------------------------------------------\n')      
+        # print("Modified measurement without silicon peak saved to: ",newpath)  
+    elif(a.lower()=='n'):
+        print("\nPlease remove non Raman files before proceeding. Exiting ...")
+    else:
+        print("\nCommand not recognised. Exiting ...")
+        
+        
diff --git a/DesCar/Documentation/Manual.pptx b/DesCar/Documentation/Manual.pptx
new file mode 100644
index 0000000000000000000000000000000000000000..e87704f3a3347c5b25e17732bba3e6defa2b895a
Binary files /dev/null and b/DesCar/Documentation/Manual.pptx differ
diff --git a/DesCar/ideas/background.png b/DesCar/ideas/background.png
new file mode 100644
index 0000000000000000000000000000000000000000..585bf4784a14f57183c905f035bb2755a6af2ab4
Binary files /dev/null and b/DesCar/ideas/background.png differ
diff --git a/How to collaborate.docx b/How to collaborate.docx
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Use and acknowledgement.docx b/Use and acknowledgement.docx
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/log.txt b/log.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1f9472f31c55e13e1585fb7327df3ffd2f637f14
--- /dev/null
+++ b/log.txt
@@ -0,0 +1,350 @@
+09/08/24
+DesCar version 2.12.2
+Entry by: Lahaye Loïc
+
+Additions:
+- dash and cross plot style
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+10/07/24
+DesCar version 2.12.1
+Entry by: Lahaye Loïc
+
+Additions:
+- dataCycle: automatic name correction attempt
+- Plot configuration saving. DesCar will save the plot style, title and axis name between sessions
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+- polyCycle renamed dataCycle
+- No more global program crash when dataCycle does not find the file
+- Comsol cleaning routine now outputs file with same name as source. No more _cleaned
+
+Major bug correction:
+-
+
+
+24/04/24
+DesCar version 2.11.4
+Entry by: Lahaye Loïc
+
+Additions:
+-The diffrential stoney routine now export a txt report of the experiment. The fitting is also exported as png for transparency reasons.
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+19/03/24
+DesCar version 2.11.3
+Entry by: Lahaye Loïc
+
+Additions:
+- Global modifiers for the extension swap routine. The extension to be removed and the next one can be saved in an object for the all descar session. One can then only type extension without being asked for the extension to swap.
+	-setExtOld(), setExtNew(), clearExt(), setExtension()
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+
+
+
+29/02/24
+DesCar version 2.11.2
+Entry by: Lahaye Loïc
+
+Additions:
+- Added the possibility to remmove any polynomial baseline in the leveling routine. The routine will export the fitted removed baseline in a separated folder for verification purposes. Added better description of the fitting ranges.
+- Modification of the the file architecture in preparation for collaboration
+- Addition of PotPot folder
+- Addition of collaboration rules files
+- Addition of use and acknowledgement
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+
+05/01/24
+DesCar version 2.11.1
+Entry by: Lahaye Loïc
+
+Additions:
+-Added commands definitions
+-Added sqrt3 approximation
+
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+
+
+
+
+21/12/2023
+DesCar version 2.11.0
+Entry by: Lahaye Loïc
+
+Additions:
+-Plot style enhancement by default
+-normalise => normalisation routine
+
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+-eps plot export was removed in DesCar 2.10.2  => should be added as a global modifier that is being saved between sessions. Should add a "settings" command that show all the global configurations like filePath and soon the eps toggle.
+-Plot enhancement => grid should not be by default
+-Plot => add the possibility to add an inset
+
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+
+
+18/12/2023
+DesCar version 2.10.1
+Entry by: Lahaye Loïc
+
+Additions:
+-
+
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+
+Minor bug correction:
+-
+
+Major bug correction:
+-polyCycle did an erronous correction on the x axis. The routine should not perform an x axis correction but only a y axis correction. Bug has been corrected. 
+
+
+15/12/2023
+DesCar version 2.10.0
+Entry by: Lahaye Loïc
+
+Additions:
+-trimFN: allows to rename files on the fly by removing a sequence of character from file names (.txt)
+-resistanceP: gets the resistance value out of an IV curve. For multiple file with the xAxes data in the file name. xAxes data must be the only number in the file name.
+
+
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+
+12/12/2023
+DesCar version 2.9.0
+Entry by: Lahaye Loïc
+
+Additions:
+-Addition of a level class to set the begining and ending 1D fit range.
+	-setLevel
+	-levelR
+	-levelL
+	-levelClear
+
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+
+Minor bug correction:
+-Clarrification of denomination in the final export of detected silicon raman peaks (loretzian fit in ramanSiliconPressure()). We export L0 for the one lorentzian and T0 (P[0]) + L0 (P[3]) in the two peak fit
+
+
+Major bug correction:
+-
+
+
+
+
+
+08/12/2023
+DesCar version 2.8.1
+Entry by: Lahaye Loïc
+
+Additions:
+-
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+
+Minor bug correction:
+-Ugly print to prompt in legacy parsePolytec command corrected
+
+Major bug correction:
+-
+
+
+
+07/12/2023
+DesCar version 2.8.0
+Entry by: Lahaye Loïc
+
+Additions:
+-Generic file cleaning: Allows to clean and export under the form of a two column xy .txt file any input file. 
+	-User provides #of rows to skip,column header name and combination of columns to export
+	-Input file can contain any given number of columns
+	-gfc: runs the generic file cleaning routine 
+	-gfcSkip: sets the number of rows to skip for all gfc run
+	-gfcColName: sets the name of the column header for all gfc run
+	-gfcExport: sets the combination of export for all gfc run
+	-gfcClear: clears all global gfc settings
+	-setGFC: sets all gfc settings
+	
+	-The gfc routine was proven to be compatible with polytec measurements, IC-Cap export, comsol export.
+
+In progress:
+-gfc routine will be used to update all previously created file cleaning routines. Machine object modifier will old settings (skip, colName and colExport) for the gfc routine. Futur DesCar updtate will hence deactivate the legacy dektak/comsol/raman/polytec file cleaning and parsing routines.
+
+Minor bug correction:
+-
+
+Major bug correction:
+-
+
+
+
+
+
+01/12/2023
+DesCar Version 2.7.0
+Entry by: Lahaye Loïc
+
+Additions:
+-Stoney: Implementation of the differential stoney equation for thermal stress measurements from the elipso + dektak (thickness of thin films + wafer curvature)
+
+
+In progress:
+-
+
+Minor bug correction:
+-polytecDeflection: Correction of a path name. Update 2.6.1 updated path name in the polytec routines but not in the DesCar automation routine polytecDeflection hence breaking it. Now fixed and tested
+
+Major bug correction:
+-
+
+
+29/11/2023
+DesCar Version 2.6.1
+Entry by: Lahaye Loïc
+
+Additions:
+-Global plot modifier. Allows to set plot parameters once and not once per plot execution. Plot routine will automatically detect the presence of a general plot setting. Will use it if there and will ask for it if not
+	-plotX: sets the x legend for all plots. 
+	-plotY: sets the y legend for all plots.
+	-plotTitle: sets the title for all plots.
+	-plotStyle: sets the global fancy,line,point,linepoint  for all plots
+	-setPlot: DesCar automation to set all parameters.
+	-plotClear: clears all global plot parameters
+	-re-running any command will overide previous entry. Global settings not saved between sessions
+-Dektak cleaning file routine	
+	-dektakClean: takes raw .txt dektak measurement and outputs clean xy txt file compatible
+-extension modifier:
+	-extension: allows to change a given extension to another one of all file in folder
+
+In progress:
+-thermal stress estimation based on the differential version of stoney's equation. Almost done. Trouble in the final stress value computation 
+
+Minor bug correction:
+-parsePolytec:
+	-Goal of the routine
+		-Takes raw polytec line or map file, parses them and cleans them. The outputs are separated in 2 folders (line and map) containing clean xy or xyz data
+	-Bug description
+		-The polytec line file replace saturation of the measurement or abscence of data by a blank line in the measurement. The previous version of the code (2.5.1 and before) replaced those blanks by 0.0. This resulted in error in final plot with ghost points at zero.
+	-Bug status
+		-Complete fix was implemented and tested on real data. The blank lines are now deleted as they should be.
+
+Major bug correction (update required):
+-parsePolytec:
+	-Goal of the routine
+		-Takes raw polytec line or map file, parses them and cleans them. The outputs are separated in 2 folders (line and map) containing clean xy or xyz data
+	-Bug description
+		-The routine systematically deleted 120 data point in each file
+	-Bug status
+		-Complete fix was implemented and tested on real data. The code detecting wheter a line is data/text/blank had to be rewritten. Was done using the module from the dektak cleaning code.
\ No newline at end of file