Re: Fwd: ParticleProjectionPlot error
Cameron, These fields are set for ParticlePlot, not ParticleProjectionPlot. The former function does not take center and width arguments, so I cannot use it. n On 5/24/2018 7:02 PM, Cameron Hummels wrote:
Hi Nick,
I think you need to explicitly set the fields that you're plotting, like ("Stars", "particle_position_x") and so forth. Here is an example:
http://yt-project.org/docs/dev/visualizing/plots.html#particle-plots
You can see what fields are available to plot by looking at the "derived_field_list" hanging off of your dataset:
ds = yt.load("dataset") print(ds.derived_field_list)
Look for particle-based ones that have "particle_position_x" and "particle_position_y" present. I'm not sure the field_types associated with ARTIO.
Hope this helps!
Cameron
On Thu, May 24, 2018 at 3:25 PM, Nick Gnedin
mailto:gnedin@fnal.gov> wrote: Guys,
I get an error trying to use a simple ParticleProjectionPlot on a ARTIO dataset. It looks like ParticleProjectionPlot expect particular names for particle fields that the reader does not create.
imp = yt.ParticleProjectionPlot(d,'z',center=[x0,y0,z0],width=(10,'kpc')) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/particle_plots.py", line 249, in __init__ splat_color=splat_color) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 660, in __init__ PlotWindow.__init__(self, *args, **kwargs) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 219, in __init__ self._setup_plots() File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 748, in _setup_plots self._recreate_frb() File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 272, in _recreate_frb self._frb._get_data_source_fields() File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/fixed_resolution.py", line 646, in _get_data_source_fields self[f] File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/visualization/fixed_resolution.py", line 586, in __getitem__ x_data = self.data_source.dd[ftype, self.x_field] File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/data_objects/data_containers.py", line 282, in __getitem__ self.get_data(f) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/data_objects/data_containers.py", line 1331, in get_data particles, self, self._current_chunk) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/geometry/geometry_handler.py", line 227, in _read_particle_fields fields_to_read) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/utilities/io_handler.py", line 219, in _read_particle_selection for field_r, vals in self._read_particle_fields(chunks, ptf, selector): File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/frontends/artio/io.py", line 63, in _read_particle_fields rv = dict(**subset.fill_particles(fields)) File "/data/gnedin/soft/anaconda3/lib/python3.6/site-packages/yt/frontends/artio/data_structures.py", line 107, in fill_particles count += species_data[i, f].size KeyError: (0, 'POSITION_X') _______________________________________________ yt-users mailing list -- yt-users@python.org mailto:yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org mailto:yt-users-leave@python.org
-- Cameron Hummels NSF Postdoctoral Fellow Department of Astronomy California Institute of Technology http://chummels.org
participants (1)
-
Nick Gnedin