4 from matplotlib
import pyplot
as plt
6 import matplotlib
as mpl
8 mpl.rcParams[
"svg.fonttype"] =
"none" 9 mpl.rcParams[
"font.size"] = 16
11 mpl.rcParams[
"savefig.directory"] =
"../../Figures" 14 mpl.rc(
'font', **{
'family':
'serif',
'serif': [
'Computer Modern']})
15 mpl.rc(
'text', usetex=
True)
20 from yaml
import CLoader
as Loader, CDumper
as Dumper
22 from yaml
import Loader, Dumper
25 def __init__(self, run_name = "", numeric_method = "_midpoint_"):
30 self.
results_path = os.path.dirname(os.path.realpath(__file__)) +
"/../../../results/" 32 results_folder =
"/results/" 34 stream = open(self.
results_path + run_name +
"/doc/yaml/parameters.yaml",
'r') 39 self.
block_position = np.loadtxt(self.
results_path + run_name + results_folder + shared_names + numeric_method +
"block_position.csv", delimiter=
",")
41 self.
block_velocity = np.loadtxt(self.
results_path + run_name + results_folder + shared_names + numeric_method +
"block_velocity.csv", delimiter=
",")
43 self.
pad_position = np.loadtxt(self.
results_path + run_name + results_folder + shared_names + numeric_method +
"pad_position.csv", delimiter =
',')
44 self.
pad_velocity = np.loadtxt(self.
results_path + run_name + results_folder + shared_names + numeric_method +
"pad_velocity.csv", delimiter =
',')
56 self.
x = np.linspace(start = start, stop = stop, num = len(self.
block_position[0]))
61 return( (1.0/np.sqrt(2*np.pi*np.square(sigma))) * np.exp(-np.square(self.
x - mu)/(2*np.square(sigma))) )
65 fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, sharex=
True)
114 if(len(sys.argv) > 2):
116 elif(len(sys.argv) == 2):
120 example.example_plot()
121 example.plot_blocks_position()
122 example.plot_pad_position()
123 example.plot_blocks_position_vers_velocity()
125 if __name__ ==
"__main__":
def plot_pad_position(self)
def __init__(self, run_name="", numeric_method="_midpoint_")
def example_function(self)
def loadFiles(self, run_name, numeric_method)
def plot_blocks_position_vers_velocity(self)
def plot_blocks_position(self)