Re: [yt-users] optimal resolution for frb
Hi Nathan, Thanks very much for the detailed response. I had no idea that ds.index contains so much information. I've looked at the grid data for a simulation I did and it's quite revealing. Unfortunately for my case, a 2D simulation, it seems that ds.index.get_smallest_dx() includes the third (unused) dimension, which for some reason is given a (very small) thickness in FLASH data. As a result, I get that very small dimension from ds.index.get_smallest_dx(). Nevertheless, it seems that it should possible to get the smallest grid dimension in each direction via the use of ds.index.grids.RightEdge and ds.index.grids.LeftEdge. I'm working on it now. Regards, Jon On Sat, Sep 26, 2015 at 11:25 AM, <yt-users-request@lists.spacepope.org> wrote:
Date: Fri, 25 Sep 2015 14:00:13 -0500 From: Nathan Goldbaum <nathan12343@gmail.com> To: Discussion of the yt analysis package <yt-users@lists.spacepope.org> Subject: Re: [yt-users] optimal resolution for frb Message-ID: <CAJXewO= 1rW7E+VkFeVqogWV+8Uq_Tq_rkufLDZ3xaA8tWuQzWg@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Making it easy to lock the FRB resolution to the simulation resolution or some factor-of-two multiple would be a great improvement, and something that would be not too hard I think. Right now you're right that it's not very obvious how to do this. If you'd be interested in coming up with a UI for making FRBs that are locked to the simulation resolution, I think that would be a fun first yt project that many people would like to use.
One easy way to get the size of the smallest computational element is the `ds.index.get_smallest_dx()` function, which will return the size of the smallest cell width in code units. The ds.index object is the main way to access information about the geometrical or mesh properties of a dataset.
For patch AMR datasets like FLASH, you can access the grid objects like so:
for grid in ds.index.grids: print grid.LeftEdge, grid.RightEdge # left and right edge of the grid in code units print grid.ActiveDimensions # the dimensions of the grid patch (i.e. number of zones along x, y, and z) print grid.Level # AMR leve print grid.Children # references to child grid objects, if any print grid.Parent # reference to parent grid print grid['dens'] # the on-disk gas density field
You can access any yt field on the grid object using a dictionary-like lookup, just like any other yt data object.
-Nathan
-- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA jslavin@cfa.harvard.edu 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 cell: (781) 363-0035 USA ________________________________________________________
participants (1)
-
Slavin, Jonathan