In [ ]:
import yt
from synchrotron.yt_synchrotron_emissivity import StokesFieldName
from particle_filters import *
import matplotlib.pyplot as plt

In [ ]:
ptype = 'lobe'
nu = (150, 'MHz')
ds = yt.load('/d/d5/ychen/2015_production_runs/1022_h1_10Myr/data/MHD_Jet_10Myr_hdf5_plt_cnt_1050', 
             particle_filename='/d/d5/ychen/2015_production_runs/1022_h1_10Myr/data/MHD_Jet_10Myr_hdf5_part_1060_updated' )
ds.add_particle_filter(ptype) 
stokes = StokesFieldName(ptype, nu, 'x', field_type='flash')
#res = ds.domain_dimensions[1:]*ds.refine_by**ds.index.max_level//zoom_fac//2
kpc = yt.units.kpc

In [ ]:
cmap = plt.cm.jet
cmap.set_bad('navy')
plot = yt.SlicePlot(ds, 'x', stokes.I, center=ds.arr([0,0,0], input_units='kpc'), width=[(75, 'kpc'), (150, 'kpc')])
plot.set_cmap(stokes.I, cmap)
plot.set_log(stokes.I, True)
plot.set_zlim(stokes.I, 1E-28, 1E-20)
plot.set_buff_size((800,1600))
plot.set_axes_unit('kpc')

In [ ]:
ds = yt.load('/d/d5/ychen/2015_production_runs/0529_h1_00/data/MHD_Jet_hdf5_plt_cnt_0100',
            particle_filename='/d/d5/ychen/2015_production_runs/0529_h1_00/data/MHD_Jet_hdf5_part_0100_updated')
#ds.add_particle_filter(ptype) 
plot = yt.SlicePlot(ds, 'x', 'density', center=ds.arr([0,0,0], input_units='kpc'), width=[(20, 'kpc'), (40, 'kpc')])
#plot.annotate_clear()
plot.annotate_grids()#, draw_ids=True)
#plot.annotate_particles(p_size=4, width=(10, 'kpc'), ptype='lobe')
#plot.annotate_cell_edges(alpha=0.1)
plot.show()

In [ ]:


In [ ]:
ds.all_data()[stokes.I].min()

In [ ]:
import yt
from synchrotron.yt_synchrotron_emissivity import add_synchrotron_dtau_emissivity, StokesFieldName
ptype = 'lobe'
nu = (150, 'MHz')
ds_flash = yt.load('/home/ychen/data/0only_0529_h1/MHD_Jet_hdf5_plt_cnt_0600', 
             particle_filename='/home/ychen/data/0only_0529_h1/MHD_Jet_hdf5_part_0600_updated' ) 
stokesd = StokesFieldName(ptype, nu, 'x')
add_synchrotron_dtau_emissivity(ds_flash, ptype=ptype, nu=nu, proj_axis='x', extend_cells=32)