Hi all,
1) Is there a way to do a "mean" ProjectionPlot? As far as I can tell, the options are "integrate", "mip", and "sum", so I am guessing the answer is no. I know you can do this with regions by reg.mean(), and make your own plot in matplotlib. 2) If I do a Z projection on a domain with high X,Y spatial resolution, will it average cells along X and Y (within the pixel limits) at each Z depth as it projects? Or, just pick a single cell at X,Y for each pixel?
Also, does anyone know if the reg.mean() function weights the cells equally in the mean if there is varied spatial resolution? For example, I know the reg.integrate() function multiplies by path length, but reg.sum() simply adds up cell values.
Thanks!
Scott
Scott Feister, Ph.D. Postdoctoral Researcher, Flash Center for Computational Science University of Chicago, Department of Astronomy and Astrophysics
On Tue, Oct 4, 2016 at 11:26 AM, Scott Feister sfeister@gmail.com... wrote:
Hi all,
1) Is there a way to do a "mean" ProjectionPlot? As far as I can tell, the options are "integrate", "mip", and "sum", so I am guessing the answer is no. I know you can do this with regions by reg.mean(), and make your own plot in matplotlib.
If you use a weight field you'll get back a mean value (weighted by that field). If you want an unweighted mean, you can weight by the "ones" field (although this will likely not be what you want for AMR data). If you want a mass-weighted mean, you can weight by the cell_mass field. If you want a volume weighted mean, use cell_volume.
2) If I do a Z projection on a domain with high X,Y spatial resolution, will it average cells along X and Y (within the pixel limits) at each Z depth as it projects? Or, just pick a single cell at X,Y for each pixel?
It will average all the cells along the line of sight at that x,y value. Those cells might have different spatial resolutions.
>
Also, does anyone know if the reg.mean() function weights the cells equally in the mean if there is varied spatial resolution? For example, I know the reg.integrate() function multiplies by path length, but reg.sum() simply adds up cell values.
The mean() function takes a field to weight by:
http://yt-project.org/docs/dev/reference/api/generated/yt.data_objects.selec...
By default it uses "ones" or "particle_ones", depending on whether you're averaging a particle or mesh field.
>
Thanks!
Scott
Scott Feister, Ph.D. Postdoctoral Researcher, Flash Center for Computational Science University of Chicago, Department of Astronomy and Astrophysics
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org...
Hi Nathan,
Thanks a lot for the clarifications. I got confused on just one of your sentences:
It will average all the cells along the line of sight at that x,y value. Those cells might have different spatial resolutions.
So, a projection doesn't factor in every cell in the simulation, but it takes some subset? So, if there is a single cell in the grid that happens to have an absolutely enormous field value, it's quite possible that this will be under-factored or over-factored in a projection (depending on if the projection rays "misses" or "hits" it)?
When you say the cells might have different resolution, do you mean they would have sub-cells or that they would have different lengths/widths/heights?
Thanks a lot!
Best,
Scott
Scott Feister, Ph.D. Postdoctoral Researcher, Flash Center for Computational Science University of Chicago, Department of Astronomy and Astrophysics
On Tue, Oct 4, 2016 at 2:17 PM, Nathan Goldbaum nathan12343@gmail.com... wrote:
> >
On Tue, Oct 4, 2016 at 11:26 AM, Scott Feister sfeister@gmail.com... wrote:
Hi all,
1) Is there a way to do a "mean" ProjectionPlot? As far as I can tell, the options are "integrate", "mip", and "sum", so I am guessing the answer is no. I know you can do this with regions by reg.mean(), and make your own plot in matplotlib.
If you use a weight field you'll get back a mean value (weighted by that field). If you want an unweighted mean, you can weight by the "ones" field (although this will likely not be what you want for AMR data). If you want a mass-weighted mean, you can weight by the cell_mass field. If you want a volume weighted mean, use cell_volume.
2) If I do a Z projection on a domain with high X,Y spatial resolution, will it average cells along X and Y (within the pixel limits) at each Z depth as it projects? Or, just pick a single cell at X,Y for each pixel?
It will average all the cells along the line of sight at that x,y value. Those cells might have different spatial resolutions.
>
Also, does anyone know if the reg.mean() function weights the cells equally in the mean if there is varied spatial resolution? For example, I know the reg.integrate() function multiplies by path length, but reg.sum() simply adds up cell values.
The mean() function takes a field to weight by:
http://yt-project.org/docs/dev/reference/api/generated/yt.... data_objects.selection_data_containers.YTRegion.mean.html# yt.data_objects.selection_data_containers.YTRegion.mean
By default it uses "ones" or "particle_ones", depending on whether you're averaging a particle or mesh field.
>
Thanks!
Scott
Scott Feister, Ph.D. Postdoctoral Researcher, Flash Center for Computational Science University of Chicago, Department of Astronomy and Astrophysics
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...
On Tue, Oct 4, 2016 at 3:26 PM, Scott Feister sfeister@gmail.com... wrote:
Hi Nathan,
Thanks a lot for the clarifications. I got confused on just one of your sentences:
It will average all the cells along the line of sight at that x,y value. Those cells might have different spatial resolutions.
So, a projection doesn't factor in every cell in the simulation, but it takes some subset? So, if there is a single cell in the grid that happens to have an absolutely enormous field value, it's quite possible that this will be under-factored or over-factored in a projection (depending on if the projection rays "misses" or "hits" it)?
For each pixel, it takes into account all cells that contribute along the line of sight for that pixel.
If a single cell in the grid has an enormous value, it will be factored in at the same level of weighting as other cells at the same resolution level.
>
When you say the cells might have different resolution, do you mean they would have sub-cells or that they would have different lengths/widths/heights?
I'm not quite sure what you mean when you refer to "sub-cells" here. Let me see if I can explain in a little bit more detail.
For a single pixel in a projection, yt figures out a "stack" of cells in your simulation that are at different Z values but also enclose the X and Y values of your pixel.
To figure out the projection at that pixel, yt computes the sum of cell values times dZ in the "stack" of cells at that X,Y location. Optionally, there might be a weight field here as well, so for a weighted projection it would be the sum of the cell values multiplied by the weight field values multiplied by dZ.
There's a little bit of text in the docs describing how different projection types are formulated mathematically:
http://yt-project.org/docs/dev/visualizing/plots.html#types-of-projections...
This is also covered in the yt method paper (section 3.2):
http://adsabs.harvard.edu/abs/2011ApJS..192....9T...
Hope that explains it,
Nathan
>
Thanks a lot!
Best,
Scott
Scott Feister, Ph.D. Postdoctoral Researcher, Flash Center for Computational Science University of Chicago, Department of Astronomy and Astrophysics
On Tue, Oct 4, 2016 at 2:17 PM, Nathan Goldbaum nathan12343@gmail.com... wrote:
> >
On Tue, Oct 4, 2016 at 11:26 AM, Scott Feister sfeister@gmail.com... wrote:
Hi all,
1) Is there a way to do a "mean" ProjectionPlot? As far as I can tell, the options are "integrate", "mip", and "sum", so I am guessing the answer is no. I know you can do this with regions by reg.mean(), and make your own plot in matplotlib.
If you use a weight field you'll get back a mean value (weighted by that field). If you want an unweighted mean, you can weight by the "ones" field (although this will likely not be what you want for AMR data). If you want a mass-weighted mean, you can weight by the cell_mass field. If you want a volume weighted mean, use cell_volume.
2) If I do a Z projection on a domain with high X,Y spatial resolution, will it average cells along X and Y (within the pixel limits) at each Z depth as it projects? Or, just pick a single cell at X,Y for each pixel?
It will average all the cells along the line of sight at that x,y value. Those cells might have different spatial resolutions.
>
Also, does anyone know if the reg.mean() function weights the cells equally in the mean if there is varied spatial resolution? For example, I know the reg.integrate() function multiplies by path length, but reg.sum() simply adds up cell values.
The mean() function takes a field to weight by:
http://yt-project.org/docs/dev/reference/api/generated/yt.da... ta_objects.selection_data_containers.YTRegion.mean.html#yt. data_objects.selection_data_containers.YTRegion.mean
By default it uses "ones" or "particle_ones", depending on whether you're averaging a particle or mesh field.
>
Thanks!
Scott
Scott Feister, Ph.D. Postdoctoral Researcher, Flash Center for Computational Science University of Chicago, Department of Astronomy and Astrophysics
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...
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org...