lib/redred.py
def importCSV(self,file):
        """
        Read a CSV containing rrScan() data, and assign to self all the data
        file should be a string of the whole path of the file

        Could do with some improvement.
        """


        print('WARNING: import_file_csv() needs some improvement...')

        try:
            f = open(file, 'r')

            if f:
                metacounter=0
                for l in f:
                    metacounter+=1
                    line = l.split('\t')
                    if 'Material' in line: self.material = line[1]
                    elif 'Pump Power' in line: self.pumpPw = float(line[1])
                    elif 'Pump Spot' in line: self.pumpSp = float(line[1])
                    elif 'Probe Power' in line: self.probePw = float(line[1])
                    elif 'Probe Spot' in line: self.probeSp = float(line[1])
                    elif 'date' in line: self.date = line[1]
                    elif 'Destruction Power' in line: self.destrPw = float(line[1])
                    elif 'R0' in line: self.R0 = float(line[1])
                    elif 'Temperature' in line: self.temperature = float(line[1])
                    elif 'RawData' in line :
                        break
                f.close()
                skipline = True
                n=0
                data = []

                while skipline: # skip metadata section then import array of data
                    try:
                        data = np.loadtxt(file, delimiter=',', skiprows=n)
                        n+=1
                        skipline = False
                    except ValueError:
                        n+=1

                for i in range(len(data)):
                    self.time.append(data[i][0])
                    self.rawtrace.append(data[i][1])
                    self.trace.append(data[i][2])
        except FileNotFoundError:
                    print('ERROR 404: file not found')

        Read a CSV containing rrScan() data, and assign to self all the data
        file should be a string of the whole path of the file

        Could do with some improvement.
        
Read a CSV containing rrScan() data, and assign to self all the data
file should be a string of the whole path of the file

Could do with some improvement.
Read a CSV containing rrScan () data and assign to self all the data file should be a string of the whole path of the file Could do with some improvement .
def importCSV(self,file):
        print('WARNING: import_file_csv() needs some improvement...')
        try:
            f = open(file, 'r')
            if f:
                metacounter=0
                for l in f:
                    metacounter+=1
                    line = l.split('\t')
                    if 'Material' in line: self.material = line[1]
                    elif 'Pump Power' in line: self.pumpPw = float(line[1])
                    elif 'Pump Spot' in line: self.pumpSp = float(line[1])
                    elif 'Probe Power' in line: self.probePw = float(line[1])
                    elif 'Probe Spot' in line: self.probeSp = float(line[1])
                    elif 'date' in line: self.date = line[1]
                    elif 'Destruction Power' in line: self.destrPw = float(line[1])
                    elif 'R0' in line: self.R0 = float(line[1])
                    elif 'Temperature' in line: self.temperature = float(line[1])
                    elif 'RawData' in line :
                        break
                f.close()
                skipline = True
                n=0
                data = []
                while skipline: 
                    try:
                        data = np.loadtxt(file, delimiter=',', skiprows=n)
                        n+=1
                        skipline = False
                    except ValueError:
                        n+=1
                for i in range(len(data)):
                    self.time.append(data[i][0])
                    self.rawtrace.append(data[i][1])
                    self.trace.append(data[i][2])
        except FileNotFoundError:
                    print('ERROR 404: file not found')
def importCSV ( self , file ) : print ( 'WARNING: import_file_csv() needs some improvement...' ) try : f = open ( file , 'r' ) if f : metacounter = 0 for l in f : metacounter += 1 line = l . split ( '\t' ) if 'Material' in line : self . material = line [ 1 ] elif 'Pump Power' in line : self . pumpPw = float ( line [ 1 ] ) elif 'Pump Spot' in line : self . pumpSp = float ( line [ 1 ] ) elif 'Probe Power' in line : self . probePw = float ( line [ 1 ] ) elif 'Probe Spot' in line : self . probeSp = float ( line [ 1 ] ) elif 'date' in line : self . date = line [ 1 ] elif 'Destruction Power' in line : self . destrPw = float ( line [ 1 ] ) elif 'R0' in line : self . R0 = float ( line [ 1 ] ) elif 'Temperature' in line : self . temperature = float ( line [ 1 ] ) elif 'RawData' in line : break f . close ( ) skipline = True n = 0 data = [ ] while skipline : try : data = np . loadtxt ( file , delimiter = ',' , skiprows = n ) n += 1 skipline = False except ValueError : n += 1 for i in range ( len ( data ) ) : self . time . append ( data [ i ] [ 0 ] ) self . rawtrace . append ( data [ i ] [ 1 ] ) self . trace . append ( data [ i ] [ 2 ] ) except FileNotFoundError : print ( 'ERROR 404: file not found' )
Read a CSV containing rrScan() data, and assign to self all the data
file should be a string of the whole path of the file
Read a CSV containing rrScan () data and assign to self all the data file should be a string of the whole path of the file
"""
        Read a CSV containing rrScan() data, and assign to self all the data
        file should be a string of the whole path of the file

        Could do with some improvement.
        """ # skip metadata section then import array of data
self
file