I ran both HOP and Rockstar halo finders on the same ART simulations,
and the mass functions match very well (attached hmf_m.pdf file).
However, when I compare virial radii (attached hmf_r.pdf file), they
don't match. Even if I try rescaling the Rockstar virial radius by 1.5,
the match is much worse than for mass functions.
How are the 'virial_radius' fields defined for both halo finders?
This is a z=7 simulations, so all mass definitions are the same, Mvir =
M200m = M200c.
I also attach the script to plot virial radii if you want to check it,
although it is trivial.
Many thanks (as usual),
I am currently attempting to compare a catalog with Mvir and Rvir units of
Mpc/h and Kpc/h comoving to a catalog with Mpc and Kpc proper. I am
currently using yt version 3.5.1, which I just checked for updates.
When doing this conversion of units within yt, there appears to be a
problem where an amount of h*h is not handeled properly. I have included a
screenshot of a jupyter session that outlines the problem as well as a .py
and jupyter script so it can be tested.
The problem arises when I try to calculate delta_vir, which is the density
of a galaxy/ critical density. The correct value for both catalogs I am
comparing is around 170. When I use yt to calculate the critical density at
z = 2, it get the correct value, which I convert to Mpc*h*h//kpc/kpc/kpc to
match with my /h catalog. Then, when I divide the densities, even thought
their units are identical, their division is different than if just the
float values are divided, by an exact factor of h*h. I wonder if there is
something wrong with how I am initializing my values with the ytquantity,
or if there is something wrong going on in the code.
[image: Screen Shot 2019-07-31 at 2.36.01 PM.png]
I recently installed Anaconda3 with Python 3.7, as well as the latest yt 3.4.1. But when I ran my code, calculating the center of mass and angular momentum, an error saying:
count_values() got an unexpected keyword argument 'particle_type'
Is there anything I can do to fix it except installing an Anaconda with Python 3.6?
With the merger today of https://github.com/yt-project/yt/pull/2163 ,
Python 2 support has been removed from the yt-4 branch. Those of you
using the master branch or any release will not be affected, but if
you're on yt-4, keep this in mind.
When making projection plots of total gas density and cold gas density, averaged over the projection length (i.e. with a uniform weighting), and using cut_region() to filter out hot gas to make the cold gas plots, it appears that some areas in the cold gas plot have a higher density than the corresponding areas in the total gas plot, which shouldn't happen. If you look at the top-middle of the two plots (link below) and compare the densities, the cold gas appears to have a higher density there. The code is below:
(link to plots: https://drive.google.com/drive/folders/1UJ6fmKNFQzGr8cfjov5-GwOzfS8nt2e8?...)
ds = yt.load("/tigress/cen/CZ15/redshift0100")
z = 0.62
# the box size is 120/0.7/(1+z) Mpc, where z is redshift
boxSize = 120e3/0.7/(1+z)
# virial radius in code units, r_v is virial radius in kpc
codeWidth = r_v / boxSize
center = [xCoord, yCoord, zCoord]
left_edge = [xCoord-2.1*codeWidth, yCoord-2.1*codeWidth, zCoord-2.1*codeWidth]
right_edge = [xCoord+2.1*codeWidth, yCoord+2.1*codeWidth, zCoord+2.1*codeWidth]
# want a box with full width about 4 times the virial radius
reg = ds.region(center, left_edge,right_edge)
# total gas plot
prj = yt.ProjectionPlot(ds, "x", "density", center=center, width=(4*r_v, 'kpc'),
data_source=reg, method='integrate', weight_field='ones')
u = 100 / 0.048
l = 0.07 / 0.048
# cold gas plot
cold_reg = reg.cut_region(["obj['temperature'] < 1e5"])
prj = yt.ProjectionPlot(ds, "x", "density", center=center, width=(4*r_v, 'kpc'),
data_source=cold_reg, method='integrate', weight_field='ones')
I am trying to plot streamlines using SlicePlot(x axis) and
annotate_streamlines (script below). The resulting image (google drive link
below) gives the orientation of streamlines along y axis. I would like to
have the streamlines orient along z-axis. I have tried switching the
variables on "SlicePlot" and "annotate_streamlines" but the streamlines
stays the same.
Can you give me any suggestions?
Thank you in advance
import numpy as np
import matplotlib.pylab as pl
from yt.visualization.api import Streamlines
from yt.units import km
from mpl_toolkits.mplot3d import Axes3D
ms = 24000000
dims = (200,200,200)
x = x.reshape((8000000, 3), order="F")
field1 = x[:,2].reshape(dims, order="F")
field2 = x[:,1].reshape(dims, order="F")
field3 = x[:,0].reshape(dims, order="F")
data = dict(field_x = field1,
field_y = field2,
field_z = field3)
bbox = np.array([[-100, 99], [-100, 99], [-100, 99]])
pf = yt.load_uniform_grid(data, dims, km, bbox=bbox, nprocs=1)
slc = yt.SlicePlot(pf, 0, ["field_z"], width=(200,'km'))
#slc.set_log('field_z', True, linthresh=0.001)
slc.annotate_line((0.36, 0), (0.36, 1),
slc.annotate_line((0.64, 0), (0.64, 1),
# larger the value of factor lesser the quiver
#slc.annotate_quiver('field_y', 'field_z', factor=20, normalize=True)
slc.annotate_sphere([0.5, 0.5, 0.5], radius=(9,
On Thu, Jan 10, 2019 at 11:00 AM <yt-users-request(a)python.org> wrote:
> Send yt-users mailing list submissions to
> To subscribe or unsubscribe via the World Wide Web, visit
> or, via email, send a message with subject or body 'help' to
> You can reach the person managing the list at
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of yt-users digest..."
> Today's Topics:
> 1. ANN: yt dev workshop, March 4-6 (Matthew Turk)
> Date: Thu, 10 Jan 2019 09:58:14 -0600
> From: Matthew Turk <matthewturk(a)gmail.com>
> Subject: [yt-users] ANN: yt dev workshop, March 4-6
> To: yt-dev(a)python.org, Discussion of the yt analysis package
> Cc: "Campbell, Mary Terese" <mtc(a)illinois.edu>, Samantha Walkow
> <samwalkow(a)gmail.com>, Madicken Munk <madicken.munk(a)gmail.com>
> Content-Type: text/plain; charset="UTF-8"
> Hi everyone!
> We are delighted to invite you to a yt development workshop at the
> University of Illinois Urbana-Champaign, March 4-6 of 2019. Please
> feel encouraged to pass this information on to others that may find it
> Information on logistics and registration may be found at the workshop
> This workshop will be focused on extending existing functionality,
> building collaborations with other software projects, and ingestion of
> new types and classes of data into yt.
> The workshop will take place at the National Center for Supercomputing
> Applications building on the north end of the UIUC campus. The NCSA
> building is about a block away from the conference hotel and is next
> door to a parking structure that offers metered all-day parking. There
> are a number of food trucks nearby, a university-run cafeteria about 2
> blocks away, and a university business district with many good lunch
> restaurants about a half a mile away.
> We are planning to offer funding for hotel and travel for those
> requesting support. If you request funding, you will be notified of
> available funds by February 16. Travel awards will be made in the
> form of arranged lodging and airfare, with reservations being made by
> the conference organizers.
> Best regards,
> The Organizing Committee
> MT Campbell
> Nathan Goldbaum
> Madicken Munk
> Matt Turk
> Samantha Walkow
> Subject: Digest Footer
> yt-users mailing list -- yt-users(a)python.org
> To unsubscribe send an email to yt-users-leave(a)python.org
> End of yt-users Digest, Vol 131, Issue 8
*"**Claiming that something can move faster than light is a good
conversation-stopper in physics. People edge away from you in cocktail
parties; friends never return phone calls. You just don’t mess with Albert
I could not find a solution for my issue in the archived threads so I am posting it here.
I use FLASH to run my MHD simulation and then use the output hdf5 plotfile to create and save a yt PhasePlot of number density and adiabatic index 'gamma' (user-defined fields) color-coded by the cell mass:
The axes labels are smaller than what I would like them to be. If I increase the font-size to a higher value (say, plot.set_font_size(30)), the axes labels are of the appropriate font size, but the x-axis tick labels also increase in size and overlap with the figure boundary. This might be because my tick labels have exponents (10^(11), 10^(12), etc.). Is there a way to only change the axes label size and not the tick label size while using yt?
Thanks in Advance,
New user of yt here. I've been using yt to make some projection plots and I was wondering if there is a way to express the units of the colorbar relative to the mean baryonic density rather than in cgs, i.e. in the form 0.048*rho_crit(at z=0) * (1+z)^3 at redshift z, where rho_crit is a critical density I can calculate and the redshift z can vary depending on which file I'm making projections of. So the colorbar may range from 0.1 (times the baryonic density) to, say, 100 (times the baryonic density). What would be the best way to do this? I'm working with yt version 3.5.1 and Python 3.7.3. Any help is greatly appreciated.
I am trying to get an array out of an off axis projection with a chosen
This is what I have:
plot = yt.OffAxisProjectionPlot(ds, [1, 1, 1], 'density')
image = plot.frb[“gas”, “density”]
According to Nathan's email to Stephanie last year,
"image will be a 1600x1600 2D ndarray containing an image of the density
However, it is not working for me. image is still 800x800.
I do see this message:
yt : [INFO ] 2019-07-01 15:51:04,868 Making a fixed resolution buffer
of (('gas', 'density')) 1600 by 1600
so it seems that yt is making a FRB with the desired resolution, but how do
I get the array?