def extrapolationError(self): new_path = self.path + '/' + self.res[-1][0] + '/' simulation1 = sm.Simulation(new_path, 'Extrapolated_N2.dir') simulation2 = sm.Simulation(new_path, 'Extrapolated_N3.dir') kick1 = rq.getKick(simulation1) kick2 = rq.getKick(simulation2) error = np.abs(kick1 - kick2) return error
def extrapolationError(path, directory): res = sortedResolution(path) new_path = path + '/' + res[-1][0] + '/' simulation1 = sm.Simulation(new_path, 'Extrapolated_N2.dir') simulation2 = sm.Simulation(new_path, 'Extrapolated_N3.dir') kick1 = rq.getKick(simulation1) kick2 = rq.getKick(simulation2) error = np.abs(kick1 - kick2) return error
def junkError(path, directory): res = sortedResolution(path) new_path = path + '/' + res[-1][0] + '/' simulation1 = sm.Simulation(new_path, directory) simulation2 = sm.Simulation(new_path, directory, relaxed=True) kick1 = rq.getKick(simulation1) kick2 = rq.getKick(simulation2) error = np.abs(kick1 - kick2) return error
def truncError(path, directory): """Compares the higest resolution with the next highest resolution to find the difference and returns that value as the error""" res = sortedResolution(path) if len(res) < 2: return -1 path1 = path + '/' + res[-1][0] + '/' path2 = path + '/' + res[-2][0] + '/' sim1 = sm.Simulation(path1, directory) sim2 = sm.Simulation(path2, directory) kick1 = rq.getKick(sim1) kick2 = rq.getKick(sim2) error = np.abs(kick1 - kick2) return error
def limitedModesError(self): new_path = self.path + '/' + self.res[-1][0] + '/' simulation = sm.Simulation(new_path, self.directory) kick2 = rq.getKick(simulation, 7) error = np.abs(self.kick - kick2) return error
def limitedModesError(path, directory): res = sortedResolution(path) new_path = path + '/' + res[-1][0] + '/' simulation = sm.Simulation(new_path, directory) kick1 = rq.getKick(simulation) kick2 = rq.getKick(simulation, 7) error = np.abs(kick1 - kick2) return error
def downSampleError(self): new_path = self.path + '/' + self.res[-1][0] + '/' simulation2 = sm.Simulation(new_path, self.directory, relaxed=False, downsample=2) kick2 = rq.getKick(simulation2) error = np.abs(self.kick - kick2) return error
def downSampleError(path, directory): res = sortedResolution(path) new_path = path + '/' + res[-1][0] + '/' simulation1 = sm.Simulation(new_path, directory) simulation2 = sm.Simulation(new_path, directory, relaxed=False, downsample=2) simulation3 = sm.Simulation(new_path, directory, relaxed=False, downsample=4) kick1 = rq.getKick(simulation1) kick2 = rq.getKick(simulation2) kick3 = rq.getKick(simulation3) #print(kick1, kick2, kick3) #Remove This!! error = np.abs(kick1 - kick2) return error
def truncError(self): """Compares the higest resolution with the next highest resolution to find the difference and returns that value as the error""" if len(self.res) < 2: return -1 path2 = self.path + '/' + self.res[-2][0] + '/' sim2 = sm.Simulation(path2, self.directory) kick2 = rq.getKick(sim2) error = np.abs(self.kick - kick2) return error
def setSimulation(self): """Sets the simulation with the highest available resolution""" self.new_path = self.path + '/' + self.res[-1][0] + '/' self.simulation = sm.Simulation(self.new_path,self.directory)
def junkError(self): new_path = self.path + '/' + self.res[-1][0] + '/' simulation2 = sm.Simulation(new_path, self.directory, relaxed=True) kick2 = rq.getKick(simulation2) error = np.abs(self.kick - kick2) return error
def getOutermostSimulation(self): """Returns the outermost extraction of the simulation""" return sm.Simulation(self.new_path,'OutermostExtraction.dir')
def getRelaxedTimeSimulation(self): """Returns the simulation with relaxed time to get rid of junk radiation""" return sm.Simulation(self.new_path,self.directory,relaxed = True)
def getSimulation(self): new_path = self.path + '/' + self.res[-1][0] + '/' self.simulation = sm.Simulation(new_path, self.directory)
def getDownsampledSimulation(self): """Downsamples the data by 2 to estimate errors due to numerical routines""" return sm.Simulation(self.new_path,self.directory,relaxed = False, downsample = 2)
def getSecondHighestResolution(self): """Returns the simulation with the 2nd highest resolution. Used for calculating truncation error""" new_path = self.path + '/' + self.res[-2][0] + '/' return sm.Simulation(new_path,self.directory)
def getHighResSim(path, directory): res = sortedResolution(path) new_path = path + '/' + res[-1][0] + '/' simulation1 = sm.Simulation(new_path, directory) return simulation1
def highResKick(path, directory): """Returns the kick using the highest resolution available""" res = sortedResolution(path) new_path = path + '/' + res[-1][0] + '/' simulation = sm.Simulation(new_path, directory) return rq.getKick(simulation)