<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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><div><br></div><div>Can you share the compilation error you ran into? It's a big problem if people are unable to compile the latest development version of yt.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> (with<br>
> fn_smooth = add_volume_weighted_smoothed_field("all","particle_position", "particle_mass", "smoothing_length",<br>
>                                                "particle_density", "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', '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.</blockquote><div><br></div><div>Can you create a test script that produces your error? That way one of us can read run the script locally and try to debug. If you can make the test script use of one of the test Gadget datasets on <a href="http://yt-project.org/data">yt-project.org/data</a>, that would also make it easier for one of us to reproduce your error.</div><div><br></div><div>You can use <a href="http://paste.yt-project.org">paste.yt-project.org</a> to share your full compilation error and test script without needing to paste them into an e-mail.</div><div><br></div><div>Best</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>
Thanks again for your help,<br>
Max<br>
<br>
<br>
On 6 October 2015 at 17:29, Max Grönke <<a href="javascript:;" onclick="_e(event, 'cvml', '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="javascript:;" onclick="_e(event, 'cvml', 'nathan12343@gmail.com')">nathan12343@gmail.com</a>> wrote:<br>
>> Hi Max,<br>
>><br>
>> This actually related to a new feature Bili Dong recently added:<br>
>><br>
>> <a href="https://bitbucket.org/yt_analysis/yt/pull-requests/1769/add-add_smoothed_particle_field/diff" 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="javascript:;" onclick="_e(event, 'cvml', 'max.gronke@astro.uio.no')">max.gronke@astro.uio.no</a>> 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/" 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="javascript:;" onclick="_e(event, 'cvml', 'nathan12343@gmail.com')">nathan12343@gmail.com</a>> wrote:<br>
>>> > Hi Max,<br>
>>> ><br>
>>> > I'm unable to load the pastebin link in your e-mail.  Can you re-send<br>
>>> > using<br>
>>> > a different pastebin service? We have <a href="http://paste.yt-project.org" target="_blank">paste.yt-project.org</a> set up for<br>
>>> > this<br>
>>> > purpose.<br>
>>> ><br>
>>> > Matt also has an open pull request that among other things adds support<br>
>>> > to<br>
>>> > arbitrary_grid for fluid fields:<br>
>>> ><br>
>>> ><br>
>>> > <a href="https://bitbucket.org/yt_analysis/yt/pull-requests/1763/numpy-like-operations/diff" 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 <<a href="javascript:;" onclick="_e(event, 'cvml', '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 a<br>
>>> >> lot of zero-valued grid points. It seems the values from the 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" target="_blank">http://pastebin.com/yishxbjW</a><br>
>>> >><br>
>>> >> For the arbitrary_grid: It says it cannot deal with fluid variables?<br>
>>> >><br>
>>> >> Best,<br>
>>> >> Max<br>
>>> >><br>
>>> >> On 2 October 2015 at 16:44, Matthew Turk <<a href="javascript:;" onclick="_e(event, 'cvml', 'matthewturk@gmail.com')">matthewturk@gmail.com</a>> wrote:<br>
>>> >> > Hi Max,<br>
>>> >> ><br>
>>> >> > Ah, I think I see the problem.  If you're doing any type of particle<br>
>>> >> > deposition, including smoothing, you might be better suited to using<br>
>>> >> > the arbitrary_grid or the covering_grid objects, as<br>
>>> >> > smoothed_covering_grid is designed for situations where values need<br>
>>> >> > to<br>
>>> >> > be interpolated through a cascade of refinements.  It'd probably end<br>
>>> >> > up being faster to use either arbitrary_grid or covering_grid, 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 <<a href="javascript:;" onclick="_e(event, 'cvml', '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>
>>> >> >> <a href="http://yt-project.org/docs/dev/examining/low_level_inspection.html#examining-grid-data-in-a-fixed-resolution-array" 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 with<br>
>>> >> >> SPH data instead of a covering grid. I posted an MWE here:<br>
>>> >> >> <a href="http://pastebin.com/2sStpLmw" target="_blank">http://pastebin.com/2sStpLmw</a> which leads to the error message<br>
>>> >> >> "AttributeError: 'YTSmoothedCoveringGrid' object has no attribute<br>
>>> >> >> '_pdata_source' "<br>
>>> >> >><br>
>>> >> >> I wanted to use a smoothed covering grid because I found that using<br>
>>> >> >> SPH data a lot of "holes" are in `covering grid' (but not, e.g., in<br>
>>> >> >> a<br>
>>> >> >> slice plot). So I assumed there is some problem in duplicating 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="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
>>> >> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>> >> > _______________________________________________<br>
>>> >> > yt-users mailing list<br>
>>> >> > <a href="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
>>> >> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>> >> _______________________________________________<br>
>>> >> yt-users mailing list<br>
>>> >> <a href="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
>>> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" 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="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
>>> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>> ><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" 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="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote>