Hi, all--
Is it possible to make a 2d radial profile from a projection with the
existing profile tool?
I think a better question is how do I make an extraction from a
projection that I can then hand to BinnedProfile1d?
Thanks,
d.
--
Sent from my Stone Tablet and carried by my Pterodactyl.
Hi guys,
I sometimes have particles in my sims and when i do I want to plot them. At
the moment I have:
if sp["ParticleMassMsun"].size > 0:
p.modify["particles"](1.0, p_size=10.0, col='k')
but if there are no particles I get this error message:
yt INFO 2010-04-16 11:58:29,408 Getting ParticleMassMsun using
ParticleIO
Traceback (most recent call last):
File "Density_movie.py", line 29, in <module>
if sp["ParticleMassMsun"].size > 0:
File
"/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
line 249, in __getitem__
self.get_data(key)
File
"/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
line 1636, in get_data
self[field] = self.particles[field]
File
"/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/ParticleIO.py",
line 45, in __getitem__
return self.get_data(key)
File
"/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/ParticleIO.py",
line 91, in get_data
conv_factors)
File
"/scratch/YT-x86_64/lib/python2.5/site-packages/yt-2.0dev-py2.5-linux-x86_64.egg/yt/lagos/DataReadingFuncs.py",
line 206, in _read_particles
filenames, ids, conv_factors = zip(*sorted(zip(filenames, ids,
conv_factors)))
ValueError: need more than 0 values to unpack
Can anyone think of a better if statement to check if i have particles that
doesn't crash YT if there isn't?
Many thanks,
Libby
--
Elizabeth Harper-Clark MA MSci
PhD Candidate, Astrophysics, UofT
www.astro.utoronto.ca/~h-clark
h-clark(a)cita.utoronto.ca
AIM: edphc1
MSN: edphc1(a)hotmail.com
Skype: eharperclark
Office phone: 416-978-5759
I just installed yt 1.6 (stable branch) for the first time. I ran
into some trouble with the wxPython installation. I realize that it's an
optional component, but since I found a solution to my problem,
I thought I'd share it here.
I'm installing yt on an x86_64 machine running Ubuntu 9.04,
2.6.28-18. The error I got during the wxPython installation was:
src/gtk/_gdi_wrap.cpp:31407: error: ‘class wxGraphicsRenderer’ has no
member named ‘CreateBitmap’
Some googling revealed this:
http://groups.google.com/group/wxPython-users/browse_thread/thread/129ba27e…
Applying the patch discussed at the end of that thread allowed
the compilation of wxPython to complete successfully. To be more
specific, you need to add this one line
wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const {
return wxNullGraphicsBitmap; }
after line 4197 in the file
$YT_DIR/src/wxPython-src-2.8.10.1/wxPython/src/gtk/_gdi_wrap.cpp.
Might be worth including this patch in the version of wxPython
that is downloaded from yt.enzotools.org.
Mike
--
*********************************************************************
* *
* Dr. Michael Kuhlen Theoretical Astrophysics Center *
* email: mqk(a)astro.berkeley.edu UC Berkeley *
* cell phone: (831) 588-1468 601 Campbell Hall *
* skype username: mikekuhlen Berkeley, CA 94720 *
* *
*********************************************************************
Dear all,
by comparing volume renderings and projections in my simulation I realised
that I don't have control on the projection depth, in the latter case.
This is the relevant part of my script:
...
L = 0.1 # projection width
pf = load(data_dir+fn) # load data
reg = pf.h.region([0.5, 0.5, 0.5],[0.45,0.45,0.45],[0.55,0.55,0.55]) # a small
region
#reg = pf.h.region([0.5, 0.5, 0.5],[0,0,0],[1,1,1]) # the whole box
pc = PlotCollection(reg, center=[0.5,0.5,0.5])
p = pc.add_projection("Density", 0, weight_field="Density",fig_size=(7.5,6))
p.modify["contour"]("Density", ncont=5,take_log=True)
pc.set_width(L, '1')
pc.save("%s_test-proj" % pf,override=True)
If I set L = 0.2, I don't see in the central region of the projection more
structures than with L=0.1 (only the plot width is, of course, larger).
Moreover, the result do not depend on the region that I select (either third
or fourth line). It seems to me that, in all cases, the projection is
actually performed along the whole simulation box, and not on the region that
I select. In other words, I can control the plot width, but not the
projection depth. In the volume rendering, on the other hand, the plot width
sets the depth, too. Is anything wrong or missing in my script?
If needed, I can send you a few explanatory plots and the whole sample script
for reproducing my issue.
Looking forward to your suggestions,
Luigi
--
---------------------------------------------------------------
Luigi Iapichino
Zentrum fuer Astronomie der Universitaet Heidelberg
Institut fuer Theoretische Astrophysik
Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany
Tel: +49 6221 548983, Fax: +49 6221 544221
e-mail: luigi(a)ita.uni-heidelberg.de
URL: http://www.ita.uni-heidelberg.de/~luigi/
Dear all,
I get the following error when trying to plot a radial profile of the
density. Does anyone have an idea how to solve this ?
Thanks a lot,
Jean-Claude
#####################################################################################################################
In [42]: ls
CommonEnvelope0001 CommonEnvelope0001.configure CommonEnvelope0001.harrays CommonEnvelope0001.taskmap0000
CommonEnvelope0001.boundary CommonEnvelope0001.cpu0000 CommonEnvelope0001.hierarchy CommonEnvelope0001.taskmap0001
CommonEnvelope0001.boundary.hdf CommonEnvelope0001.cpu0001 CommonEnvelope0001.memorymap CommonEnvelope0001.yt
In [43]: import yt.raven as R
In [44]: import yt.lagos as L
In [45]: filen = 'CommonEnvelope0001'
In [46]: data = L.EnzoStaticOutput(filen)
In [47]: plot_data = R.PlotCollection(data)
yt INFO 2010-04-06 15:39:02,963 Created plot collection with default plot-center = [0.4921875, 0.4921875, 0.4921875]
In [48]: plot_data.add_profile_sphere(0.5,'1',["Radius", "Density"])
yt INFO 2010-04-06 15:39:56,695 Getting field Radius from 1
yt INFO 2010-04-06 15:39:56,696 Getting field x from 1
yt INFO 2010-04-06 15:39:56,857 Getting field y from 1
yt INFO 2010-04-06 15:39:56,919 Getting field z from 1
yt INFO 2010-04-06 15:39:56,987 Getting field Density from 1
Out[48]: <yt.raven.PlotTypes.Profile1DPlot object at 0x3724d90>
In [49]: plot_data.save('DensityProfile', format = 'png')
---------------------------------------------------------------------------
OverflowError Traceback (most recent call last)
/rpod2/jcpassy/Enzo/enzo/src/yt/scripts/iyt in <module>()
----> 1
2
3
4
5
/rpod2/jcpassy/Enzo/enzo/src/yt/yt/raven/PlotCollection.pyc in save(self, basename, format, override, force_save)
79 fn.append(plot.save_image(basename, \
80 format=format, submit=self._run_id,
---> 81 override=override, force_save=force_save))
82 if self.submit:
83 im = plot.im.copy()
/rpod2/jcpassy/Enzo/enzo/src/yt/yt/raven/PlotTypes.pyc in save_image(self, prefix, format, submit, override, force_save)
110 *override* will force no filename generation beyond the prefix.
111 """
--> 112 self._redraw_image()
113 if not override:
114 self._generate_prefix(prefix)
/rpod2/jcpassy/Enzo/enzo/src/yt/yt/raven/PlotTypes.pyc in _redraw_image(self)
711 func(self.data[self.fields[0]][indices],
712 self.data[self.fields[1]][indices],
--> 713 **self.plot_options)
714 self._autoset_label(self.fields[0], self.set_x_label, 'x')
715 self._autoset_label(self.fields[1], self.set_y_label, 'y')
/rpod2/jcpassy/yt-x86_64/lib/python2.6/site-packages/matplotlib/axes.pyc in loglog(self, *args, **kwargs)
3566 b = self._hold
3567 self._hold = True # we've already processed the hold
-> 3568 l = self.plot(*args, **kwargs)
3569 self._hold = b # restore the hold
3570
/rpod2/jcpassy/yt-x86_64/lib/python2.6/site-packages/matplotlib/axes.pyc in plot(self, *args, **kwargs)
3435
3436
-> 3437 self.autoscale_view(scalex=scalex, scaley=scaley)
3438 return lines
3439
/rpod2/jcpassy/yt-x86_64/lib/python2.6/site-packages/matplotlib/axes.pyc in autoscale_view(self, tight, scalex, scaley)
1625 self.set_xbound(XL)
1626 if scaley and self._autoscaleYon:
-> 1627 YL = self.yaxis.get_major_locator().view_limits(y0, y1)
1628 self.set_ybound(YL)
1629
/rpod2/jcpassy/yt-x86_64/lib/python2.6/site-packages/matplotlib/ticker.pyc in view_limits(self, vmin, vmax)
1117 vmin = minpos
1118
-> 1119 if not is_decade(vmin,self._base): vmin = decade_down(vmin,self._base)
1120 if not is_decade(vmax,self._base): vmax = decade_up(vmax,self._base)
1121
/rpod2/jcpassy/yt-x86_64/lib/python2.6/site-packages/matplotlib/ticker.pyc in is_decade(x, base)
1028 def is_decade(x,base=10):
1029 lx = math.log(x)/math.log(base)
-> 1030 return lx==int(lx)
1031
1032 class LogLocator(Locator):
OverflowError: cannot convert float infinity to integer
#####################################################################################################################
Dear yt-users,
I'm having a very peculiar problem, and I wonder if any of you have
experienced this. I have been using my desktop machine to make tons of
images of some enzo simulations - literally several thousand images at this
point - and yt has mysteriously stopped working. I haven't done anything to
python, attempted to upgrade yt, or anything like that... It just started
throwing errors about 800 images into a script. It seems that I can get
this error by simply typing 'python' and then 'from yt.mods import *'. The
error message is at the end of this email. If anybody could give me some
advice, I'd appreciate it - it seems like it might actually be deeper than
simply a yt problem, though.
Thanks!
--Brian
nibbler:/Users/bwoshea/Desktop/CondBubbleSims/spitzer_0_1_cool%python
Python 2.5.4 (r254:67917, Dec 23 2008, 14:57:27)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from yt.mods import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/yt-2.0dev-py2.5-macosx-10.3-i386.egg/yt/mods.py",
line 32, in <module>
import yt.lagos as lagos
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/yt-2.0dev-py2.5-macosx-10.3-i386.egg/yt/lagos/__init__.py",
line 97, in <module>
from OutputTypes import *
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/yt-2.0dev-py2.5-macosx-10.3-i386.egg/yt/lagos/OutputTypes.py",
line 37, in <module>
_pf_store = ParameterFileStore()
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/yt-2.0dev-py2.5-macosx-10.3-i386.egg/yt/fido/ParameterFileStorage.py",
line 73, in __init__
self._records = self.read_db()
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/yt-2.0dev-py2.5-macosx-10.3-i386.egg/yt/fido/ParameterFileStorage.py",
line 211, in read_db
else: v['last_seen'] = float(v['last_seen'])
ValueError: invalid literal for float(): EnzoStaticOutput
>>>