[yt-users] Problem with smoothed covering grid

Max Gronke max.gronke at astro.uio.no
Thu Nov 5 03:10:38 PST 2015


Hi Nathan & all!

Sorry for digging up this old topic again (wasn't sure if I should
open another thread or this is fine).
Although I didn't manage to compile the head of yt where Bili Dong's
pull request is included properly, I succeeded in adding a
volume_weighted_smoothed_field as he did. (with
> fn_smooth = add_volume_weighted_smoothed_field("all","particle_position", "particle_mass", "smoothing_length",
>                                                "particle_density", "particle_density", ds.field_info, 64)[0]
)
Afterwards I can also access the data through
> ad = ds.all_data()
> ad[fn_smooth]

but I cannot create a covering grid using the newly created field:
> ds.covering_grid(level, left_edge=ds.domain_left_edge, dims = dims,
>                            fields=[fn_smooth])
fails with the error message
> YTFieldNotFound: Could not find field '('deposit', 'all_smoothed_particle_density')' in ParticleData.

The reason seems to be that `fn_smooth` is in "ds.field_info" but not
in " ds.derived_field_list".

Maybe the my whole ansatz is also wrong? All I want to achieve is to
obtain a covering grid which used the SPH kernels of the particles and
I follow roughly your code in the "Gadget" frontend.

Thanks again for your help,
Max


On 6 October 2015 at 17:29, Max Grönke <maxbg at astro.uio.no> wrote:
> Thanks!
>
> For the moment we found a workaround (generic sph --> gadget) but for
> the future this might come handy.
>
> Best,
> Max
>
> On 6 October 2015 at 17:14, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>> Hi Max,
>>
>> This actually related to a new feature Bili Dong recently added:
>>
>> https://bitbucket.org/yt_analysis/yt/pull-requests/1769/add-add_smoothed_particle_field/diff
>>
>> This PR adds new functionality to make it easier to define SPH smoothed
>> fields. Maybe that will help?
>>
>> -Nathan
>>
>> On Tue, Oct 6, 2015 at 1:48 AM, Max Grönke <max.gronke at astro.uio.no> wrote:
>>>
>>> Hi Nathan.
>>> Thanks for your reply. Here's the new link:
>>> http://paste.yt-project.org/show/5930/
>>>
>>> I think I figured out the problem -- at least in theory ;)  I guess
>>> what I need is a "smoothed field". This meant I played around with
>>> "add_volume_weighted_smoothed_field". But although
>>>
>>> > fn_smooth =
>>> > add_volume_weighted_smoothed_field("all","particle_position",
>>> > "particle_mass", "smoothing_length",
>>> >                                               "particle_density",
>>> > "particle_density", ds.field_info, 64)
>>>
>>> (where `ds' is my YT Particle Data Set)
>>>
>>> seems to work, I cannot access the newly created field?
>>> ("YTFieldNotFound: Could not find field '('deposit',
>>> 'all_smoothed_particle_density')' in ParticleData.")
>>>
>>> Thanks for your help,
>>> Max
>>>
>>>
>>> On 5 October 2015 at 17:41, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>>> > Hi Max,
>>> >
>>> > I'm unable to load the pastebin link in your e-mail.  Can you re-send
>>> > using
>>> > a different pastebin service? We have paste.yt-project.org set up for
>>> > this
>>> > purpose.
>>> >
>>> > Matt also has an open pull request that among other things adds support
>>> > to
>>> > arbitrary_grid for fluid fields:
>>> >
>>> >
>>> > https://bitbucket.org/yt_analysis/yt/pull-requests/1763/numpy-like-operations/diff
>>> >
>>> > -Nathan
>>> >
>>> > On Fri, Oct 2, 2015 at 10:23 AM, Max Grönke <max.gronke at astro.uio.no>
>>> > wrote:
>>> >>
>>> >> Hi Matthew,
>>> >>
>>> >> thanks for your prompt response!
>>> >>
>>> >> I tried the covering_grid first but as I said we had problems with a
>>> >> lot of zero-valued grid points. It seems the values from the coarser
>>> >> grid are not duplicated downwards?
>>> >> I tried to post a MWE to illustrate what I mean:
>>> >> http://pastebin.com/yishxbjW
>>> >>
>>> >> For the arbitrary_grid: It says it cannot deal with fluid variables?
>>> >>
>>> >> Best,
>>> >> Max
>>> >>
>>> >> On 2 October 2015 at 16:44, Matthew Turk <matthewturk at gmail.com> wrote:
>>> >> > Hi Max,
>>> >> >
>>> >> > Ah, I think I see the problem.  If you're doing any type of particle
>>> >> > deposition, including smoothing, you might be better suited to using
>>> >> > the arbitrary_grid or the covering_grid objects, as
>>> >> > smoothed_covering_grid is designed for situations where values need
>>> >> > to
>>> >> > be interpolated through a cascade of refinements.  It'd probably end
>>> >> > up being faster to use either arbitrary_grid or covering_grid, too.
>>> >> > Can you try that and let us know if it meets your needs?
>>> >> >
>>> >> > -Matt
>>> >> >
>>> >> > On Fri, Oct 2, 2015 at 9:42 AM, Max Grönke <max.gronke at astro.uio.no>
>>> >> > wrote:
>>> >> >> Hi everybody!
>>> >> >>
>>> >> >> I followed loosely the example provided here
>>> >> >>
>>> >> >>
>>> >> >> http://yt-project.org/docs/dev/examining/low_level_inspection.html#examining-grid-data-in-a-fixed-resolution-array
>>> >> >> but encountered an error message using a smoothed covering grid with
>>> >> >> SPH data instead of a covering grid. I posted an MWE here:
>>> >> >> http://pastebin.com/2sStpLmw which leads to the error message
>>> >> >> "AttributeError: 'YTSmoothedCoveringGrid' object has no attribute
>>> >> >> '_pdata_source' "
>>> >> >>
>>> >> >> I wanted to use a smoothed covering grid because I found that using
>>> >> >> SPH data a lot of "holes" are in `covering grid' (but not, e.g., in
>>> >> >> a
>>> >> >> slice plot). So I assumed there is some problem in duplicating the
>>> >> >> values from the coarser grids?
>>> >> >>
>>> >> >> My yt version is 3.2-dev.
>>> >> >>
>>> >> >> Thanks a lot for your time & help,
>>> >> >> Max
>>> >> >> _______________________________________________
>>> >> >> 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
>>> >> _______________________________________________
>>> >> 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
>>> >
>>> _______________________________________________
>>> 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
>>



More information about the yt-users mailing list