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 #####################################################################################################################
Hi Jean-Claude, Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object. -Matt On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #####################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi JC, Since the error is on the y-axis, maybe you have a zero or infinite density somewhere in the grid. Could you try doing data.h.find_max("Density") data.h.find_min("Density") to see if you have any corrupt densities ( <=0 or inf) on your grid? j On Tue, Apr 6, 2010 at 4:14 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
#####################################################################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- ---------------- i am dot org: www.jsoishi.org
Hi Jeff, it does not seem there is any corrupt density. Any idea ? JC ######################################################################################################################## In [78]: data.h.find_max("Density") Out[78]: (107.99709, array([ 0.4921875, 0.4921875, 0.4921875])) In [79]: data.h.find_min("Density") yt.lagos INFO 2010-04-07 08:43:12,716 Min Value is 1.00989e-05 at 0.0078125000000000 0.0078125000000000 0.0078125000000000 in grid EnzoGrid_0001 at level 0 Out[79]: (1.0098941e-05, array([ 0.0078125, 0.0078125, 0.0078125])) ######################################################################################################################### j s oishi a écrit :
Hi JC,
Since the error is on the y-axis, maybe you have a zero or infinite density somewhere in the grid. Could you try doing
data.h.find_max("Density") data.h.find_min("Density")
to see if you have any corrupt densities ( <=0 or inf) on your grid?
j
On Tue, Apr 6, 2010 at 4:14 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
#####################################################################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi JC, Strange. Did you try any other quantities? Momenta, energy? Did you try summing the radial profile of the density (there is a recipe: http://yt.enzotools.org/doc/cookbook/recipes.html#sum-mass-in-sphere) to see if there is a problem with the radial profile? j On Wed, Apr 7, 2010 at 8:56 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi Jeff,
it does not seem there is any corrupt density. Any idea ?
JC
########################################################################################################################
In [78]: data.h.find_max("Density")
Out[78]: (107.99709, array([ 0.4921875, 0.4921875, 0.4921875]))
In [79]: data.h.find_min("Density")
yt.lagos INFO 2010-04-07 08:43:12,716 Min Value is 1.00989e-05 at 0.0078125000000000 0.0078125000000000 0.0078125000000000 in grid EnzoGrid_0001 at level 0
Out[79]: (1.0098941e-05, array([ 0.0078125, 0.0078125, 0.0078125]))
#########################################################################################################################
j s oishi a écrit :
Hi JC,
Since the error is on the y-axis, maybe you have a zero or infinite density somewhere in the grid. Could you try doing
data.h.find_max("Density") data.h.find_min("Density")
to see if you have any corrupt densities ( <=0 or inf) on your grid?
j
On Tue, Apr 6, 2010 at 4:14 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
#####################################################################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- ---------------- i am dot org: www.jsoishi.org
Hi Jeff, again, it seems to be working just fine. Strange... The mass units are in Enzo units, right ? JC ############################################################################################ In [66]: from yt.mods import * In [67]: fn = 'CommonEnvelope0001' In [68]: v, c = pf.h.find_max("Density") In [69]: sp = pf.h.sphere(c, 1.0/pf["mpc"]) In [70]: baryon_mass, particle_mass = sp.quantities["TotalQuantity"]( ["CellMassMsun", "ParticleMassMsun"], lazy_reader=True) In [72]: print "Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % (baryon_mass + particle_mass, baryon_mass, particle_mass) -------> print("Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % (baryon_mass + particle_mass, baryon_mass, particle_mass)) Total mass in sphere is 1.00000e+00 (gas = 9.88705e-01 / particles = 1.12978e-02) ############################################################################################ j s oishi a écrit :
Hi JC,
Strange. Did you try any other quantities? Momenta, energy? Did you try summing the radial profile of the density (there is a recipe: http://yt.enzotools.org/doc/cookbook/recipes.html#sum-mass-in-sphere) to see if there is a problem with the radial profile?
j
On Wed, Apr 7, 2010 at 8:56 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi Jeff,
it does not seem there is any corrupt density. Any idea ?
JC
########################################################################################################################
In [78]: data.h.find_max("Density")
Out[78]: (107.99709, array([ 0.4921875, 0.4921875, 0.4921875]))
In [79]: data.h.find_min("Density")
yt.lagos INFO 2010-04-07 08:43:12,716 Min Value is 1.00989e-05 at 0.0078125000000000 0.0078125000000000 0.0078125000000000 in grid EnzoGrid_0001 at level 0
Out[79]: (1.0098941e-05, array([ 0.0078125, 0.0078125, 0.0078125]))
#########################################################################################################################
j s oishi a écrit :
Hi JC,
Since the error is on the y-axis, maybe you have a zero or infinite density somewhere in the grid. Could you try doing
data.h.find_max("Density") data.h.find_min("Density")
to see if you have any corrupt densities ( <=0 or inf) on your grid?
j
On Tue, Apr 6, 2010 at 4:14 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
#####################################################################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Jean-Claude, Those should be solar masses. I wonder if perhaps there's a units problem. After you add your profile but before you save, you can access the data like this: pc.plots[-1].data that should be the profile object itself. We can try looking at the raw data itself: pc.plots[-1].data._data which should be a dictionary containing all of the fields that belong to the profile. Feel free to pickle this: import cPickle; cPickle.dump(pc.plots[-1].data._data, open("temp.cpkl","wb")) and send me and Jeff temp.cpkl off-list. When we resolve the issue we can bring it back on-list. -Matt On Wed, Apr 7, 2010 at 11:48 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi Jeff,
again, it seems to be working just fine. Strange... The mass units are in Enzo units, right ?
JC
############################################################################################
In [66]: from yt.mods import *
In [67]: fn = 'CommonEnvelope0001'
In [68]: v, c = pf.h.find_max("Density")
In [69]: sp = pf.h.sphere(c, 1.0/pf["mpc"])
In [70]: baryon_mass, particle_mass = sp.quantities["TotalQuantity"]( ["CellMassMsun", "ParticleMassMsun"], lazy_reader=True)
In [72]: print "Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % (baryon_mass + particle_mass, baryon_mass, particle_mass)
-------> print("Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % (baryon_mass + particle_mass, baryon_mass, particle_mass))
Total mass in sphere is 1.00000e+00 (gas = 9.88705e-01 / particles = 1.12978e-02)
############################################################################################
j s oishi a écrit :
Hi JC,
Strange. Did you try any other quantities? Momenta, energy? Did you try summing the radial profile of the density (there is a recipe: http://yt.enzotools.org/doc/cookbook/recipes.html#sum-mass-in-sphere) to see if there is a problem with the radial profile?
j
On Wed, Apr 7, 2010 at 8:56 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi Jeff,
it does not seem there is any corrupt density. Any idea ?
JC
########################################################################################################################
In [78]: data.h.find_max("Density")
Out[78]: (107.99709, array([ 0.4921875, 0.4921875, 0.4921875]))
In [79]: data.h.find_min("Density")
yt.lagos INFO 2010-04-07 08:43:12,716 Min Value is 1.00989e-05 at 0.0078125000000000 0.0078125000000000 0.0078125000000000 in grid EnzoGrid_0001 at level 0
Out[79]: (1.0098941e-05, array([ 0.0078125, 0.0078125, 0.0078125]))
#########################################################################################################################
j s oishi a écrit :
Hi JC,
Since the error is on the y-axis, maybe you have a zero or infinite density somewhere in the grid. Could you try doing
data.h.find_max("Density") data.h.find_min("Density")
to see if you have any corrupt densities ( <=0 or inf) on your grid?
j
On Tue, Apr 6, 2010 at 4:14 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
#####################################################################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi guys, you are right. I changed the units and the masses are in solar masses. I enclosed the pickle file. Apparently, the error comes from "Radius" (see below). Why are there only 0 in 'Density' ? Thanks for your help, JC ######################################################################################################### In [127]: filen Out[127]: 'CommonEnvelope0001' In [128]: data Out[128]: CommonEnvelope0001 In [129]: plot_data = R.PlotCollection(data) yt INFO 2010-04-07 12:03:32,415 Created plot collection with default plot-center = [0.4921875, 0.4921875, 0.4921875] In [130]: plot_data.add_profile_sphere(1,'1',["Radius","Density"]) yt INFO 2010-04-07 12:03:52,010 Getting field Radius from 1 yt INFO 2010-04-07 12:03:52,010 Getting field x from 1 yt INFO 2010-04-07 12:03:52,104 Getting field y from 1 yt INFO 2010-04-07 12:03:52,198 Getting field z from 1 yt INFO 2010-04-07 12:03:52,296 Getting field Density from 1 Out[130]: <yt.raven.PlotTypes.Profile1DPlot object at 0x4b16f50> In [131]: data.h.find_max("Density") Out[131]: (107.99709, array([ 0.4921875, 0.4921875, 0.4921875])) In [132]: data.h.find_min("Density") yt.lagos INFO 2010-04-07 12:04:18,813 Min Value is 1.00989e-05 at 0.0078125000000000 0.0078125000000000 0.0078125000000000 in grid EnzoGrid_0001 at level 0 Out[132]: (1.0098941e-05, array([ 0.0078125, 0.0078125, 0.0078125])) In [133]: plot_data.plots[-1].data._data Out[133]: {'Density': array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'Radius': array([ NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 1.73205843e+11]), 'UsedBins': array([False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], dtype=bool)} ######################################################################################################### Matthew Turk a écrit :
Hi Jean-Claude,
Those should be solar masses. I wonder if perhaps there's a units problem. After you add your profile but before you save, you can access the data like this:
pc.plots[-1].data
that should be the profile object itself. We can try looking at the raw data itself:
pc.plots[-1].data._data
which should be a dictionary containing all of the fields that belong to the profile. Feel free to pickle this:
import cPickle; cPickle.dump(pc.plots[-1].data._data, open("temp.cpkl","wb"))
and send me and Jeff temp.cpkl off-list. When we resolve the issue we can bring it back on-list.
-Matt
On Wed, Apr 7, 2010 at 11:48 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi Jeff,
again, it seems to be working just fine. Strange... The mass units are in Enzo units, right ?
JC
############################################################################################
In [66]: from yt.mods import *
In [67]: fn = 'CommonEnvelope0001'
In [68]: v, c = pf.h.find_max("Density")
In [69]: sp = pf.h.sphere(c, 1.0/pf["mpc"])
In [70]: baryon_mass, particle_mass = sp.quantities["TotalQuantity"]( ["CellMassMsun", "ParticleMassMsun"], lazy_reader=True)
In [72]: print "Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % (baryon_mass + particle_mass, baryon_mass, particle_mass)
-------> print("Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % (baryon_mass + particle_mass, baryon_mass, particle_mass))
Total mass in sphere is 1.00000e+00 (gas = 9.88705e-01 / particles = 1.12978e-02)
############################################################################################
j s oishi a écrit :
Hi JC,
Strange. Did you try any other quantities? Momenta, energy? Did you try summing the radial profile of the density (there is a recipe: http://yt.enzotools.org/doc/cookbook/recipes.html#sum-mass-in-sphere) to see if there is a problem with the radial profile?
j
On Wed, Apr 7, 2010 at 8:56 AM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi Jeff,
it does not seem there is any corrupt density. Any idea ?
JC
########################################################################################################################
In [78]: data.h.find_max("Density")
Out[78]: (107.99709, array([ 0.4921875, 0.4921875, 0.4921875]))
In [79]: data.h.find_min("Density")
yt.lagos INFO 2010-04-07 08:43:12,716 Min Value is 1.00989e-05 at 0.0078125000000000 0.0078125000000000 0.0078125000000000 in grid EnzoGrid_0001 at level 0
Out[79]: (1.0098941e-05, array([ 0.0078125, 0.0078125, 0.0078125]))
#########################################################################################################################
j s oishi a écrit :
Hi JC,
Since the error is on the y-axis, maybe you have a zero or infinite density somewhere in the grid. Could you try doing
data.h.find_max("Density") data.h.find_min("Density")
to see if you have any corrupt densities ( <=0 or inf) on your grid?
j
On Tue, Apr 6, 2010 at 4:14 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
#####################################################################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
(dp1 S'Radius' p2 cnumpy.core.multiarray _reconstruct p3 (cnumpy ndarray p4 (I0 tS'b' tRp5 (I1 (I65 tcnumpy dtype p6 (S'f8' I0 I1 tRp7 (I3 S'<' NNNI-1 I-1 I0 tbI00 S'\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\xdf[v\xb5\xef)DB' tbsS'UsedBins' p8 g3 (g4 (I0 tS'b' tRp9 (I1 (I65 tg6 (S'b1' I0 I1 tRp10 (I3 S'|' NNNI-1 I-1 I0 tbI00 S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' tbsS'Density' p11 g3 (g4 (I0 tS'b' tRp12 (I1 (I65 tg7 I00 S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' tbs.
Hi all, So what happened was that the profile object was setting bounds from 0 .. 1e11, because Radius is in CGS. The log spacing of Radius then caused the entire thing to get confused, and all the Densities were set to zero. I resolved this by requiring that the "extrema" selected for bounds be non-zero for all log fields; I think this should also clean up the general process of getting radial profiles as a whole. Both trunk and 1.6 have been updating as of r1682 in SVN. Best, Matt On Wed, Apr 7, 2010 at 12:19 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
Hi guys,
you are right. I changed the units and the masses are in solar masses. I enclosed the pickle file. Apparently, the error comes from "Radius" (see below). Why are there only 0 in 'Density' ?
Thanks for your help,
JC
Hi Matt, nope, the error does not go away. :-( JC Matthew Turk a écrit :
Hi Jean-Claude,
Does the error go away if you supply x_bounds=(1e-30, 1.0) to the add_profile_sphere call? If so, perhaps we just need a better mechanism for guessing the center for calculating radius in the plot collection object.
-Matt
On Apr 6, 2010, at 4:13 PM, Jean-Claude Passy <jcpassy@gmail.com> wrote:
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
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #####################################################################
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
j s oishi
-
Jean-Claude Passy
-
Matthew Turk