You’ll need to define your own field in the yt field system, see:

On Sun, Jan 13, 2019 at 7:40 AM <> wrote:
I have an hdf5 data file from FLASH which I analyze through yt. I use the yt_createprofile function to make a 2D profile plot of density and temperature as mentioned on the website:
import yt

ds = yt.load("some_hdf5_data")
dd = ds.all_data()
center = ds.arr([64.0, 64.0, 64.0], 'code_length')
rvir = ds.quan(1, "pc")
sph = ds.sphere(center, rvir)

profile = yt.create_profile(sph, ['density', 'temperature'], n_bins=[128, 128], fields=['cell_mass'], weight_field=None)
plot = yt.PhasePlot.from_profile(profile)

However, I would also like to make a plot of the number density. Say, I define
numdens = dd['density']/1.67e-24
How can I use 'numdens' to plot the same profile plot?
yt-users mailing list --
To unsubscribe send an email to