def updateCurrents(self,timenow,tsec): """ Checks to see if the currents need updating """ tindex = othertime.findGreater(timenow,self.time) if not tindex == self.time_index: if self.verbose: print 'Reading SUNTANS currents at time: ',timenow self.uT[:,0]=self.uT[:,1] self.vT[:,0]=self.vT[:,1] self.wT[:,0]=self.wT[:,1] self.etaT[:,0]=self.etaT[:,1] self.uT[:,1], self.vT[:,1], self.wT[:,1], self.etaT[:,1] = self.getUVWh(tindex) self.time_index = tindex # Temporally interpolate onto the model step self.timeInterpUVW(tsec,self.time_index)
def updateCurrents(self,timenow,tsec): """ Checks to see if the currents need updating """ tindex = othertime.findGreater(timenow,self.time) if not tindex == self.time_index: if self.verbose: print('Reading SUNTANS currents at time: ',timenow) self.uT[:,0]=self.uT[:,1] self.vT[:,0]=self.vT[:,1] self.wT[:,0]=self.wT[:,1] self.etaT[:,0]=self.etaT[:,1] self.uT[:,1], self.vT[:,1], self.wT[:,1], self.etaT[:,1] = self.getUVWh(tindex) self.time_index = tindex # Temporally interpolate onto the model step self.timeInterpUVW(tsec,self.time_index)
def initCurrents(self): """ Initialise the forward and backward currents and free-surface height """ tindex = othertime.findGreater(self.time_track[0],self.time) self.time_index = tindex # Check the time index here if tindex == None: raise Exception, 'start time less than model time: ',self.time[0] elif self.time_index==0: self.time_index=1 self.uT = np.zeros((self.nActive,2)) self.vT = np.zeros((self.nActive,2)) self.wT = np.zeros((self.nActive,2)) self.etaT = np.zeros((self.Nc,2)) self.uT[:,0], self.vT[:,0], self.wT[:,0], self.etaT[:,0] = self.getUVWh(tindex-1) self.uT[:,1], self.vT[:,1], self.wT[:,1], self.etaT[:,1] = self.getUVWh(tindex) self.timeInterpUVW(self.time_track_sec[0],self.time_index)
def initCurrents(self): """ Initialise the forward and backward currents and free-surface height """ tindex = othertime.findGreater(self.time_track[0],self.time) self.time_index = tindex # Check the time index here if tindex == None: raise Exception('start time less than model time: ').with_traceback(self.time[0]) elif self.time_index==0: self.time_index=1 self.uT = np.zeros((self.nActive,2)) self.vT = np.zeros((self.nActive,2)) self.wT = np.zeros((self.nActive,2)) self.etaT = np.zeros((self.Nc,2)) self.uT[:,0], self.vT[:,0], self.wT[:,0], self.etaT[:,0] = self.getUVWh(tindex-1) self.uT[:,1], self.vT[:,1], self.wT[:,1], self.etaT[:,1] = self.getUVWh(tindex) self.timeInterpUVW(self.time_track_sec[0],self.time_index)