<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 9:14 AM, Max Gronke <span dir="ltr"><<a href="mailto:max.gronke@astro.uio.no" target="_blank">max.gronke@astro.uio.no</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nathan!<br>
<br>
Thanks for the reply. This is a MWE to my problem:<br>
<a href="http://paste.yt-project.org/show/6027/" rel="noreferrer" target="_blank">http://paste.yt-project.org/show/6027/</a></blockquote><div><br></div><div>OK, I'll try to take a look at this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
About the error I was getting when I tried to use Bili Dong's feature<br>
for convenience (as far as I can see it does the same to create a<br>
volume weighted field as I do): Probably this was because I was doing<br>
a mistake in checking out the other yt head (f264885 instead of<br>
9f560b7).<br></blockquote><div><br></div><div>Yup, you want to be on the head with the "development" bookmark (To update to it and deactivate the bookmark, do: "hg update development" then "hg bookmark -i development")</div><div><br></div><div>-Nathan</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best,<br>
Max<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 6 November 2015 at 14:34, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>> wrote:<br>
><br>
><br>
> On Thursday, November 5, 2015, Max Gronke <<a href="mailto:max.gronke@astro.uio.no">max.gronke@astro.uio.no</a>> wrote:<br>
>><br>
>> Hi Nathan & all!<br>
>><br>
>> Sorry for digging up this old topic again (wasn't sure if I should<br>
>> open another thread or this is fine).<br>
>> Although I didn't manage to compile the head of yt where Bili Dong's<br>
>> pull request is included properly, I succeeded in adding a<br>
>> volume_weighted_smoothed_field as he did.<br>
>><br>
>><br>
>><br>
><br>
> Can you share the compilation error you ran into? It's a big problem if<br>
> people are unable to compile the latest development version of yt.<br>
><br>
>><br>
>>  (with<br>
>> > fn_smooth =<br>
>> > add_volume_weighted_smoothed_field("all","particle_position",<br>
>> > "particle_mass", "smoothing_length",<br>
>> >                                                "particle_density",<br>
>> > "particle_density", ds.field_info, 64)[0]<br>
>> )<br>
>> Afterwards I can also access the data through<br>
>> > ad = ds.all_data()<br>
>> > ad[fn_smooth]<br>
>><br>
>> but I cannot create a covering grid using the newly created field:<br>
>> > ds.covering_grid(level, left_edge=ds.domain_left_edge, dims = dims,<br>
>> >                            fields=[fn_smooth])<br>
>> fails with the error message<br>
>> > YTFieldNotFound: Could not find field '('deposit',<br>
>> > 'all_smoothed_particle_density')' in ParticleData.<br>
>><br>
>> The reason seems to be that `fn_smooth` is in "ds.field_info" but not<br>
>> in " ds.derived_field_list".<br>
>><br>
>> Maybe the my whole ansatz is also wrong? All I want to achieve is to<br>
>> obtain a covering grid which used the SPH kernels of the particles and<br>
>> I follow roughly your code in the "Gadget" frontend.<br>
><br>
><br>
> Can you create a test script that produces your error? That way one of us<br>
> can read run the script locally and try to debug. If you can make the test<br>
> script use of one of the test Gadget datasets on <a href="http://yt-project.org/data" rel="noreferrer" target="_blank">yt-project.org/data</a>, that<br>
> would also make it easier for one of us to reproduce your error.<br>
><br>
> You can use <a href="http://paste.yt-project.org" rel="noreferrer" target="_blank">paste.yt-project.org</a> to share your full compilation error and<br>
> test script without needing to paste them into an e-mail.<br>
><br>
> Best<br>
><br>
> Nathan<br>
><br>
>><br>
>><br>
>> Thanks again for your help,<br>
>> Max<br>
>><br>
>><br>
>> On 6 October 2015 at 17:29, Max Grönke <<a href="mailto:maxbg@astro.uio.no">maxbg@astro.uio.no</a>> wrote:<br>
>> > Thanks!<br>
>> ><br>
>> > For the moment we found a workaround (generic sph --> gadget) but for<br>
>> > the future this might come handy.<br>
>> ><br>
>> > Best,<br>
>> > Max<br>
>> ><br>
>> > On 6 October 2015 at 17:14, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
>> > wrote:<br>
>> >> Hi Max,<br>
>> >><br>
>> >> This actually related to a new feature Bili Dong recently added:<br>
>> >><br>
>> >><br>
>> >> <a href="https://bitbucket.org/yt_analysis/yt/pull-requests/1769/add-add_smoothed_particle_field/diff" rel="noreferrer" target="_blank">https://bitbucket.org/yt_analysis/yt/pull-requests/1769/add-add_smoothed_particle_field/diff</a><br>
>> >><br>
>> >> This PR adds new functionality to make it easier to define SPH smoothed<br>
>> >> fields. Maybe that will help?<br>
>> >><br>
>> >> -Nathan<br>
>> >><br>
>> >> On Tue, Oct 6, 2015 at 1:48 AM, Max Grönke <<a href="mailto:max.gronke@astro.uio.no">max.gronke@astro.uio.no</a>><br>
>> >> wrote:<br>
>> >>><br>
>> >>> Hi Nathan.<br>
>> >>> Thanks for your reply. Here's the new link:<br>
>> >>> <a href="http://paste.yt-project.org/show/5930/" rel="noreferrer" target="_blank">http://paste.yt-project.org/show/5930/</a><br>
>> >>><br>
>> >>> I think I figured out the problem -- at least in theory ;)  I guess<br>
>> >>> what I need is a "smoothed field". This meant I played around with<br>
>> >>> "add_volume_weighted_smoothed_field". But although<br>
>> >>><br>
>> >>> > fn_smooth =<br>
>> >>> > add_volume_weighted_smoothed_field("all","particle_position",<br>
>> >>> > "particle_mass", "smoothing_length",<br>
>> >>> >                                               "particle_density",<br>
>> >>> > "particle_density", ds.field_info, 64)<br>
>> >>><br>
>> >>> (where `ds' is my YT Particle Data Set)<br>
>> >>><br>
>> >>> seems to work, I cannot access the newly created field?<br>
>> >>> ("YTFieldNotFound: Could not find field '('deposit',<br>
>> >>> 'all_smoothed_particle_density')' in ParticleData.")<br>
>> >>><br>
>> >>> Thanks for your help,<br>
>> >>> Max<br>
>> >>><br>
>> >>><br>
>> >>> On 5 October 2015 at 17:41, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
>> >>> wrote:<br>
>> >>> > Hi Max,<br>
>> >>> ><br>
>> >>> > I'm unable to load the pastebin link in your e-mail.  Can you<br>
>> >>> > re-send<br>
>> >>> > using<br>
>> >>> > a different pastebin service? We have <a href="http://paste.yt-project.org" rel="noreferrer" target="_blank">paste.yt-project.org</a> set up<br>
>> >>> > for<br>
>> >>> > this<br>
>> >>> > purpose.<br>
>> >>> ><br>
>> >>> > Matt also has an open pull request that among other things adds<br>
>> >>> > support<br>
>> >>> > to<br>
>> >>> > arbitrary_grid for fluid fields:<br>
>> >>> ><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > <a href="https://bitbucket.org/yt_analysis/yt/pull-requests/1763/numpy-like-operations/diff" rel="noreferrer" target="_blank">https://bitbucket.org/yt_analysis/yt/pull-requests/1763/numpy-like-operations/diff</a><br>
>> >>> ><br>
>> >>> > -Nathan<br>
>> >>> ><br>
>> >>> > On Fri, Oct 2, 2015 at 10:23 AM, Max Grönke<br>
>> >>> > <<a href="mailto:max.gronke@astro.uio.no">max.gronke@astro.uio.no</a>><br>
>> >>> > wrote:<br>
>> >>> >><br>
>> >>> >> Hi Matthew,<br>
>> >>> >><br>
>> >>> >> thanks for your prompt response!<br>
>> >>> >><br>
>> >>> >> I tried the covering_grid first but as I said we had problems with<br>
>> >>> >> a<br>
>> >>> >> lot of zero-valued grid points. It seems the values from the<br>
>> >>> >> coarser<br>
>> >>> >> grid are not duplicated downwards?<br>
>> >>> >> I tried to post a MWE to illustrate what I mean:<br>
>> >>> >> <a href="http://pastebin.com/yishxbjW" rel="noreferrer" target="_blank">http://pastebin.com/yishxbjW</a><br>
>> >>> >><br>
>> >>> >> For the arbitrary_grid: It says it cannot deal with fluid<br>
>> >>> >> variables?<br>
>> >>> >><br>
>> >>> >> Best,<br>
>> >>> >> Max<br>
>> >>> >><br>
>> >>> >> On 2 October 2015 at 16:44, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>><br>
>> >>> >> wrote:<br>
>> >>> >> > Hi Max,<br>
>> >>> >> ><br>
>> >>> >> > Ah, I think I see the problem.  If you're doing any type of<br>
>> >>> >> > particle<br>
>> >>> >> > deposition, including smoothing, you might be better suited to<br>
>> >>> >> > using<br>
>> >>> >> > the arbitrary_grid or the covering_grid objects, as<br>
>> >>> >> > smoothed_covering_grid is designed for situations where values<br>
>> >>> >> > need<br>
>> >>> >> > to<br>
>> >>> >> > be interpolated through a cascade of refinements.  It'd probably<br>
>> >>> >> > end<br>
>> >>> >> > up being faster to use either arbitrary_grid or covering_grid,<br>
>> >>> >> > too.<br>
>> >>> >> > Can you try that and let us know if it meets your needs?<br>
>> >>> >> ><br>
>> >>> >> > -Matt<br>
>> >>> >> ><br>
>> >>> >> > On Fri, Oct 2, 2015 at 9:42 AM, Max Grönke<br>
>> >>> >> > <<a href="mailto:max.gronke@astro.uio.no">max.gronke@astro.uio.no</a>><br>
>> >>> >> > wrote:<br>
>> >>> >> >> Hi everybody!<br>
>> >>> >> >><br>
>> >>> >> >> I followed loosely the example provided here<br>
>> >>> >> >><br>
>> >>> >> >><br>
>> >>> >> >><br>
>> >>> >> >> <a href="http://yt-project.org/docs/dev/examining/low_level_inspection.html#examining-grid-data-in-a-fixed-resolution-array" rel="noreferrer" target="_blank">http://yt-project.org/docs/dev/examining/low_level_inspection.html#examining-grid-data-in-a-fixed-resolution-array</a><br>
>> >>> >> >> but encountered an error message using a smoothed covering grid<br>
>> >>> >> >> with<br>
>> >>> >> >> SPH data instead of a covering grid. I posted an MWE here:<br>
>> >>> >> >> <a href="http://pastebin.com/2sStpLmw" rel="noreferrer" target="_blank">http://pastebin.com/2sStpLmw</a> which leads to the error message<br>
>> >>> >> >> "AttributeError: 'YTSmoothedCoveringGrid' object has no<br>
>> >>> >> >> attribute<br>
>> >>> >> >> '_pdata_source' "<br>
>> >>> >> >><br>
>> >>> >> >> I wanted to use a smoothed covering grid because I found that<br>
>> >>> >> >> using<br>
>> >>> >> >> SPH data a lot of "holes" are in `covering grid' (but not, e.g.,<br>
>> >>> >> >> in<br>
>> >>> >> >> a<br>
>> >>> >> >> slice plot). So I assumed there is some problem in duplicating<br>
>> >>> >> >> the<br>
>> >>> >> >> values from the coarser grids?<br>
>> >>> >> >><br>
>> >>> >> >> My yt version is 3.2-dev.<br>
>> >>> >> >><br>
>> >>> >> >> Thanks a lot for your time & help,<br>
>> >>> >> >> Max<br>
>> >>> >> >> _______________________________________________<br>
>> >>> >> >> yt-users mailing list<br>
>> >>> >> >> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> >>> >> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >>> >> > _______________________________________________<br>
>> >>> >> > yt-users mailing list<br>
>> >>> >> > <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> >>> >> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >>> >> _______________________________________________<br>
>> >>> >> yt-users mailing list<br>
>> >>> >> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> >>> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >>> ><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > _______________________________________________<br>
>> >>> > yt-users mailing list<br>
>> >>> > <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> >>> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >>> ><br>
>> >>> _______________________________________________<br>
>> >>> yt-users mailing list<br>
>> >>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> >>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >><br>
>> >><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> yt-users mailing list<br>
>> >> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div></div>