Esempio n. 1
0
    #loop = TLM.loops['u302']
    loop = new_looper
    tracks_read_write.save_loop_only_trackage(loop, 'TRACKAGE_TEST.h5')

if 0:
    import tracks_read_write
    reload(tracks_read_write)

    test_file = 'TRACKAGE_TEST_CORE14.h5'
    savefile = 'TRACKAGE_TEST.h5'
    savefile = 'u302_tracks_only_c0-20.h5'
    savefile = 'u302_zero_test_tracks_only.h5'
    savefile = "u302_zero_test_tracks_only.h5"
    #ktracks_read_write.load_loop_only_trackage( loop, )
    loop3 = looper.core_looper(directory=dl.sims['u302'],
                               savefile_only_trackage=savefile)

if 1:

    mt1 = mass_tools.mass_tool(new_looper)
    mt1.run()

if 1:
    reload(mass_tools)
    fig, ax = plt.subplots(1, 1)
    mass_tools.plot_mass_tracks(mt1, ax)
    ax.plot([0, 1], [0, 1])
    fig.savefig('plots_to_sort/%s_mass_test_read_test.png' % "U302_c0014")

    plt.close(fig)
Esempio n. 2
0
if 0:
    import tracks_read_write
    reload(tracks_read_write)

    savefile = 'TRACKAGE_TEST.h5'
    loop = looper.core_looper(directory=dl.sims['u302'],
                              savefile_only_trackage=savefile)

    mt1 = mass_tools.mass_tool(loop)
    mt1.run(core_list=[14])

if 0:
    reload(mass_tools)
    fig, ax = plt.subplots(1, 1)
    mass_tools.plot_mass_tracks(mt1, ax)
    fig.savefig('plots_to_sort/%s_mass_test_read_test.png' %
                mt1.this_looper.out_prefix)
    plt.close(fig)

if 1:
    import three_loopers_mountain_top as TLM
    reload(TLM)
if 0:
    mt1 = mass_tools.mass_tool(TLM.loops['u301'])
    mt1.run()
if 1:
    fig, ax = plt.subplots(1, 1)
    mass_tools.plot_mass_tracks(mt1, ax)
    fig.savefig('plots_to_sort/u301_mass_time.png')
if 0:
Esempio n. 3
0
        density_cmap = rainbow_map(np.log10(density)[:, 0].max())
        mass_ratio = 1
        big_core = 0
        core_list = []
        for nc, core_id in enumerate(mt.cores_used):
            ax[0][0].plot(mt.times, mt.volume[core_id], c=[0.5] * 4)
            #c=density_cmap( np.log10(mt.mean_rho[core_id][0]))
            c = color_map.to_rgba(np.log10(density[nc, n0]))
            Y2 = mt.mean_rho[core_id]  #/nar(mt.mean_rho[core_id])[0:2].mean()
            ax[0][1].plot(mt.times, Y2, c=c)  #[0.5]*4)

            M = mt.unique_mass[
                core_id]  #/nar(mt.unique_mass[core_id])[:6].mean()
            Mbar = mt.unique_mass[core_id] / nar(
                mt.unique_mass[core_id])[:6].mean()
            this_ratio = Mbar.max() / Mbar.min()
            if Mbar.min() < 0.1:
                core_list.append(nc)

            ax[1][0].plot(mt.times, M)
        mass_tools.plot_mass_tracks(mt, ax[1][1], core_list=core_list)

        #ax[1].plot([mt.times[0], mt.times[-1]], [Y2[0],Y2[-1]],c=c)#[0.5]*4)
        #ax[1].plot(mt.times, mt.mean_rho_w[core_id],c=[0.5]*4)

        axbonk(ax[1][0], xlabel='t', ylabel='M', yscale='log')
        axbonk(ax[0][1], xlabel='t', ylabel='rho', yscale='log')
        axbonk(ax[0][0], xlabel='t', ylabel='V', yscale='log')
        fig.savefig('plots_to_sort/%s_meansies.pdf' % this_simname)
        plt.close(fig)
Esempio n. 4
0

if 0:
    import tracks_read_write
    reload(tracks_read_write)

    savefile = 'TRACKAGE_TEST.h5'
    loop = looper.core_looper(directory= dl.sims['u302'],savefile_only_trackage=savefile)

    mt1 = mass_tools.mass_tool(loop)
    mt1.run(core_list = [14])

if 0:
    reload(mass_tools)
    fig,ax=plt.subplots(1,1)
    mass_tools.plot_mass_tracks(mt1,ax)
    fig.savefig('plots_to_sort/%s_mass_test_read_test.png'%mt1.this_looper.out_prefix)
    plt.close(fig)

if 0:
    import three_loopers_mountain_top as TLM
    reload(TLM)
if 0:
    mt_dict={}
    for this_simname in ['u301','u302','u303']:

        mt_dict[this_simname] = mass_tools.mass_tool(TLM.loops[this_simname])
        mt_dict[this_simname].run()
if 0:
    for this_simname in ['u301','u302','u303']:
        fig,ax = plt.subplots(1,1)
Esempio n. 5
0
import data_locations as dl
from collections import defaultdict

import davetools

reload(davetools)
import mass_tools

reload(mass_tools)
import looper2

plt.close('all')

sim_list = ['u501']
if 'u501' not in these_loops:
    these_loops = {}
    print('read u501')
    these_loops['u501'] = looper2.load_looper('u501_all_frame_all_prim.h5')

if 'mtd' not in dir():
    mtd = {}
for this_simname in sim_list:
    if this_simname not in mtd:
        mtd[this_simname] = mass_tools.mass_tool(these_loops[this_simname])
        mtd[this_simname].run()

for this_simname in sim_list:
    fig, ax = plt.subplots(1, 1)
    mass_tools.plot_mass_tracks(mtd[this_simname], ax)
    fig.savefig('plots_to_sort/thing.pdf')