#NEWLINE# def read_data( self , force_read_timestamp = False ) : #NEWLINE# #INDENT# 'Using the self.lines buffer, converts the data lines in numpy arrays.\n            - One array self.data for the data (one column/vector per station)\n            - One array self.timestamp for the timestamps (i.e. timestamp vector)\n        Reading method differs accordingly to the self.isSuperSID flag\n        New: Extended format supports a timestamp for SuperSID format as well as .%f for second decimals\n        ' #NEWLINE# converters_dict = { #NEWLINE# #INDENT# 0 : SidFile . _StringToDatetime , #NEWLINE# #UNINDENT# } #NEWLINE# for i in range ( len ( self . stations ) ) : #NEWLINE# #INDENT# converters_dict [ ( i + 1 ) ] = SidFile . _StringToFloat #NEWLINE# #UNINDENT# if ( self . isSuperSID and ( not self . is_extended ) ) : #NEWLINE# #INDENT# print ( 'Warning: read SuperSid non extended file and generate time stamps.' ) #NEWLINE# self . data = numpy . loadtxt ( self . lines , comments = '#' , delimiter = ',' ) . transpose ( ) #NEWLINE# self . generate_timestamp ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . isSuperSID and self . is_extended ) : #NEWLINE# #INDENT# print ( 'Warning: read SuperSid extended file, time stamps are read & converted from file.' ) #NEWLINE# inData = numpy . loadtxt ( self . lines , dtype = datetime , comments = '#' , delimiter = ',' , converters = converters_dict ) #NEWLINE# self . timestamp = inData [ : , 0 ] #NEWLINE# self . data = numpy . array ( inData [ : , 1 : ] , dtype = float ) . transpose ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( ( len ( self . lines ) - self . headerNbLines ) != ( ( ( 60 * 60 ) * 24 ) / self . LogInterval ) ) or force_read_timestamp or self . is_extended ) : #NEWLINE# #INDENT# print ( 'Warning: read SID file, timestamps are read & converted from file.' ) #NEWLINE# inData = numpy . loadtxt ( self . lines , dtype = datetime , comments = '#' , delimiter = ',' , converters = converters_dict ) #NEWLINE# self . timestamp = inData [ : , 0 ] #NEWLINE# self . data = numpy . array ( inData [ : , 1 ] , dtype = float , ndmin = 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Optimization: read SID file, generate timestamp instead of reading & converting them from file.' ) #NEWLINE# self . data = numpy . array ( numpy . loadtxt ( self . lines , comments = '#' , delimiter = ',' , usecols = ( 1 , ) ) , ndmin = 2 ) #NEWLINE# self . generate_timestamp ( )