parameters: (self)
return_statement: return v, v_sigma
docstring: look at the last 2 plotfiles and estimate the velocity by
          finite-differencing
docstring_summary: look at the last 2 plotfiles and estimate the velocity by
          finite-differencing
docstring_tokens: look at the last 2 plotfiles and estimate the velocity by finite - differencing
function: def get_velocity(self):
          """look at the last 2 plotfiles and estimate the velocity by
          finite-differencing"""
  
          vs = []
          pairs = [(-2, -1), (-3, -1), (-3, -1)]
  
          for i1, i2 in pairs:
              f1 = self.files[i1]
              p1 = Profile(os.path.join(self.name, f1))
  
              f2 = self.files[i2]
              p2 = Profile(os.path.join(self.name, f2))
  
              # we'll do this by looking at 3 different temperature
              # thresholds and averaging
              T_ref = [2.e9, 3.e9, 4.e9]
  
              for T0 in T_ref:
                  x1 = p1.find_x_for_T(T0)
                  x2 = p2.find_x_for_T(T0)
                  vs.append((x1 - x2)/(p1.time - p2.time))
  
          vs = np.array(vs)
          v = np.mean(vs)
          v_sigma = np.std(vs)
          return v, v_sigma
function_tokens: def get_velocity ( self ) : vs = [ ] pairs = [ ( - 2 , - 1 ) , ( - 3 , - 1 ) , ( - 3 , - 1 ) ] for i1 , i2 in pairs : f1 = self . files [ i1 ] p1 = Profile ( os . path . join ( self . name , f1 ) ) f2 = self . files [ i2 ] p2 = Profile ( os . path . join ( self . name , f2 ) ) # we'll do this by looking at 3 different temperature # thresholds and averaging T_ref = [ 2.e9 , 3.e9 , 4.e9 ] for T0 in T_ref : x1 = p1 . find_x_for_T ( T0 ) x2 = p2 . find_x_for_T ( T0 ) vs . append ( ( x1 - x2 ) / ( p1 . time - p2 . time ) ) vs = np . array ( vs ) v = np . mean ( vs ) v_sigma = np . std ( vs ) return v , v_sigma