def p9figs(event=None, filedir='.', topdir=None, idl=False, isinteractive=True): import p9figs as p9 #reload(p9) #global numevents, nummodels, isinteractive if event == None: event = p7Restore(filedir, topdir, idl) cwd = os.getcwd().split("/") if cwd[-1] == event[0].modeldir: os.chdir('..') printout = printoutput.init(event[0].params.printout, event) numevents = len(event) nummodels = np.zeros(numevents, dtype=int) for j in range(numevents): nummodels[j] = len(event[j].params.model) for j in range(numevents): print("\n" + event[j].eventname, file=printout) for i in range(nummodels.min()): print("\nCurrent model = " + str(event[j].params.model[i]), file=printout) p9.figs(event[j], i, j * nummodels.min() + i) printoutput.close(printout) if isinteractive == False: plt.close('all') else: plt.show() return
def p9figs(events=None, directory='./', idl=False, titles=True, isinteractive=isinteractive): if events == None: events = p7Restore(directory, idl) nummodels = np.array([len(event.params.model) for event in events], dtype=int) printout = po.init(events[0].params.printout, events) for j, event in enumerate(events): print("\n" + event.eventname, file=printout) nummin = nummodels.min() for i in range(nummin): print("\nCurrent model = " + str(event.params.model[i]), file=printout) p9.figs (event, i, j*nummin+i, titles=titles) po.close(printout) if isinteractive == False: plt.close('all') else: plt.show() return