[yt-users] Over plot particles

Casey W. Stark caseywstark at gmail.com
Thu May 24 16:01:51 PDT 2012


Hi Remudin.

You need to add "particles.write_in_plotfi le = 1" to your inputs file to
write out particle data. That might solve your problem, but I haven't tried
using particle data from yt in some time. Please let us know if it doesn't
work and we can try to fix it.

Best,
Casey


On Thu, May 24, 2012 at 2:43 PM, REMUDIN RESHID MEKURIA
<remudin at yahoo.com>wrote:

> Dear Matt,
>
> Yes, I think looking into it from that perspective sounds as a good
> alternative.
> Thank you very much, that is really helpful. I will investigate more and
> let you know.
>
> Cheers,
>
> Remudin
>
>
>
> On 2012 Cam 24, at 23:28, Matthew Turk wrote:
>
> Hi Remudin,
>
> My understanding of the way Nyx works is that to get the original
> positions of the particles out, you have to have that parameter set.
> (If this has changed, I am unaware of it.)  *However*, you do still
> have the particle fluid information, post-deposition into grid cells
> -- this means that while you may not be able to do the particle
> overplotting, you can for instance plot slices and projections of the
> deposited particle values.  In the field list below, you can see the
> fields that might be of interest: particle_count and
> particle_mass_density.  Slicing or projecting those quantities should
> give you an idea what the particles look like.  I do recall that
> earlier versions of Nyx output only ASCII positions for particles, but
> I seem to recall that we made the decision only to support the binary
> output of particles.  (Casey, does that sound familiar to you?)
>
> If there's been a change in how the outputting of particles is
> governed, we'd be more than happy to update the Nyx frontend code in
> yt!
>
> -Matt
>
> On Fri, May 25, 2012 at 6:04 AM, REMUDIN RESHID MEKURIA
> <remudin at yahoo.com> wrote:
>
>
> Dear Matt, Casey,
>
>
> In the list of field, I do not have any of the particle positions, I am not
>
> sure if I need to.  But these is the result of your quick test:
>
>
> print pf.h.field_list   ['density', 'xmom', 'ymom', 'zmom', 'rho_E',
>
> 'rho_e', 'rho_K', 'Temp', 'rho_H', 'rho_He', 'phi_grav', 'grav_x',
> 'grav_y',
>
> 'grav_z', 'prod_sgs', 'diss_sgs', 'turb_src', 'pressure', 'MachNumber',
>
> 'magvort', 'particle_count', 'particle_mass_density']
>
>
> print pf.use_particles           False
>
>
>
> Ok, I haven't seen some thing like "particles.write_in_plotfile" in inputs.
>
> I have attached the inputs
>
>
> I used  here within.
>
>
> Thank you again for taking much of your time.
>
>
>
> Cheers,
>
>
> Remudin
>
>
> On 2012 Cam 24, at 22:40, Matthew Turk wrote:
>
>
> Hi Remudin,
>
>
> Ah, bummer.  Revisiting what Casey said, it sounds like you're trying
>
> to plot and it doesn't know that there are particles.  What is the
>
> output of these commands:
>
>
> print pf.h.field_list
>
> print pf.use_particles
>
>
> And, can you check the inputs file to see what the value of
>
> "particles.write_in_plotfile" is?  That parameter dictates (for Nyx)
>
> whether particles are written out in the plotfiles, and without it yt
>
> cannot read them.
>
>
> -Matt
>
>
> On Fri, May 25, 2012 at 5:36 AM, REMUDIN RESHID MEKURIA
>
> <remudin at yahoo.com> wrote:
>
>
> Dear Matt,
>
>
>
> I have included the changes in the script and the error doesn't
>
>
> change. KeyError: 'particle_position_y'.
>
>
>
> Right, it will be of great simplification when those Units are clarified in
>
>
> the recipes by you guys soon, thanks.
>
>
>
>
> Cheers,
>
>
>
> Remudin
>
>
>
> On 2012 Cam 24, at 22:15, Matthew Turk wrote:
>
>
>
> Hi Remudin,
>
>
>
> The units between Enzo and Nyx are different -- and to get the recipe
>
>
> to reflect that there are a few places that have to be modified.  In
>
>
> response to the community survey results that came in, just yesterday
>
>
> (coincidentally enough) Britton Smith and I have been going through
>
>
> trying to make changes to the recipes to de-enzo-ify them and to make
>
>
> it more clear what are units and what aren't.
>
>
>
> I'm not sure this will fix the problem, but it might help!
>
>
>
> On Fri, May 25, 2012 at 5:08 AM, REMUDIN RESHID MEKURIA
>
>
> <remudin at yahoo.com> wrote:
>
>
>
> Thanks Casey,
>
>
>
>
> This is the script I used from yt-cookbook Overplot particles
>
>
>
>
> #!/usr/users/rmekuri/data/yt-x86_64/bin/python
>
>
>
>
>
> from yt.mods import * # set up our namespace
>
>
>
>
>
>
> fn = "plt00736" # parameter file to load
>
>
>
>
>
>
> pf = load(fn) # load data
>
>
>
>
>
> pc = PlotCollection(pf, [0.5, 0.5, 0.5])
>
>
>
>
> Try changing [0.5, 0.5, 0.5] to "c" like this:
>
>
>
> pc = PlotCollection(pf, "c")
>
>
>
> this will put you at the domain center.
>
>
>
> p = pc.add_projection("Density", 0)
>
>
>
> p.modify["particles"](1.0) # 1.0 is the 'width' we want for our slab of
>
>
>
>
> try changing this 1.0 to the full domain:
>
>
>
> 1.0/pf['unitary']
>
>
>
> 'unitary' is the unit meaning the full width of the domain.
>
>
>
>
>
>                             # particles -- this governs the allowable
>
>
>
> locations
>
>
>
>
>                             # of particles that show up on the image
>
>
>
>
>
>                             # NOTE: we can also supply a *ptype* to cut
>
>
>
> based
>
>
>
>
>                             # on a given (integer) particle type
>
>
>
>
>
> pc.set_width(1.0, '1') # change width of our plot to the full domain
>
>
>
>
> Let's set this also to the full domain:
>
>
>
> pc.set_width(1.0, 'unitary')
>
>
>
>
> -Matt
>
>
>
>
>
> pc.save(fn) # save all plots
>
>
>
>
> Cheers,
>
>
>
>
> Remudin
>
>
>
>
>
> On 2012 Cam 24, at 22:03, Casey W. Stark wrote:
>
>
>
>
> Hi Remudin.
>
>
>
>
> Could you include the script that is generating the error?
>
>
>
>
> I'm not sure without the script, but it looks like you are trying to access
>
>
>
> the "particle_position_y" field and it is not in the plotfile you are
>
>
>
> working with.
>
>
>
>
> Best,
>
>
>
> Casey
>
>
>
>
>
> On Thu, May 24, 2012 at 11:15 AM, REMUDIN RESHID MEKURIA <
> remudin at yahoo.com>
>
>
>
> wrote:
>
>
>
>
> Dear all,
>
>
>
>
> Thank you for your help in advance.
>
>
>
> I am currently running cosmological simulations using Nyx code.
>
>
>
> And while trying to over plotting particles on the density slice, I
>
>
>
> encountered the following error which I couldn't resolve. I will greatly
>
>
>
> appreciate your help.
>
>
>
>
> Traceback (most recent call last):
>
>
>
>   File "./OverPlotingParticles.py", line 14, in <module>
>
>
>
>     pc.set_width(1.0, '1') # change width of our plot to the full domain
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py",
>
>
>
> line 267, in set_width
>
>
>
>     plot.set_width(width, unit)
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
>
>
>
> line 441, in set_width
>
>
>
>     self._refresh_display_width()
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
>
>
>
> line 459, in _refresh_display_width
>
>
>
>     self._redraw_image()
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
>
>
>
> line 406, in _redraw_image
>
>
>
>     self._run_callbacks()
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
>
>
>
> line 259, in _run_callbacks
>
>
>
>     cb(self)
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/visualization/plot_modifications.py",
>
>
>
> line 985, in __call__
>
>
>
>     &   ( reg[field_y] >= y0 ) & ( reg[field_y] <= y1 ) )
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
>
>
>
> line 319, in __getitem__
>
>
>
>     self.get_data(key)
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
>
>
>
> line 2410, in get_data
>
>
>
>     if self._generate_field(field):
>
>
>
>   File
>
>
>
>
> "/home/uni06/cosmo/rmekuri/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
>
>
>
> line 352, in _generate_field
>
>
>
>     raise KeyError(field)
>
>
>
> KeyError: 'particle_position_y'
>
>
>
>
> With best regards,
>
>
>
>
>
> Cheers,
>
>
>
>
> Remudin
>
>
>
>
> ------
>
>
>
>
> Remudin Reshid Mekuria                              phone: +49 (0)551
>
>
>
> 39-13805
>
>
>
>
> IAG, Friedrich-Hund-Plaz 1                           fax: +49 (0)551
>
>
>
> 39-5043
>
>
>
>
> D-37077 Goettingen
>
>
>
>
> Germany
>
>
>
>
>
>
>
>
> _______________________________________________
>
>
>
> yt-users mailing list
>
>
>
> yt-users at lists.spacepope.org
>
>
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
>
>
> _______________________________________________
>
>
>
> yt-users mailing list
>
>
>
> yt-users at lists.spacepope.org
>
>
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
>
>
> ------
>
>
>
>
> Remudin Reshid Mekuria                              phone: +49 (0)551
>
>
>
> 39-13805
>
>
>
>
> IAG, Friedrich-Hund-Plaz 1                           fax: +49 (0)551
> 39-5043
>
>
>
>
> D-37077 Goettingen
>
>
>
>
> Germany
>
>
>
>
>
>
>
>
> _______________________________________________
>
>
>
> yt-users mailing list
>
>
>
> yt-users at lists.spacepope.org
>
>
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
>
> _______________________________________________
>
>
> yt-users mailing list
>
>
> yt-users at lists.spacepope.org
>
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
>
> ------
>
>
>
> Remudin Reshid Mekuria                              phone: +49 (0)551
>
>
> 39-13805
>
>
>
> IAG, Friedrich-Hund-Plaz 1                           fax: +49 (0)551
> 39-5043
>
>
>
> D-37077 Goettingen
>
>
>
> Germany
>
>
>
>
>
>
>
> _______________________________________________
>
>
> yt-users mailing list
>
>
> yt-users at lists.spacepope.org
>
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
> _______________________________________________
>
> yt-users mailing list
>
> yt-users at lists.spacepope.org
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
> ------
>
>
> Remudin Reshid Mekuria                              phone: +49 (0)551
>
> 39-13805
>
>
> IAG, Friedrich-Hund-Plaz 1                           fax: +49 (0)551
> 39-5043
>
>
> D-37077 Goettingen
>
>
> Germany
>
>
>
>
>
>
> _______________________________________________
>
> yt-users mailing list
>
> yt-users at lists.spacepope.org
>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>  ------
>
> Remudin Reshid Mekuria                              phone: +49 (0)551
> 39-13805
>
> IAG, Friedrich-Hund-Plaz 1                           fax: +49 (0)551
> 39-5043
>
> D-37077 Goettingen
>
> Germany
>
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120524/7fdb242b/attachment.html>


More information about the yt-users mailing list