Two questions related to projections
Hi yt-users, So I have two questions related to projections. What I want to finally end up with is a projection-type figure that for any point in the projection gives me the value: (column density) * (total sound crossing time) * (peak gravitational acceleration). I know how to make projections of column density and total sound crossing time, but am stuck otherwise. So, my questions: 1) Can I combine two projection plots after I make them? I do not want the projection of column density * sound crossing time for every cell, I want to multiply the two final outputs. 2) Can I create a projection plot, or map along a line of sight, of the peak value of a variable? Thanks for any help, Stephanie -- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
On Wed, Nov 11, 2015 at 2:27 PM, Stephanie Tonnesen
Hi yt-users,
So I have two questions related to projections. What I want to finally end up with is a projection-type figure that for any point in the projection gives me the value: (column density) * (total sound crossing time) * (peak gravitational acceleration). I know how to make projections of column density and total sound crossing time, but am stuck otherwise. So, my questions:
1) Can I combine two projection plots after I make them? I do not want the projection of column density * sound crossing time for every cell, I want to multiply the two final outputs.
I don't think there's an easy way to do this right now. We don't have good support for manipulating projected quantities in the same way as volumetric quantities. I would probably do this by manually plotting the product of the image arrays for each quantity.
2) Can I create a projection plot, or map along a line of sight, of the peak value of a variable?
This one's much easier, you want to specify proj_style='mip' (short for maximum intensity projection) when you create your ProjectionPlot. Projection data objects (e.g. ds.proj) take a style keyword argument that does the same thing. We should probably make that API more uniform... -Nathan
Thanks for any help, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Stephanie,
For the first one, I have made composite images using multiple projections.
I used the FixedResolutionBuffer to get the numpy array for each
projection, and combined them using imshow.
Cheers,
Yuan
On Wed, Nov 11, 2015 at 3:27 PM, Stephanie Tonnesen
Hi yt-users,
So I have two questions related to projections. What I want to finally end up with is a projection-type figure that for any point in the projection gives me the value: (column density) * (total sound crossing time) * (peak gravitational acceleration). I know how to make projections of column density and total sound crossing time, but am stuck otherwise. So, my questions:
1) Can I combine two projection plots after I make them? I do not want the projection of column density * sound crossing time for every cell, I want to multiply the two final outputs.
2) Can I create a projection plot, or map along a line of sight, of the peak value of a variable?
Thanks for any help, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Thank you two! These seem to be working perfectly! I now have what I
think must be a really simple question...how do I get my colorbar to be
evenly spaced in log? I am typing in:
im =
plt.imshow(np.array(frbd['density'])*np.array(frbt['t_soundnoA'])*np.array(frbA['gacc_z']))
plt.colorbar(im)
plt.savefig('blahblahname.png')
and after a bit of a search have no idea what commands will actually apply
to imshow to get the log colorbar.
Thanks!
Stephanie
--
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
stonnes@gmail.com
On Wed, Nov 11, 2015 at 1:03 PM, Yuan Li
Hi Stephanie,
For the first one, I have made composite images using multiple projections. I used the FixedResolutionBuffer to get the numpy array for each projection, and combined them using imshow.
Cheers, Yuan
On Wed, Nov 11, 2015 at 3:27 PM, Stephanie Tonnesen
wrote: Hi yt-users,
So I have two questions related to projections. What I want to finally end up with is a projection-type figure that for any point in the projection gives me the value: (column density) * (total sound crossing time) * (peak gravitational acceleration). I know how to make projections of column density and total sound crossing time, but am stuck otherwise. So, my questions:
1) Can I combine two projection plots after I make them? I do not want the projection of column density * sound crossing time for every cell, I want to multiply the two final outputs.
2) Can I create a projection plot, or map along a line of sight, of the peak value of a variable?
Thanks for any help, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
_______________________________________________ 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 Wed, Nov 11, 2015 at 6:53 PM, Stephanie Tonnesen
Thank you two! These seem to be working perfectly! I now have what I think must be a really simple question...how do I get my colorbar to be evenly spaced in log? I am typing in:
im = plt.imshow(np.array(frbd['density'])*np.array(frbt['t_soundnoA'])*np.array(frbA['gacc_z'])) plt.colorbar(im) plt.savefig('blahblahname.png')
form matpotlb.colors import LogNorm im = plt.imshow(np.array(frbd['density'])*np.array(frbt['t_soundnoA'])*np.array(frbA['gacc_z']), norm=LogNorm()) plt.colorbar(im) plt.savefig('blahblahname.png') There's also SymLogNorm if your colorbar contains negative values.
and after a bit of a search have no idea what commands will actually apply to imshow to get the log colorbar.
Thanks! Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
On Wed, Nov 11, 2015 at 1:03 PM, Yuan Li
wrote: Hi Stephanie,
For the first one, I have made composite images using multiple projections. I used the FixedResolutionBuffer to get the numpy array for each projection, and combined them using imshow.
Cheers, Yuan
On Wed, Nov 11, 2015 at 3:27 PM, Stephanie Tonnesen
wrote: Hi yt-users,
So I have two questions related to projections. What I want to finally end up with is a projection-type figure that for any point in the projection gives me the value: (column density) * (total sound crossing time) * (peak gravitational acceleration). I know how to make projections of column density and total sound crossing time, but am stuck otherwise. So, my questions:
1) Can I combine two projection plots after I make them? I do not want the projection of column density * sound crossing time for every cell, I want to multiply the two final outputs.
2) Can I create a projection plot, or map along a line of sight, of the peak value of a variable?
Thanks for any help, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
_______________________________________________ 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
Fantastic! Thanks, these look perfect!
--
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
stonnes@gmail.com
On Wed, Nov 11, 2015 at 4:58 PM, Nathan Goldbaum
On Wed, Nov 11, 2015 at 6:53 PM, Stephanie Tonnesen
wrote: Thank you two! These seem to be working perfectly! I now have what I think must be a really simple question...how do I get my colorbar to be evenly spaced in log? I am typing in:
im = plt.imshow(np.array(frbd['density'])*np.array(frbt['t_soundnoA'])*np.array(frbA['gacc_z'])) plt.colorbar(im) plt.savefig('blahblahname.png')
form matpotlb.colors import LogNorm
im = plt.imshow(np.array(frbd['density'])*np.array(frbt['t_soundnoA'])*np.array(frbA['gacc_z']), norm=LogNorm()) plt.colorbar(im) plt.savefig('blahblahname.png')
There's also SymLogNorm if your colorbar contains negative values.
and after a bit of a search have no idea what commands will actually apply to imshow to get the log colorbar.
Thanks! Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
On Wed, Nov 11, 2015 at 1:03 PM, Yuan Li
wrote: Hi Stephanie,
For the first one, I have made composite images using multiple projections. I used the FixedResolutionBuffer to get the numpy array for each projection, and combined them using imshow.
Cheers, Yuan
On Wed, Nov 11, 2015 at 3:27 PM, Stephanie Tonnesen
wrote: Hi yt-users,
So I have two questions related to projections. What I want to finally end up with is a projection-type figure that for any point in the projection gives me the value: (column density) * (total sound crossing time) * (peak gravitational acceleration). I know how to make projections of column density and total sound crossing time, but am stuck otherwise. So, my questions:
1) Can I combine two projection plots after I make them? I do not want the projection of column density * sound crossing time for every cell, I want to multiply the two final outputs.
2) Can I create a projection plot, or map along a line of sight, of the peak value of a variable?
Thanks for any help, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com
_______________________________________________ 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
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
Nathan Goldbaum
-
Stephanie Tonnesen
-
Yuan Li