Hi I've recently started using yt for visualizing the gas density of TNG 
galaxies with an OffAxisSlicePlot. I want the top of the image to align with 
the galaxy's velocity direction [0.9196489, 0.15788311, -0.35960928], so I set 
north_vector = [0.9196489, 0.15788311, -0.35960928]. The projection direction 
is the normal vector perpendicular to the galaxy's velocity direction.

Here's my code snippet:
c = ds.arr([Subhalo["SubhaloPos"][0], Subhalo["SubhaloPos"][1], 
Subhalo["SubhaloPos"][2]], "code_length")
a = np.array([0.9196489, 0.15788311, -0.35960928])

# Choose a simple vector that is not collinear with 'a'
b = np.array([0, 0, 1])  # For example, the unit vector along the z-axis

# Calculate the cross product to get the perpendicular vector
v_perpendicular = np.cross(a, b)

slc = yt.SlicePlot(ds, v_perpendicular, ("gas","density"), width=(300, "kpc"), 
center=c, north_vector=a)


However, I keep encountering this error:
YTNonIndexedDataContainer: The data container type (ParticleContainer) is an 
unindexed type. Operations such as ires, icoords, fcoords, and fwidth will not 
work on it. Did you just attempt to perform an off-axis operation? Be sure to 
consult the latest documentation to see whether the operation you tried is 
actually supported for your data type.

Has anyone faced a similar issue or can suggest a workaround? Is there a 
specific approach to making off-axis plots for particle data in yt?
_______________________________________________
yt-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: [email protected]

Reply via email to