예제 #1
0
 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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
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
예제 #5
0
    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
예제 #6
0
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
예제 #7
0
 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
예제 #8
0
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
예제 #9
0
    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
예제 #10
0
	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)
예제 #11
0
 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
예제 #12
0
	def getOutermostSimulation(self):
		"""Returns the outermost extraction of the simulation"""
		return sm.Simulation(self.new_path,'OutermostExtraction.dir')
예제 #13
0
	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)
예제 #14
0
 def getSimulation(self):
     new_path = self.path + '/' + self.res[-1][0] + '/'
     self.simulation = sm.Simulation(new_path, self.directory)
예제 #15
0
	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)
예제 #16
0
	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)	
예제 #17
0
def getHighResSim(path, directory):
    res = sortedResolution(path)
    new_path = path + '/' + res[-1][0] + '/'
    simulation1 = sm.Simulation(new_path, directory)
    return simulation1
예제 #18
0
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)