Closed cindytsai closed 2 years ago
gamer
3D BlastWaveimport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
slc = yt.SlicePlot(ds, "x", ("gas", "density"))
slc.annotate_contour(
("gas", "density"),
ncont=3,
label=True,
plot_args={"color":"blue", "linewidths":2},)
if yt.is_root():
slc.save()
gamer
3D Blast Waveimport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
slc = yt.SlicePlot(ds, "x", ("gas", "density"))
if yt.is_root():
slc.annotate_marker((-0.2, -0.2), coord_system="plot", plot_args={"color":"blue", "s":500})
slc.annotate_text((0.2, 0.2), "3D Blast Wave", coord_system="plot")
slc.annotate_arrow((0.5, 0.5, 0.5), length=0.06, plot_args={"color": "blue"})
slc.annotate_scale()
slc.annotate_timestamp()
slc.annotate_title("3D Blast Wave")
slc.annotate_sphere([0.5, 0.5, 0.5], radius=(0.5, "cm"), circle_args={"color":"red"})
slc.annotate_line((0.3, 0.4), (0.8, 0.9), coord_system="axis")
slc.save()
gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
sz = yt.ProjectionPlot(ds, "z", ("gamer","Dens"), center="c")
ray = ds.ray((0.1, 0.2, 0.3), (0.6, 0.7, 0.8))
if yt.is_root():
sz.annotate_grids()
sz.annotate_cell_edges()
sz.annotate_ray(ray)
sz.save()
gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
slc = yt.SlicePlot(ds, "z", ("gas", "density"))
slc.annotate_streamlines(("gas", "velocity_x"), ("gas", "velocity_y"))
slc.save()
gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.load("Data_000002")
sz = yt.ProjectionPlot(ds, "z", ("gamer","Dens"), center="c")
sz.annotate_quiver(("gas", "velocity_x"), ("gas", "velocity_y"), factor=16, plot_args={"color":"blue"})
sz.save()
gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
slc = yt.SlicePlot(ds, "x", ("gas", "density"))
slc.annotate_velocity(plot_args={"headwidth":4})
slc.save()
gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
slc = yt.OffAxisSlicePlot(ds, [1, 1, 0], [("gas", "density")], center="c")
slc.annotate_cquiver(("gas", "cutting_plane_velocity_x"), ("gas", "cutting_plane_velocity_y"), factor=10, plot_args={"color":"orange"}, )
slc.save()
Output:
SUCCEED in inline-analysis.
Sometimes, there will be some missing figure in the output series of figures.
gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
slc = yt.SlicePlot(ds, "x", ("gas", "density"))
slc.annotate_line_integral_convolution(("gas", "velocity_x"), ("gas", "velocity_y"), lim=(0.5, 0.65))
slc.save()
gamer
MHD VortexInline Script:
import numpy as np
import yt
from yt.data_objects.level_sets.api import Clump, find_clumps
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
data_source = ds.all_data()
c_min = 10 ** np.floor(np.log10(data_source[("gas", "density")]).min())
c_max = 10 ** np.floor(np.log10(data_source[("gas", "density")]).max() + 1)
master_clump = Clump(data_source, ("gas", "density"))
master_clump.add_validator("min_cells", 20)
find_clumps(master_clump, c_min, c_max, 2.0)
leaf_clumps = master_clump.leaves
prj = yt.ProjectionPlot(ds, "z", ("gamer","Dens"), center="c")
prj.annotate_clumps(leaf_clumps)
# Either having this is clause or not, it will still failed when MPI = 3.
if yt.is_root():
prj.save()
class IOHandlerlibyt
.gamer
MHD Vorteximport yt
yt.enable_parallelism()
def yt_inline():
ds = yt.frontends.libyt.libytDataset()
sz = yt.ProjectionPlot(ds, "z", ("gamer","Dens"), center="c")
sz.annotate_magnetic_field(plot_args={"headlength":3})
sz.save()
gamer
Plummerimport yt
yt.enable_parallelism()
def yt_inline_inputArg(field):
ds = yt.frontends.libyt.libytDataset()
field = "Cloud0"
proj = yt.ProjectionPlot(ds, "z", field, center="c")
proj.annotate_particles((3, "cm"))
proj.save()
diff
command say they are differ. But I think they are the same.
Plot Modifications Test
Cookbook Example
annotate_marker
annotate_text
annotate_arrow
annotate_clumps
(failed in odd MPI size, succeed in MPI of even size :x: )annotate_contour
annotate_quiver
annotate_cquiver
annotate_grids
annotate_cell_edges
annotate_streamlines
annotate_velocity
annotate_scale
annotate_timestamp
annotate_ray
annotate_line
annotate_particles
(figure are slightly different in MPI = 1 and MPI > 1 :x: )annotate_halo
annotate_magnetice_field
annotate_sphere
annotate_line_integral_convolution
annotate_title
Should Not Put
save()
and Operation Insideyt.is_root()
Clauseannotate_streamlines
annotate_velocity
annotate_line_integral_convolution
annotate_particles
annotate_quiver
annotate_cquiver
annotate_magnetic_field
Error Message
Failed at Somewhere Else Other than
IOHandlerlibyt
annotate_clumps
(failed in MPI = 3, succeed in MPI = 1, 4)Failed at Opening the Saved Figure
save()
outside of theif yt.is_root()
clause.38