Hi, Everybody!
Does anyone out there have a technique for getting the variance out of
a profile object? A profile object is good at getting <X> vs. B, I'd
then like to get < (X - <X>)^2 > vs B. Matt and I had spittballed the
possibility some time ago, but I was wondering if anyone out there had
successfully done it.
Thanks,
d.
--
Sent from my computer.
Hi,
I did some simple volume rendering with the following script:
volume2 = AMRKDTree(pf, fields=["Dark_Matter_Density"],
no_ghost=False, tree_type="domain",
le=c-0.5*WW, re=c+0.5*WW)
cam = pf.h.camera(c, L, W, N, tf, volume=volume2, no_ghost=False,
north_vector=L, steady_north=True)
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.
Best,
Renyue
Hi Kacper,
my minimal resolution is less than 1 AU, the problem seems more related to
the Matt's issue.
The script is the same as in the yt website, here the link:
http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py
the output of pf.h.find_max("Density") :
(1.139355201341093e-11, array([ 0.49722083, 0.50645245, 0.49492896]))
Thanks
Stefano
---------- Forwarded message ----------
From: Kacper Kowalik <xarthisius.kk(a)gmail.com>
Date: Mon, Apr 29, 2013 at 1:35 PM
Subject: Re: [yt-users] slice plot
To: yt-users(a)lists.spacepope.org
On 04/29/2013 01:22 PM, stefano bovino wrote:
> Hi all,
> when using the following script fromt the yt.project website
> multi_plot_slice_and_proj.py<
http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py>I
> have problems if I change the resolution from mpc to pc.
>
> slc_frb = slc.to_frb((1.0, "mpc"), 512) --> slc_frb = slc.to_frb((1.0,
> "pc"), 512)
>
> I even tried other ways (or scripts) to plot a slice of the density
> changing the resolution, but the problem is still there. Do you have any
> solution?
>
> I just would like to create a 9 panels plot with slice of density, H2, and
> Temperature with three different width (on the pc scale).
Hi Stefano,
what is the size of your computational domain or size of the smallest
cell you have? You can obtain that information using:
yt stats output_filename
Cheers,
Kacper
Hi all,
when using the following script fromt the yt.project website
multi_plot_slice_and_proj.py<http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py>I
have problems if I change the resolution from mpc to pc.
slc_frb = slc.to_frb((1.0, "mpc"), 512) --> slc_frb = slc.to_frb((1.0,
"pc"), 512)
I even tried other ways (or scripts) to plot a slice of the density
changing the resolution, but the problem is still there. Do you have any
solution?
I just would like to create a 9 panels plot with slice of density, H2, and
Temperature with three different width (on the pc scale).
Thank you in advance.
Hi, all--
I'm running into problems making phase objects. It looks like the error is
in the color bar, and is similar to other errors I get when trying to use
PlotCollections. The hash I'm on is 34b95297062b. I'm trying:
pf = load(fname)
pc = PlotCollection(pf,'c')
phase=pc.add_phase_object(pf.h.all_data(),['CellMass',
'x-velocity','CellVolume'],weight=None)
min/max are as follows:
CellMass: [4.1e-12,1.5e-03] (30631133,)
x-velocity: [-7.2e+01,5.5e+01]
CellVolume: [1.45e-11,6.0e-08]
Is there a more up-to-date manner to do this that doesn't use
PlotCollection? Or is there something obvious that I'm missing?
It seems to be choking in plot_types.py/__init_colorbar
def __init_colorbar(self):
temparray = np.ones((self.x_bins.size, self.y_bins.size))
self.norm = matplotlib.colors.Normalize()
self.image = self._axes.pcolormesh(self.x_bins, self.y_bins,
temparray, shading='flat',
norm=self.norm, cmap=self.cmap,
rasterized=True)
self.colorbar = self._figure.colorbar(self.image,
extend='neither', shrink=0.95,
format="%0.2e" )
It looks like what's happening is figure.colorbar chokes on the fact that
temparray is "ones", so the spacing between elements is zero. This is
outside of my yt knowledge, though.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "p14_phase_test.py", line 4, in <module>
phase=pc.add_phase_object(pf.h.all_data(),['CellMass','x-velocity','CellVolume'])
File
"/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_collection.py",
line 1184, in add_phase_object
figure=figure, axes=axes))
File
"/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_types.py",
line 815, in __init__
self.__init_colorbar()
File
"/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_types.py",
line 834, in __init_colorbar
format="%0.2e" )
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/figure.py",
line 1387, in colorbar
cb = cbar.colorbar_factory(cax, mappable, **kw)
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 1173, in colorbar_factory
cb = Colorbar(cax, mappable, **kwargs)
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 854, in __init__
ColorbarBase.__init__(self, ax, **kw)
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 298, in __init__
self.draw_all()
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 323, in draw_all
self._config_axes(X, Y)
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 409, in _config_axes
self.update_ticks()
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 345, in update_ticks
ticks, ticklabels, offset_string = self._ticker()
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 560, in _ticker
ticks = self._locate(b)
File
"/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 808, in _locate
z = np.take(y, i0) + (xn-np.take(b,i0))*dy/db
FloatingPointError: invalid value encountered in divide
Hi all,
I am trying to create a simple slice plot for the central 1 pc of a
simulation box of size 1 mpc using the following simplest script.
Problem occurs when I set plot width as can be seen in attached plot. I
tried stable version of yt as well development fork but did not get any
success. Slice works well without any problem if I use pc.add_slice
method. Any ideas what is going wrong here.
thanks in advance,
Cheers
Latif
SlicePlot(pf, 'x', "Density", width = (800.0, 'kpc')).save()
Hi, all--
I'm trying to set the color map and extents for some plots, but it doesn't
seem to be taking: If I do
field= 'Density'
proj = pf.h.proj(ax,field,source=cut_region)
pw = proj.to_pw()
pw.set_cmap('Density','gray')
pw.set_zlim = [0.1,50]
pw.save('wtfc.png')
pp = ProjectionPlot(pf,0,'Density')
pp.set_cmap('Density','gray')
pp.set_zlim = [0.1,50]
pp.save('wtfd.png')
the two plots should have the same range on the color map, but they don't.
I tried calls to "refresh" n both pp and pw, but that didn't help. What
am I missing?
d.
--
Sent from my computer.
Hi, all--
Can I hand a cut_region to a projection?
I want to make a bunch of projections based on parameters, and don't want
to have to instantiate 47 different fields. I'm hoping something like
region = pf.h.all_data().cut_region('grid["Density"] > 0.1 and
grid["Density"] < 0.2')
proj = pf.h.proj(0,"Density",region=cut_region)
or something like that. Is that possible? I'm poking around the help and
source, but no method immediately popped out at me.
Thanks,
d.