def getFiles(self): # For each file, determine the appendix and use interactivePlot to # gather the data for i, serfile in enumerate(glob(fromSpyder+"../TestData/Serial/Conserved/*")): ext = serfile.find('.dat') app = serfile.find('Conserved/cons') + len('Conserved.cons') appendix = serfile[app:ext] self.Appendicies.append(appendix) print("Fetching {} data...".format(appendix)) with HidePrints(): self.Serials.append(Plot(fromSpyder+"../TestData/Serial/", appendix)) self.Parallels.append(Plot(fromSpyder+"../TestData/Parallel/", appendix)) self.Ncons.append(self.Serials[i].c['Ncons']) self.Nprims.append(self.Serials[i].c['Nprims']) self.Naux.append(self.Serials[i].c['Naux']) self.Nx.append(self.Serials[i].c['Nx']) self.Ny.append(self.Serials[i].c['Ny']) self.Nz.append(self.Serials[i].c['Nz']) self.Ng.append(self.Serials[i].c['Ng']) self.xbounds.append((self.Ng[-1], self.Nx[-1] - self.Ng[-1])) if (self.Ny[-1] > 1): self.ybounds.append((self.Ng[-1], self.Ny[-1] - self.Ng[-1])) else: self.ybounds.append((0, 1)) if (self.Nz[-1] > 1): self.zbounds.append((self.Ng[-1], self.Nz[-1] - self.Ng[-1])) else: self.zbounds.append((0, 1))
def __init__(self, DataDir=None): if DataDir == None: self.DataDirectory = UsualDirectory else: self.DataDirectory = DataDir with open(self.DataDirectory + 'info') as f: for var in f.readlines(): self.variables.append(var) self.final = Plot(self.DataDirectory + '../../Final/') self._gatherData()
def __init__(self, DataDir=None): if DataDir == None: self.DataDirectory = UsualDirectory else: self.DataDirectory = DataDir with open(self.DataDirectory + 'info') as f: for var in f.readlines(): self.variables.append(var) self.final = Plot(self.DataDirectory + '../../Final/', states=False) self.Nframes = len( glob(self.DataDirectory + self.variables[0][:-1] + '*')) self.t = [] self.frame = np.zeros([self.final.c['nx'], self.final.c['ny']])
# \____Final/ # where final is the normal directory saved by the 'saveData' class. # Change this as directed above... root = None if root is None: root = '/media/alex/My Passport/DataToKeep/BigIriData/' + \ 'REGIMETesting/AllData/MagReconnectionPaper' sigs = ['100', '250', '500', '750', '1000'] if 'ideal' not in locals(): print(f"Getting ideal...") with HidePrints(): ideal = Plot(root + '/SRMHD/Final/') if 'resistives' not in locals(): resistives = [] REGIMEs = [] for sig in sigs: print(f"Getting sig = {sig}...") with HidePrints(): resistives.append(Plot(root + '/REGIME/Sig' + sig + '/Final/')) REGIMEs.append(Plot(root + '/SRRMHD/Sig' + sig + '/Final/')) ############################################################################### ################## Plot the final state of the pressure ####################### ############################################################################### if True: fig = plt.figure(figsize=(4 * 3, 6))