Dear All,
I am trying to plot a multi plot of temperatures at different red-shifts
with following script.
from yt.mods import * # set up our namespace
import matplotlib.colorbar as cb
fig, axes, colorbars = get_multi_plot( 3, 1, colorbar='vertical', bw = 4)
file1="/app/run/csarkar/surajit/simulation_shock/simulation5/RD00"
file2="/RedshiftOutput00"
list = [11,13,22]
m=0
#for kk in range(20,37):
for kk in list:
fn_i=str(kk)
fn=file1+fn_i+file2+fn_i # parameter file to load
print fn
pf = load(fn) # load data
pc = PlotCollection(pf, center=[0.5,0.5,0.5]) # defaults to center at
most dense point#dd = pf.h.all_data()
p = pc.add_slice("Temperature", 1, figure = fig, axes = axes[0][m],
use_colorbar=False)
p.set_log_field(False)
p.set_zlim(1e4,5e7)
#p.set_cmap("jet")# a different colormap
p.modify["contour"]("Density", ncont=9, plot_args =
{'colors':'w'},clim=(5e-30,5e-25))
#p.modify["contour"]("Temperature", ncont=10, plot_args =
{'colors':'k'},clim=(3e7,1e8))
pc.set_width(15, 'mpc') # change width of all plots in pc
m=m+1
#pc.save("%s_p.png" % pf) # save all plots
for p, cax in zip(pc.plots, colorbars):
cbar = cb.Colorbar(cax, p.image, orientation='vertical')
p.colorbar = cbar
p._autoset_label()
fig.savefig("Temperature_at_rd00_11,13,22" % pf)
The problem is that I am getting the temperature in log scale, even-though
I used p.set_log_field(False)
in my script.
Please suggest me how to get-rid of this problem.
--
Reju Sam John
Ah, that was the problem. After updating all, including updating Cython,
it works fine.
Thanks!
-Kyle
--
Kyle Stewart, Ph.D.
Assistant Professor of Physics
Department of Natural and Mathematical Sciences
California Baptist University
8432 Magnolia Avenue
Riverside, CA 92504
On 8/9/13 10:55 AM, "yt-users-request(a)lists.spacepope.org"
<yt-users-request(a)lists.spacepope.org> wrote:
>Send yt-users mailing list submissions to
> yt-users(a)lists.spacepope.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>or, via email, send a message with subject or body 'help' to
> yt-users-request(a)lists.spacepope.org
>
>You can reach the person managing the list at
> yt-users-owner(a)lists.spacepope.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of yt-users digest..."
>
>
>Today's Topics:
>
> 1. yt-3.0 error on update, now yt doesn't work (Kyle Stewart)
> 2. Re: yt-3.0 error on update, now yt doesn't work (Kacper Kowalik)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Fri, 9 Aug 2013 16:06:26 +0000
>From: Kyle Stewart <kstewart(a)calbaptist.edu>
>To: "yt-users(a)lists.spacepope.org" <yt-users(a)lists.spacepope.org>
>Subject: [yt-users] yt-3.0 error on update, now yt doesn't work
>Message-ID: <CE2A61BA.2EB2%kstewart(a)calbaptist.edu>
>Content-Type: text/plain; charset="us-ascii"
>
>After updating yt (3.0) to the latest version with a simple "yt update"
>command, I got the following error in the update log:
>
>Error compiling Cython file:
>------------------------------------------------------------
>...
> cdef void *tree_root
> cdef int num_root
> cdef int max_root
>
>cdef extern from "search.h" nogil:
> void *tsearch(const void *key, void **rootp,
> ^
>------------------------------------------------------------
>
>yt/geometry/oct_container.pxd:81:29: Expected ')', found '*'
>
>error: 2 errors while compiling 'yt/geometry/oct_container.pyx' with
>Cython
>
>
>
>Now yt won't work at all. If I try to call it I get the error:
>"ImportError: No module named particle_oct_container"
>
>Does anyone know what's going on here?
>Thanks!
>
>-Kyle
>
>--
>Kyle Stewart, Ph.D.
>Assistant Professor of Physics
>Department of Natural and Mathematical Sciences
>California Baptist University
>8432 Magnolia Avenue
>Riverside, CA 92504
>
>
After updating yt (3.0) to the latest version with a simple "yt update" command, I got the following error in the update log:
Error compiling Cython file:
------------------------------------------------------------
...
cdef void *tree_root
cdef int num_root
cdef int max_root
cdef extern from "search.h" nogil:
void *tsearch(const void *key, void **rootp,
^
------------------------------------------------------------
yt/geometry/oct_container.pxd:81:29: Expected ')', found '*'
error: 2 errors while compiling 'yt/geometry/oct_container.pyx' with Cython
Now yt won't work at all. If I try to call it I get the error:
"ImportError: No module named particle_oct_container"
Does anyone know what's going on here?
Thanks!
-Kyle
--
Kyle Stewart, Ph.D.
Assistant Professor of Physics
Department of Natural and Mathematical Sciences
California Baptist University
8432 Magnolia Avenue
Riverside, CA 92504
Dear all,
I am trying to create a muti plot of density's at different red-shift with
the following code.
from yt.mods import *
import matplotlib.colorbar as cb
fig, axes, colorbars = get_multi_plot( 3, 3, colorbar='vertical', bw = 3)
file1="/app/run/csarkar/surajit/simulation_shock/simulation5/RD00"
file2="/RedshiftOutput00"
L = [11,15,18,20,22,25,30,35,40]
#for i in range (0, 8):
for kk in L:
fn_i=str(kk)
fn=file1+fn_i+file2+fn_i
print fn
pf = load(fn)
pc = PlotCollection(pf, center=[0.5, 0.5, 0.5])
for i in range (0,3):
for j in range (0, 3):
p = pc.add_slice("Density", 2, axes = axes[i][j],figure = fig,
use_colorbar=False)
p.set_log_field(True)
p.set_zlim(1e-31,5e-26)
p.set_cmap("jet")
p.modify["contour"]("Density", ncont=10, plot_args =
{'colors':'w'},clim=(2e-28,2e-26))
p.modify["contour"]("Temperature", ncont=10, plot_args =
{'colors':'k'},clim=(3e7,1e8))
#pc.set_width(3.0, 'mpc')
#break
# i = i+1
for p, cax in zip(pc.plots, colorbars):
cbar = cb.Colorbar(cax, p.image, orientation='vertical')
p.colorbar = cbar
p._autoset_label()
fig.savefig("multi_plot_3_3" % pf)
But I am getting a wrong result. It is printing same figure in all panels.
I think my logic(algorithm) is wrong. We have to reverse first two for
loop. But that also making problem. Please help me.
And also if I include the following line in the code. (in my code I
commented it out)
pc.set_width(3.0, 'mpc')
it is showing following error.
*Traceback (most recent call last):*
* File "multi_plot_loop.py", line 24, in <module>*
* pc.set_width(3.0, 'mpc') *
* File
"/data1/pdf/csurajit/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py",
line 292, in set_width*
* plot.set_width(width, unit)*
* File
"/data1/pdf/csurajit/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
line 458, in set_width*
* self._refresh_display_width()*
* File
"/data1/pdf/csurajit/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
line 476, in _refresh_display_width*
* self._redraw_image()*
* File
"/data1/pdf/csurajit/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
line 423, in _redraw_image*
* self._run_callbacks()*
* File
"/data1/pdf/csurajit/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py",
line 263, in _run_callbacks*
* cb(self)*
* File
"/data1/pdf/csurajit/yt-x86_64/src/yt-hg/yt/visualization/plot_modifications.py",
line 312, in __call__*
* self.ncont = np.linspace(self.clim[0], self.clim[1], self.ncont)*
* File
"/data1/pdf/csurajit/yt-x86_64/lib/python2.7/site-packages/numpy/core/function_base.py",
line 74, in linspace*
* num = int(num)*
*TypeError: only length-1 arrays can be converted to Python scalars*
Please suggest me the most efficient way to achieve my goal (create a muti
plot of density's at different red-shift).
--
Reju Sam John
Hi,
I have got problem that concerns Nyx users and/or yt developers.
I want to read the root-grid level from AMR data sets with the following
piece of code:
num_ghost_zones=2
left=na.amin(pf.h.grid_left_edge,axis=0)
right=na.amax(pf.h.grid_right_edge,axis=0)
resolution = (right-left)/pf.h.grids[0]['dx']+2*num_ghost_zones
cg = pf.h.covering_grid(0,left,resolution,num_ghost_zones=num_ghost_zones)
This works for Enzo data sets, but it fails for Nyx data sets. The error
message is
Traceback (most recent call last):
File "/home/h/nipiagws/scripts/spect_sb.py", line 52, in <module>
cg =
pf.h.covering_grid(0,left,resolution,num_ghost_zones=num_ghost_zones)
File
"/home/h/nipschul/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
line 3727, in __init__
self.dds = self.pf.domain_width/rdx.astype("float64")
AttributeError: 'list' object has no attribute 'astype'
The script used to work also for Nyx data sets, with an older version of
yt (about a year ago).
How can this be fixed?
Thanks a lot,
Wolfram
Hello,
I'm trying to make a slice plot of Athena MPI SMR data using
TimeSeriesData, and I find that the code only make slices out of the
base level and blanks out deeper level regions.
Following is how I read in the Athena vtk files:
ts = TimeSeriesData.from_filenames('id0/kh*.vtk', parallel=True)
my_storage={}
for sto,pf in ts.piter(storage=my_storage):
slc = SlicePlot(pf, 'z', 'Density')
slc.set_zlim('Density', 0.0, 3.0)
num = (pf.h.hierarchy_filename).split('.')[1]
slc.save('./slice/'+num)
all my vtk files are in id0, ..., idn where n=number of processors I
used, and I'm only using 1 more level of refinement.
Thanks in advance!
Best Regards,
Eve
Dear yt-users,
I'm trying to use the Rockstar halo finder within yt, and am encountering
some odd problems. I'm using the main development tree (
https://bitbucket.org/yt_analysis/yt) with changeset f936432ed45d, and
attempting to use Rockstar to find halos on a small server running Ubuntu
12.04. When I call this script:
---- file test_rockstar.py ----
from yt.mods import *
from yt.analysis_modules.halo_finding.rockstar.api import RockstarHaloFinder
pf = load("DD0057/data0057")
rh = RockstarHaloFinder(pf)
---
using the command line sequence "mpirun -np 2 python ./test_rockstar.py
--parallel", I seem to be getting a seg fault (as can be seen at
http://paste.yt-project.org/show/3745/). However, if I use a single
processor (with "mpirun -np 1 python ./test_rockstar.py --parallel"), I get
a very different error:
Traceback (most recent call last):
File "./test_rockstar.py", line 6, in <module>
rh = RockstarHaloFinder(pf)
File
"/data/bwoshea/galparttest/yt-x86_64/src/yt-hg/yt/analysis_modules/halo_finding/rockstar/rockstar.py",
line 230, in __init__
self.pool, self.workgroup = self.runner.setup_pool()
File
"/data/bwoshea/galparttest/yt-x86_64/src/yt-hg/yt/analysis_modules/halo_finding/rockstar/rockstar.py",
line 112, in setup_pool
(self.num_writers, "writers") ]
File
"/data/bwoshea/galparttest/yt-x86_64/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py",
line 335, in from_sizes
pool.add_workgroup(size, name = name)
File
"/data/bwoshea/galparttest/yt-x86_64/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py",
line 303, in add_workgroup
group = self.comm.comm.Get_group().Incl(ranks)
AttributeError: 'NoneType' object has no attribute 'Get_group'
I'm puzzled about the error, since I can use other parallel yt scripts
without any problems (a 4-processor script making projections works just
fine). This machine doesn't have infiniband (as warned about at
http://yt-project.org/doc/analysis_modules/running_halofinder.html#rockstar…),
and both FOF and Hop find several hundred halos with my dataset. I'd just
use another halo finder, but I'm trying to do something that requires
Rockstar to be run inline with Enzo, so I'm stuck with it...
Does anybody have any idea what might be going on?
Thanks!
Brian
Hi all,
I'm attempting to visualize multiple variables in the same volume
rendering. For instance, I'd like to show some density surfaces of a star
and then get temperature overlayed to show hotspots. I found the
MultiVariateTransferFunction, but it is unfortunately not particularly well
documented yet, and I'm being repeatedly thwarted. I'm not sure if I've set
it up correctly, or how to go from the transfer function to an image.
Here's my current script, using just one variable for now:
#----------------------------------
from yt.mods import *
pf = load('plt00100')
#<some constants>
pf.h
pf.field_info['density'].take_log=True
mv = MultiVariateTransferFunction()
tf = TransferFunction((mi-1, ma+1), nbins=1.0e6)
tf.add_gaussian(np.log10(9.0e5), 0.01, 1.0)
mv.add_field_table(tf, 0)
mv.link_channels(0, [0,1,2,3])
c = [5.0e9, 5.0e9, 5.0e9]
L = [0.15, 1.0, 0.40]
W = wi*0.7
Nvec = 1024
cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = mv,
fields=['density'], pf=pf, no_ghost=True)
im = cam.snapshot(num_threads=4)
im.write_png('plt00100.png' )
#----------------------------------
I checked to make sure density is indeed my 0-index field. I get the
following error after ray casting:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "multivol.py", line 153, in <module>
im = cam.snapshot(num_threads=4)
File
"/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",
line 742, in snapshot
image, sampler),
File
"/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",
line 632, in _render
image = self.finalize_image(image)
File
"/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",
line 611, in finalize_image
if self.transfer_function.grey_opacity is False:
AttributeError: 'MultiVariateTransferFunction' object has no attribute
'grey_opacity'
Can I not use snapshot in this case, or is something else the matter
entirely?
Thanks,
Noel Scudder
Dear all,
I am trying to visualize the density slices of my simulation output at
different red-shift. But the output files
(RedshiftOutput0010_Slice_z_Density.png to
RedshiftOutput0058_Slice_z_Density.png) are density color coded
differently. My problem is how to make the density color code scale common
for all.
--
Reju Sam John