Hi,
I have successful prof(sphere...) and prof2d(sphere...) objects plus the
plots formatted with pylab, but prof3d(sphere...) gives "extrema" error:
>>> prof3d = lagos.BinnedProfile3D(sphere,
... 8,"Density",extrema[0][0],extrema[0][1],True,
... 8,"Temperature",extrema[1][0],extrema[1][1],True,
... 8,"z-velocity",extrema[2][0],extrema[2][1],True,
... lazy_reader=True)
***************************************
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
NameError: name 'extrema' is not defined
help(lagos.BinnedProfile3D) doesn't show
any reference to "extrema"
***************************************
my sphere object:
>>> sphere = a.h.sphere([0.171875,0.21875,0.4453125],100/a["kpc"])
my prof, prof2d objects:
>>> prof =
lagos.BinnedProfile1D(sphere,8,"Radiuskpc",1.5,102.72,True,True)
>>> prof.add_fields(["Density","Temperature"],weight="CellMassMsun")
>>> prof2d =
lagos.BinnedProfile2D(sphere,8,"Density",1e-10,1e-1,True,8,"Temperature",1e2,1e5,True,True)
>>> prof2d.add_fields("CellVolume",weight="CellMassMsun")
Thanks,
-R.Soares
Hi,
I have successful prof(sphere...) and prof2d(sphere...) objects plus the
plots formatted with pylab, but prof3d(sphere...) gives "extrema" error:
>>> prof3d = lagos.BinnedProfile3D(sphere,
... 8,"Density",extrema[0][0],extrema[0][1],True,
... 8,"Temperature",extrema[1][0],extrema[1][1],True,
... 8,"z-velocity",extrema[2][0],extrema[2][1],True,
... lazy_reader=True)
***************************************
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
NameError: name 'extrema' is not defined
help(lagos.BinnedProfile3D) doesn't show
any reference to "extrema"
***************************************
my sphere object:
>>> sphere = a.h.sphere([0.171875,0.21875,0.4453125],100/a["kpc"])
my prof, prof2d objects:
>>> prof =
lagos.BinnedProfile1D(sphere,8,"Radiuskpc",1.5,102.72,True,True)
>>> prof.add_fields(["Density","Temperature"],weight="CellMassMsun")
>>> prof2d =
lagos.BinnedProfile2D(sphere,8,"Density",1e-10,1e-1,True,8,"Temperature",1e2,1e5,True,True)
>>> prof2d.add_fields("CellVolume",weight="CellMassMsun")
Thanks,
-R.Soares
Hi,
I don't know why I'm getting "AssertionError" and "KeyError: 'Density'"
below.
Anyone can explain?
Thanks,
R.Soares
>>> import yt.lagos as lagos
yt.lagos WARNING 2008-09-24 20:26:36,993 No HDF4 support
>>> a = lagos.EnzoStaticOutput("RedshiftOutput0004")
>>> v,c = a.h.find_max("Density")
yt.lagos INFO 2008-09-24 20:27:38,292 Skipping serialization!
yt.lagos INFO 2008-09-24 20:27:38,292 Caching hierarchy
information
yt.lagos INFO 2008-09-24 20:27:38,299 Gathering a field list
(this may take a moment.)
Warning: invalid value encountered in sqrt
Warning: invalid value encountered in divide
Warning: invalid value encountered in divide
Warning: invalid value encountered in sqrt
yt.lagos INFO 2008-09-24 20:27:38,799 Max Value is 1.75364e-25
at 0.2890625000000000 0.2812500000000000 0.4843750000000000 in grid
Grid_0001 at level 0 [36 35 61]
>>> print v
1.75364112031e-25
>>> print c
[ 0.2890625 0.28125 0.484375 ]
>>> sphere = a.h.sphere([0.5,0.5,0.5],0.1/a["kpc"])
>>> prof =
lagos.BinnedProfile1D(sphere,16,"Radiuskpc",0.0001,0.1,True,True)
>>> prof.add_fields(["Density"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/robyn/yt-pentiumD/lib/python2.5/site-packages/yt/lagos/Profiles.py", line 105, in add_fields
self._lazy_add_fields(fields, weight, accumulation)
File
"/home/robyn/yt-pentiumD/lib/python2.5/site-packages/yt/lagos/Profiles.py", line 64, in _lazy_add_fields
pbar = get_pbar('Binning grids', len(self._data_source._grids))
File
"/home/robyn/yt-pentiumD/lib/python2.5/site-packages/yt/funcs.py", line
127, in get_pbar
maxval=maxval).start()
File
"/home/robyn/yt-pentiumD/lib/python2.5/site-packages/yt/progressbar.py",
line 213, in __init__
assert maxval > 0
AssertionError
>>> print prof["Density"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/robyn/yt-pentiumD/lib/python2.5/site-packages/yt/lagos/Profiles.py", line 115, in __getitem__
return self._data[key]
KeyError: 'Density'
Hi everyone,
I've merged a bunch of changes from the parallel_profiles branch back
into trunk. This means that projections and ("lazy") profiles are now
transparently parallelized if you have mpi4py (mpi4py.scipy.org)
installed. Un-lazy profiles are not, however, so that means you will
need to (for now) know your min/max before you execute any profiles in
parallel.
To take advantage of the parallel projections and profiles you only
need to install mpi4py. If you are running off trunk, the following
command, if executed through mpirun, will be transparently parallel.
(In fact, the plots will only be saved on the head node, as well.)
--
from yt.mods import *
pf = EnzoStaticOutput("galaxy1200.dir/galaxy1200")
pc = PlotCollection(pf)
pc.add_projection("Density", 0)
pc.add_profile_sphere(0.1, '1', ["Density","Temperature"],
lazy_reader=True, x_bounds=(1e-31,1e-24))
pc.add_phase_sphere(0.1, '1', ["Density","Temperature","VelocityMagnitude"],
lazy_reader=True, x_bounds=(1e-31,1e-24), y_bounds=(1e1,1e8))
pc.save("par")
--
Soon un-lazy profiles will be parallel as well, and then simpler
commands like add_profile_sphere(width, unit, fields) will be
parallelized by default.
Let me know if you run into any problems. All of the unit tests pass,
and I've tested in parallel and out of parallel and it all seems to
work, but this change also touches a couple different places in the
code so it could be a bit problematic for some corner cases.
Another side effect of this change is that parallel data analysis now
uses a much more efficient IO subsystem for the Packed HDF5 output. A
single file open is executed on each CPU file, rather than one for
every grid.
-Matt
Hi guys,
There are two new things I've found it necessary to add lately. These
are only in trunk/ , so if you're on branches/yt-1.0 , you won't have
them. (They might not be stable yet anyway!)
The first is a hop circle callback. It accepts the output from Hop
and adds on circles at the halo centers with the maximum particle
radius as the radius of the circle. Here is a full example script,
where it looks for halos in the *entire* dataset, then projects
density and overplots the halo positions. You can also feed in a
max_number argument to the HopCircleCallback, and it will only plot
the first N halos, in order of decreasing mass.
--
pf = EnzoStaticOutput("my_data0001.dir/my_data0001")
hop = hop.HopList(pf.h.sphere([0.5]*3, 1.00))
pc = PlotCollection(pf,center=[0.5]*3)
for ax in range(3):
pc.add_projection("Density", ax)
pc.plots[ax].add_callback(HopCircleCallback(hop, ax))
--
The other new addition is periodic plots. For this one, you can now do:
--
pf = EnzoStaticOutput("my_data0001.dir/my_data0001")
pc = PlotCollection(pf,center=[0.5, 0.8, 0.8])
pc.add_projection("Density", 0, periodic=True)
--
note that the only difference is the keyword argument periodic=True.
This will wrap your plot around based on its current center and the
size of the domain. (It should respect axially-dependent
DomainLeftEdge and DomainRightEdge.)
Additionally -- for those of you that have read all the way to the
bottom -- I started working on a profile to use inside IPython
(ipython.scipy.org), which is just the most amazing Python shell in
the world. Jeff Oishi is more of an IPython expert than I am, so
he'll be adding to it and cleaning up my mistakes, but the end result
is going to be that the operations of moving around, opening data,
recursively finding data and examining data are all going to be
simplified significantly. Much of the verbosity of the scripting
interface is going to be hidden from the user and the guts will be
more easily exposed.
Have a good one!
-Matt