[yt-dev] ProfileND: soliciting opinions

John ZuHone jzuhone at gmail.com
Mon Feb 3 13:42:05 PST 2014


Hi all,

So Matt and I are using the pressure of the yt / Athena workshop coming up in a few days to get some things ironed out with unitrefactor, and I've come up on an issue that I'd like to get feedback on with regard to the setup of ProfileND objects.

Let's take Profile1D as an example:

prof = Profile1D(sp, "density", 32, rho_min, rho_max, True, weight_field="density")
prof.add_fields(["temperature","velocity_magnitude"])

You can access the dependent fields dict-like, as you should:

prof["temperature"]

which gives you the average value of that field in the bin. However, we have no "easy" way to get the values of the independent field (in this case, "density") at the bin centers. There are a couple of attributes for the values of this field, but oddly they give the same thing:

prof.x_bins == values of the field at bin edges

prof.x == values of the field at bin edges

Is there a reason for this? My proposal is to make prof.x (and the corresponding prof.y and prof.z for Profile2D and Profile3D) the values at the bin centers. 

Best,

John Z


More information about the yt-dev mailing list