[yt-users] slice of a part of domain

Chang-Goo Kim cgkim at astro.princeton.edu
Fri Jul 11 09:22:08 PDT 2014


Hi Nathan,

Thanks for your suggestion. BTW, I have misinterpreted by situation. I'm
running in 1/8 part of 3D cartesian coordinates with symmetry. I have
looked at the fixed_resolution.py and realized that it can be resolved by
modifying FixedResoutionBuffer class to work with mirror symmetry as it
handles periodicity. How do you thing about this idea? Do you think it is
easy to implement within the yt philosophy?

Chang-Goo



On Thu, Jul 10, 2014 at 9:38 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> Hi Chang-Goo,
>
> yt's philosophy for presenting data is to do it exactly as it is
> represented on disk. Since your data only fills up a fraction of the
> domain, that is how you see it.
>
> That said, I definitely see why you would want to see the duplicated
> dataset covering the full domain.  To do that, I think you'll need to
> modify the pixelizer or modify the pixelized representation produced by the
> pixelizer.  You can take a look at how the pixelizers are set up in
> spherical coordinates in yt/geometry/spherical_coordinates.py, near line
> 76.  Depending on the dimension you are slicing along, yt uses an
> orthographic pixelizer or a pixelizer optimized for cylindrical coordinates.
>
> You will have to somehow detect that your data only fills half the domain
> and then mirror it before passing it to the pixelizer.  Alternatively you
> could manipulate the pixelization its self before reutning it from the
> `pixelize` function..
>
> I think this would be a generally useful addition to yt its self.  If you
> do go down this path, we would very much like to see a pull request with
> these modifications so that others will be able to generate the pixelations
> you want.
>
> If you don't want to modify yt, you'll need to do the appropriate data
> mirroring on the `data` array in your attached script.
>
> Hope that helps,
>
> Nathan
>
>
> On Thu, Jul 10, 2014 at 11:10 AM, Chang-Goo Kim <cgkim at astro.princeton.edu
> > wrote:
>
>> Hi all,
>>
>> I have recently run a part of sphere by assuming mirror symmetry. So, the
>> simulated domain only spans from 0 to L/2 in every direction, which should
>> be -L/2 ~ L/2 for full domain. I then tried to make frb using slice and
>> to_frb function. What I get is a slice in -L/4 ~L/4 domain with
>> periodicity. How can I get correct slice? Here's a relevant part of script.
>>
>>         for iax in range(3):
>>                 slc = pf.slice(iax,0.0,center=(0.0,0.0,0.0))
>>                 slc_frb = slc.to_frb(pf.domain_width[0],512)
>>                 frb.append(slc_frb)
>>
>>                 for i,field in enumerate(fields):
>>                         ax = grid[iax*nrow+i]
>>                         data=np.array(slc_frb[field])
>>                         im = ax.imshow(data, origin='lower',
>> norm=LogNorm())
>>                         im.set_extent(np.array(slc_frb.bounds))
>>
>> Thanks,
>>
>> Chang-Goo
>>
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140711/78a82ba1/attachment.htm>


More information about the yt-users mailing list