ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
308 stars 195 forks source link

yt SlicePlot cannot annotate particles in RZ geometry #154

Open MaxThevenet opened 5 years ago

MaxThevenet commented 5 years ago

This input file can be used to run a RZ simulation for beam-driven plasma acceleration. inputs.2d.txt The results can be plotted with

import yt ; yt.funcs.mylog.setLevel(50)
ds = yt.load( './plotfiles/plt00200' ) # Create a dataset object
sl = yt.SlicePlot(ds, 2, 'Ex', aspect=.2) # Create a sliceplot object
sl.set_ylabel(r'$z (\mu m)$') # Set labels y
sl.annotate_grids() # Show grids
sl.annotate_particles(width=(10.e-6, 'm'), p_size=2, ptype='driver', col='black')
# sl.show() # Show the plot
sl.save('img.pdf')

but line sl.annotate_particles(...) gives the following error:

YTPlotCallbackError: annotate_particles callback failed with the following error: Could not find field '('driver', 'particle_position_r')' in plt00100.

though the data seems to be there in plotfiles/plt00100/driver. @atmyers would this require change in yt?

atmyers commented 5 years ago

Can we basically treat "r" as "x" and "z" as "y"?