<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 27, 2017 at 12:34 PM, C.S. Howard <span dir="ltr"><<a href="mailto:howardcs@mcmaster.ca" target="_blank">howardcs@mcmaster.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi all,<br><br></div>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. <br><br></div>I have a couple questions about this surface extraction method:<br></div>- What exactly does it return?<br></div></div></div></div></div></blockquote><div><br></div><div>It's not clear what you're referring to in this question. What does what return?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div></div>- Can I get the cross sectional area of each cell on the surface (as seen from the center of the simulation volume)</div></div></div></div></blockquote><div><br></div><div>Sure:</div><div><br></div><div><div>ad = ds.all_data()</div><div><br></div><div># create surface at an isodensity of 5x10^-27 g/cm^3</div><div>surf = ds.surface(ad, "density", 5e-27)</div></div><div><br></div><div># sample the "density" field at the isodensity surface</div><div>surf['density']<br></div><div><br></div><div># The locations of all of the vertices of the surface</div><div>surf.vertices</div><div><br></div><div># Coordinates of the vertices of the triangles that make up the surface</div><div>surf.triangles</div><div><br></div><div>For 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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div></div>- If not, is there a better way to do this using yt?<br></div></div></div></blockquote><div><br></div><div>yt can calculate the flux of a vector field across a surface:</div><div><br></div><div><a href="http://yt-project.org/docs/dev/reference/api/generated/yt.data_objects.data_containers.YTSelectionContainer3D.calculate_isocontour_flux.html#yt.data_objects.data_containers.YTSelectionContainer3D.calculate_isocontour_flux">http://yt-project.org/docs/dev/reference/api/generated/yt.data_objects.data_containers.YTSelectionContainer3D.calculate_isocontour_flux.html#yt.data_objects.data_containers.YTSelectionContainer3D.calculate_isocontour_flux</a><br></div><div><br></div><div>This method is defined on any 3D data object. If you already have a surface object, there's also the calculate_flux method:</div><div><br></div><div><a href="http://yt-project.org/docs/dev/reference/api/generated/yt.data_objects.construction_data_containers.YTSurface.calculate_flux.html#yt.data_objects.construction_data_containers.YTSurface.calculate_flux">http://yt-project.org/docs/dev/reference/api/generated/yt.data_objects.construction_data_containers.YTSurface.calculate_flux.html#yt.data_objects.construction_data_containers.YTSurface.calculate_flux</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div>Cheers and thanks for the help,<br></div>Corey<br><div><div><div><div><div><div><div><br><br></div></div></div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div></div>