Ejemplo n.º 1
0
def setup_plots(fig, stability=None, zmode=33):
    """Setup plots from a figure."""
    rows = 2 if stability is not None else 1
    MVC = MultiViewController(fig, rows, 3)
    MVC[0,0] = GridView("Temperature", cmap="hot")
    MVC[0,1] = GridView("Vorticity", cmap='Blues')
    MVC[0,2] = GridView("Stream", cmap='Greens')
    if stability is not None:
        MVC[1,0] = EvolutionViewStabilityTest("Temperature", stability, zmode)
        MVC[1,1] = EvolutionViewStabilityTest("Vorticity", stability, zmode)
        MVC[1,2] = EvolutionViewStabilityTest("Stream", stability, zmode)
    return MVC
Ejemplo n.º 2
0
def setup_plots(fig, stability=None, zmode=33):
    """Setup plots from a figure."""
    rows = 4 if stability is not None else 2
    MVC = MultiViewController(fig, rows, 3)
    MVC[0, 0] = GridView("Temperature", cmap="hot")
    MVC[0, 1] = GridView("Vorticity", cmap='Blues')
    MVC[0, 2] = GridView("Stream", cmap='Greens')
    MVC[1, 0] = RawGridView("Temperature", cmap="hot")
    MVC[1, 1] = RawGridView("Vorticity", cmap='Blues')
    MVC[1, 2] = RawGridView("Stream", cmap='Greens')
    if stability is not None:
        MVC[2, 0] = EvolutionViewSingleMode("Temperature", stability, zmode)
        MVC[2, 1] = EvolutionViewSingleMode("Vorticity", stability, zmode)
        MVC[2, 2] = EvolutionViewSingleMode("Stream", stability, zmode)
        MVC[3, 0] = EvolutionViewSingleMode("dTemperature", stability, zmode)
        MVC[3, 1] = EvolutionViewSingleMode("dVorticity", stability, zmode)
        MVC[3, 2] = VProfileView("Temperature", 0)
    return MVC
Ejemplo n.º 3
0
def setup_plots_watch(fig, stability=None, zmode=33):
    """Setup plots from a figure."""
    rows = 5
    MVC = MultiViewController(fig, rows, 3)
    MVC[0, 0] = GridView("Temperature", cmap="hot")
    MVC[0, 1] = GridView("Vorticity", cmap='Blues')
    MVC[0, 2] = GridView("Stream", cmap='Greens')
    MVC[1, 0] = RawGridView("Temperature", cmap="hot")
    MVC[1, 1] = RawGridView("Vorticity", cmap='Blues')
    MVC[1, 2] = RawGridView("Stream", cmap='Greens')
    MVC[2, 0] = VProfileView("Temperature", stability)
    MVC[2, 1] = VProfileView("Vorticity", stability)
    MVC[2, 2] = VProfileView("Stream", stability)
    MVC[3, 0] = V2DProfileView("Temperature", stability)
    MVC[3, 1] = V2DProfileView("Vorticity", stability)
    MVC[3, 2] = V2DProfileView("Stream", stability)
    MVC[4, 0] = V1DProfileView("Temperature", stability)
    MVC[4, 1] = V1DProfileView("Vorticity", stability)
    MVC[4, 2] = V1DProfileView("Stream", stability)
    return MVC
Ejemplo n.º 4
0
        os.path.basename(__file__))[0] if base is None else base
    return os.path.join(directory, base + extension)


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('base', nargs="?", default='linear_op')
    opt = parser.parse_args()
    rcParams['text.usetex'] = False
    ipydb()
    Config = FloxConfiguration.fromfile(filename(".yml", base=opt.base))
    System = NDSystem2D.from_params(Config["system"])
    Writer = HDF5Writer(filename(".hdf5", base=opt.base))
    Writer.read(System, 'main')
    System.it = 1
    print(System)
    print(System.diagnostic_string())
    fig = plt.figure(figsize=(10, 10))
    MVC = MultiViewController(fig, 2, 2)
    MVC[0, 0] = GridView("Temperature")
    MVC[1, 0] = EvolutionViewStabilityTest("Temperature", 1, 33)
    MVC[0, 1] = GridView("Vorticity",
                         cmap='Blues',
                         vmin=-1e-7,
                         vmax=1e-7,
                         norm=SymLogNorm(1e-9),
                         perturbed=True)
    MVC[1, 1] = EvolutionViewStabilityTest("Vorticity", 1, 33)
    MVC.update(System)
    plt.show()
Ejemplo n.º 5
0
def setup_movie(fig, variables=["Temperature"], kwargs=[dict(cmap="hot")]):
    """Setup a movie view."""
    MVC = MultiViewController(fig, len(variables), 1)
    for i, (variable, kwds) in enumerate(zip(variables, kwargs)):
        MVC[i, 0] = GridView(variable, **kwds)
    return MVC
Ejemplo n.º 6
0
    parser.add_argument('-s',
                        '--stability',
                        type=int,
                        help='Show stability plots')
    opt = parser.parse_args()
    rcParams['text.usetex'] = False
    ipydb()
    Config = FloxConfiguration.fromfile(filename(".yml", base=opt.base))
    System = NDSystem2D.from_params(Config["system"])
    Writer = HDF5Writer(filename(".hdf5", base=opt.base))
    Writer.read(System, 'main')
    print(System)
    fig = plt.figure(figsize=(10, 10))
    rows = 2 if opt.stability else 1
    MVC = MultiViewController(fig, rows, 3)
    MVC[0, 0] = GridView("Temperature", perturbed=False)
    MVC[0, 1] = GridView("Vorticity", cmap='Blues')
    MVC[0, 2] = GridView("Stream", cmap='Greens')
    if opt.stability:
        MVC[1, 0] = EvolutionViewStabilityTest("Temperature", opt.stability,
                                               33)
        MVC[1, 1] = EvolutionViewStabilityTest("Vorticity", opt.stability, 33)
        MVC[1, 2] = EvolutionViewStabilityTest("Stream", opt.stability, 33)
    System.it = 2
    MVC.update(System)
    System.infer_iteration()

    def update(i):
        System.it = i
        MVC.update(System)