I did some simple volume rendering with the following script:
volume2 = AMRKDTree(pf, fields=["Dark_Matter_Density"],
cam = pf.h.camera(c, L, W, N, tf, volume=volume2, no_ghost=False,
cam.snapshot(fn="%s_iso-DMdensity-%3.3d.png" % (filenameTHIS, j))
I got rather strange results in that the pictures look symmetric, which I am pretty
sure can not be true.
I attach the obtained plot.
Note that I am using KD tree and using 32 cores.
Your help at your earliest convenience is appreciated.
My Enzo simulation has refined to enough levels that I need to make
checkpoint dumps mid-timestep and do YT analysis from there. I can read in
the checkpoint dump but when I go to find the max density I get this error:
Anybody have any idea what is going on and how to fix this? Also, since
this dump is in the middle of the W-cycle, I believe the time on the finest
grid is different then the root grid. How do I find the time on
the finest grid for this checkpoint dump? Thanks.
Joseph Smidt <josephsmidt(a)gmail.com>
P.O. Box 1663, Mail Stop B283
Los Alamos, NM 87545
Can anyone give me an example script to load an hdf file that is written in the Chombo data format? I've been searching the site, but I can't find any comprehensible documentation about the relatively 'new' feature of being able to read Chombo HDF5.
I would like to be able to take a slice through a 3D dataset and then plot
just the contours of a single variable within that slice. I do not want to
overlay the contours with an annotate_countours method.
I know one way about this would be to use the FixedResolutionBuffer of some
slice plot to reconstruct a mesh-grid and the data, which can then be used
within matplotlib directly to create a contour plot.
I was curious if there was a more clever method using yt plot objects?
first I want to thank for every time I got an answer when I write
here, I really appreciate it.
Now I am writing because I am using PlotCollection (As you can see my
code) and I have some questions
1) the plot is coming in cm^3 and I want to change it to kpc^3 is there
a way to change it?
2) I am attaching the plot can I change to dot or any different symbol
3) why some plot come "empty"? and also I get this error message
/Data has no positive values, and therefore can not be log-scaled./
sphere = pf.h.sphere(c, (250., 'kpc')) # 250.
levels = 8 #8
mi, ma = sphere.quantities["Extrema"]("Density")
contour_values, connected_sets =
sphere.extract_connected_sets("Density", levels, mi, ma)
for i in connected_sets:
eb = connected_sets[i]
print "level " + str(i) + " clmsp# " + str(len(eb))
for j in eb:
obj = eb[j]
com = obj.quantities["CenterOfMass"]()
pc = PlotCollection(pf, com)
"Temperature"],weight="CellMassMsun") # average T(rho)
pc.add_profile_object(obj, ["Density", "CellVolume"],
pc.add_profile_object(obj, ["Density", "CellMassMsun"],
except Exception, e:
Thank you in advance!!
I am having trouble installing yt on my personal machine using the install script. I downloaded the script from the suggested website (http://hg.yt-project.org/yt/raw/stable/doc/install_script.sh) and attempted to execute it with `bash install_script.sh.' I have tried a few different combinations of install options, but it always seems to fail while building matplotlib. My system is OS X 10.8.3, and gcc version 4.8.0 (installed from MacPorts). I have attached my yt_install.log.
Thanks in advance for any help!
I'm seeing a glitch in the matplotlib countor function, as employed by
annotate_clumps. As is, I'm seeing some clumps that are not plotted by the
countour plotter unless I bump the number of contours-- I get all the plots
if I change the contour line to:
self.rv = plot._axes.contour(buff, len(self.clumps)+5,
self.rv = plot._axes.contour(buff, len(self.clumps)+1,
Is this a glitch that anyone is aware of? Is there a more general fix?
The clump contour is not the only time I've run into this glitch. It seems
to happen on large contours, for what that's worth.
thanks for your response. The most recent code version I used is
Would you suggest to alterntively use the simple volume rendering script?
On Fri, 17 May 2013, yt-users-request(a)lists.spacepope.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. Re: volume rendering of other fields than the density
> (Sam Skillman)
> Message: 1
> Date: Thu, 16 May 2013 14:08:53 -0600
> From: Sam Skillman <samskillman(a)gmail.com>
> To: Discussion of the yt analysis package
> Subject: Re: [yt-users] volume rendering of other fields than the
> Content-Type: text/plain; charset="iso-8859-1"
> Hi Wolfram,
> Sorry for the trouble -- the adaptive healpix rendering is fairly beta, as
> noted in that example, and I fear it may have gotten left behind in some of
> the recent developments. Could you let me know what version of yt you are
> using? You can check this with:
> yt instinfo
> It should spit out something like (in addition to other things):
> The current version of the code is:
I have a clump that I've gotten with the clump finder. I'd like to paint
those zones of that clump with a flag, so I can exclude that region from
other analysis. I'm a little stuck on how to get this done-- I feel like
it needs to involve clump.data._flush_data_to_grids and a cut_mask, but I'm
a little stuck on how to define the field that I flush_to_grids.
Specifically, how to get the cut_mask information to the field, and how to
avoid clobbering the paint from one clump with another (or, from one grid
I'm trying to do something like:
for grid in clump.data._grids:
cut_mask = clump.data._get_cut_mask(grid)
cut_mask = data.get_field_parameter('cut_mask', None)
base = data['masked_region']
base = na.zeros(data['Density'].shape)
if cut_mask is not None:
base = na.maximum(base,cut_mask)
print grid, cut_mask.sum(), grid['masked_region'].sum()
but clump['masked_region'].sum() only returns the flagged zones in the
first of the grids.
I feel like this is something I've done before, but can't find any
reference to it in my email or old scripts. Apologies if this has been
answered elsewhere, or it's obvious and I'm being thick.
I used the example script from the Tutorial section of the Volume
It works fine for the density, but for any other field (e.g.
temperature) the output is just blank. I don't see why I wouldn't work
for other fields, as the script appears to be written for arbitrary
fields. Changing level bounds, use_log, etc. doesn't help.
Does anyone how to fix this?