I recently start to work with yt to analyze my FLASH simulation. The output of those simulation is an hdf5 file.
When I try to plot a slice of my simulation, some weird lines appear on it. Here is an example of the python script and the results it leads to.
ds = yt.load("lasslab_hdf5_plt_cnt_0000.hdf5")
yt.SlicePlot(ds, 'z', "dens").show()
Actually they also appear went plotting the results of a frb of a slice (even when I try to plot the x or y coordinate in 2d).
Do you have any idea of the reason for such lines, or a solution for my problem?
Hi yt friends,
I'm trying to produce 3D streamlines using the AMR data from FLASH following the yt-project tutorial http://yt-project.org/doc/visualizing/streamlines.html. However, the execution was very slow (in particular, at the 'Streamlines' call). The code didn't complete one single streamline after an hour.
Here's the excerpt of my code:
c = ds.domain_center
streamlines = Streamlines(ds, c, 'velx', 'vely', 'velz', length=1.0*pc, get_magnitude=False)
ax = Axes3D(fig)
for stream in streamlines.streamlines:
stream = stream[np.all(stream != 0.0, axis=1)]
ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
I have two thoughts:
1. My FLASH file is quite large (~10GB). It may just be slow because of the large AMR grid size. Are there any ways to read only the velocities off the grid or only a subsection of the grid?
2. FLASH's octree data structure may be incompatible with the AMRKDTree construction (first step in streamlines creation). In the doc string of AMRKDTree, it says "Not applicable to particle or octree-based datasets.". If it's the case, I may have to find another way out.
Thank you very much for your time! Have a great weekend!
I apologize for bombarding the mailing list this past bit, but hopefully this should be the last question that I have. I'm trying to set aysmmetric units on a projection plot (i.e. xlim=[-10,40] and ylim=[-35,35] in kpc. However, there is not a set_xlim or set_ylim option for off axis projection plots. The idea that I had was to use the pan function. Since my box is 100 kpc in each direction, in code units, I attempted to set the width of my box:
#read in my data with the proper north and normal vectors to get the orientation right
proj = OffAxisProjectionPlot(ds,normal,'density',center=gal_center,north_vector=north)
#this should set the box to be 50 kpc in the x direction and 70 kpc in the y direction
#pan the box 15 kpc to the right
However, when I show the plot, the pan() function has not shifted it at all. Is there a way to manually set the limits to what I need to, or to properly use the pan function?
Thanks again for all the help, you guys have been great about getting back to me quickly.
I'm mailing both yt-users and yt-dev since I don't think there are many
ramses users on yt-dev.
I'd like some feedback from users of the RAMSES frontend about a pull
request I just proposed:
See the pull request for details, but briefly, I've made it possible to
access the 'particle_age' field values for cosmology simulations as they
are stored in the ramses outputs. Currently we apply an in-place conversion
from conformal time to proper time when we read these data in, and it turns
out this conversion makes it difficult to write a particle filter for DM
particles that will work for all RAMSES data.
The trouble is that if we change the meaning of the particle_age field,
this may break the scripts of people who are currently using yt with RAMSES
data. Then again, we already made such a change when we added the in-place
conversion a year ago.
If you have thoughts and opinions about this I'd very much appreciate to
hear your comments on github.
I have what I think should be a relatively simple question. I am trying to
make a 3D image of a region of a cosmological simulation, and plot points
in the image. I define my region with box(left_edge,right_edge) where
left_edge and right_edge are in code units. However, the points that I
read in from an earlier file are in cgs units. Since the file was written
using yt output, I would like to just let yt do the conversions, but
nothing has units attached. I want the 3d image to get everything into the
same units. I feel like there are a few ways I could fix this problem--1)
tell yt that my points are in cgs units, 2) force the create_scene to be
in cgs units, 3) get yt to tell me the conversion factor from code units to
Unfortunately, I don't know how to do any of these things!
Can someone give me some advice on what to do here?
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
I am trying to compile yt with rockstar enabled, so I am having yt install
itself from source. The code downloads Cython 0.23.5, but later then
requires Cython 0.24+. I tried downloading Cython-0.25.2, but this failed
(I probably did it wrong). What do I need to change to make the
install_script.sh work with Cython?
Here is a piece of the failure report I got:
line 132, in add_defaults
line 299, in get_finalized_command
line 107, in ensure_finalized
File "setup.py", line 308, in finalize_options
RuntimeError: Building yt from source requires Cython 0.24 or newer but
Cython 0.23.5 is installed. Please update Cython using the appropriate
package manager for your python environment.
ZAH Institut für Theoretische Astrophysik
I'm a relatively new user to yt, and I've been trying to figure out the best way to overplot some curves onto images generated by OffAxisProjectionPlot and OffAxisSlicePlot routines. My searching through the cookbooks has pointed me towards this page, which seems to indicate that accessing the matplotlib axes and figures are the right way to go about this. Following the example, I've created a density slice plot of my dataset and loaded in my plot in the following way:
dens_plot = slice.plots['density']
figure = dens_plot.figure
axes = dens_plot.axes
colorbar_axes = dens_plot.cax
>From here, my next step would be to plot the line I wish to plot using axes.plot(). However, running slice.show() after doing this just shows the original plot and does not contain the plot I've attempted to overplot. I'm sure my misunderstanding comes from not being familiar with how matplotlib works under the hood, but does anybody have any suggestions for the best way to go about doing this? I would also like to plot individual points on a projection plot in the xy-plane at some point, which I would assume has a very similar method.
I’m pretty new to this package and primarily use it to load Gadget snapshots, I’m wondering if it can in turn generate snapshots (used as initial conditions) , given all the initial conditions.
Dear Ms.Jill Naiman,
I'm one of the yt users and I'm referring to your script on this webpage
<http://yt-project.org/doc/visualizing/sketchfab.html> in order to get a
multi-surfaces 3D model of galaxies like the one you made
<https://skfb.ly/y96Y>. However, when I zipped my .obj and .mtl file and
uploaded to sketchfab, my model was just plain white, no other colors.
Attached is a screenshot of the code that I was using and I wish to know
what's wrong with it and how to get a model like yours. Hope you can find a
time to look at it and tell me my problems.
Sorry about any trouble this might bring and thank you in advance for your
time and patience.
I am trying to use the find_point() function as described as a low-level
data inspection example here
However, when I try the given example, I get this error:
>>> gs,gi=ds.find_point((0.5, 0.5, 0.5))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'EnzoDataset' object has no attribute 'find_point'
If this function doesn't work with an EnzoDataset, what does it work with?
I am ultimately trying to find the highest AMR level at a given point.
ZAH Institut für Theoretische Astrophysik