On Mon, Feb 27, 2017 at 12:34 PM, C.S. Howard <howardcs@mcmaster.ca> wrote:- What exactly does it return?I have a couple questions about this surface extraction method:Hi all,I'm trying to calculate the total amount of photons crossing a spherical surface using FLASH simulation data. I noticed yt has a surface extraction method, and I used this to extract the spherical surface. I only have the flux of photons in each cell and therefore need to mulitply by the cross-sectional area of each cell to get what I need.It's not clear what you're referring to in this question. What does what return?- Can I get the cross sectional area of each cell on the surface (as seen from the center of the simulation volume)Sure:ad = ds.all_data()# create surface at an isodensity of 5x10^-27 g/cm^3surf = ds.surface(ad, "density", 5e-27)# sample the "density" field at the isodensity surfacesurf['density']# The locations of all of the vertices of the surfacesurf.vertices# Coordinates of the vertices of the triangles that make up the surfacesurf.trianglesFor the dataset I'm looking at to help write this e-mail, the surf.vertices.shape is (3, 295197) (i.e. one 3D coordinate for every vertex) and surf.triangles.shape is (98399, 3, 3) (i.e. for each triangle [the first axis] there are three vertices [the second axis], each with three coordinates [the last axis]. Note also that there are exactly a third as many triangles as vertices.- If not, is there a better way to do this using yt?yt can calculate the flux of a vector field across a surface:This method is defined on any 3D data object. If you already have a surface object, there's also the calculate_flux method:CoreyCheers and thanks for the help,
_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope. org
_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users- spacepope.org