time_series_phase plots & missing color bars
Hello fellow yt users! I'm new at yt and have been working through the cookbook for a few days now. So far I've got 2 issues that I cannot resolve. I'm trying to make Phase diagrams (using time_series_phase.py form the cookbook), and I'm getting the following error on the SDSC cluster Triton (who's environment & installations were set up by Matt Turk): [hipacc-16@login-4-0 unigrid]$ python time_series_phase.py /projects/lca-group/local-dev/lib/python2.6/site-packages/pytz/__init__.py:29: UserWarning: Module readline was already imported from /projects/lca-group/local-dev/lib/python2.6/lib-dynload/readline.so, but /projects/lca-group/local-dev/lib/python2.6/site-packages is being added to sys.path from pkg_resources import resource_stream yt INFO 2010-07-30 16:56:57,368 Created plot collection with default plot-center = [0.5, 0.5, 0.5] yt INFO 2010-07-30 16:56:57,380 Getting the binary hierarchy yt INFO 2010-07-30 16:56:57,383 Finished with binary hierarchy reading yt INFO 2010-07-30 16:56:57,487 Getting field Density from 8 yt INFO 2010-07-30 16:56:57,536 Getting field Temperature from 8 yt INFO 2010-07-30 16:56:57,743 Getting field CellMassMsun from 8 yt INFO 2010-07-30 16:56:57,743 Getting field CellVolume from 8 yt INFO 2010-07-30 16:56:57,743 Getting field dx from 8 yt INFO 2010-07-30 16:56:57,774 Getting field dy from 8 yt INFO 2010-07-30 16:56:57,806 Getting field dz from 8 yt INFO 2010-07-30 16:56:59,331 Saved DD0000_Profile2D_0_Density_Temperature_CellMassMsun.png yt INFO 2010-07-30 16:56:59,338 Created plot collection with default plot-center = [0.5, 0.5, 0.5] yt INFO 2010-07-30 16:56:59,343 Getting the binary hierarchy yt INFO 2010-07-30 16:56:59,346 Finished with binary hierarchy reading yt INFO 2010-07-30 16:56:59,448 Getting field Density from 8 yt INFO 2010-07-30 16:56:59,494 Getting field Temperature from 8 Traceback (most recent call last): File "time_series_phase.py", line 23, in <module> y_bins=128, y_bounds = (1e2, 1e7)) File "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/raven/plot_collection.py", line 1130, in add_phase_sphere lazy_reader, id, axes, figure, fractional) File "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/raven/plot_collection.py", line 1015, in add_phase_object lazy_reader) File "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/Profiles.py", line 402, in __init__ self._args = self._get_bins(data_source) File "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/Profiles.py", line 47, in save_state tr = func(*args, **kwargs) File "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/Profiles.py", line 453, in _get_bins raise EmptyProfileData() yt.lagos.Profiles.EmptyProfileData [hipacc-16@login-4-0 unigrid]$ After all this is spit out there is a single PNG in the directory, when there should be ~27. I tried it with both lazy_reading on and off, both yield the same result. My second issue is that I'm not getting color bars when making multiplots through the use of multi_plot.py. Here is the script (slightly altered from the cookbook) I am using: from yt.mods import * # set up our namespace orient = 'horozontal' for i in range(0,27): fn = "RD%04i/RedshiftOutput%04i" % (i,i) # parameter file to load pf = load(fn) # load data fig, axes, colorbars = raven.get_multi_plot(3, 1, colorbar=orient, bw=4) pc = PlotCollection(pf, center=[0.5,0.5,0.5]) p = pc.add_projection("Density", 0, figure=fig, axes = axes[0][0], use_colorbar\ =False) pc.set_cmap("bds_highcontrast") p = pc.add_projection("Temperature", 0, figure=fig, axes=axes[0][1], use_colorb\ ar=False) p = pc.add_projection("particle_density_pyx", 0, figure=fig, axes=axes[0][2], u\ se_colorbar=False) for p, cax in zip(pc.plots, colorbars): cbar = cb.Colorbar(cax, p.image, orientation=orient) p.colorbar = cbar p._autoset_label() fig.savefig("%s_projection" % pf) And it produces images like this: http://img.photobucket.com/albums/v321/mons00n/RedshiftOutput0009_projection... I'm quite happy to be getting results, but no idea on how to fix the missing color bar problem. Thanks for your time! -Robert Thompson
On 1 Aug 2010, at 02:09, Robert Thompson wrote:
Hello fellow yt users!
I'm new at yt and have been working through the cookbook for a few days now. So far I've got 2 issues that I cannot resolve. I'm trying to make Phase diagrams (using time_series_phase.py form the cookbook), and I'm getting the following error on the SDSC cluster Triton (who's environment & installations were set up by Matt Turk):
[snip]
My second issue is that I'm not getting color bars when making multiplots through the use of multi_plot.py. Here is the script (slightly altered from the cookbook) I am using:
from yt.mods import * # set up our namespace orient = 'horozontal' for i in range(0,27): fn = "RD%04i/RedshiftOutput%04i" % (i,i) # parameter file to load pf = load(fn) # load data fig, axes, colorbars = raven.get_multi_plot(3, 1, colorbar=orient, bw=4) pc = PlotCollection(pf, center=[0.5,0.5,0.5]) p = pc.add_projection("Density", 0, figure=fig, axes = axes[0][0], use_colorbar\ =False) pc.set_cmap("bds_highcontrast") p = pc.add_projection("Temperature", 0, figure=fig, axes=axes[0][1], use_colorb\ ar=False) p = pc.add_projection("particle_density_pyx", 0, figure=fig, axes=axes[0][2], u\ se_colorbar=False) for p, cax in zip(pc.plots, colorbars): cbar = cb.Colorbar(cax, p.image, orientation=orient) p.colorbar = cbar p._autoset_label() fig.savefig("%s_projection" % pf)
Hi Robert, I don't know how to solve your first problem, but I see the problem in your second issue. You misspelled 'horizontal'. So I think that'll solve your missing colorbar problem. John
After correcting my silly spelling mistake I am now getting an issue saying that the name 'cb' is not defined. [hipacc-16@login-4-0 unigrid]$ python multi_all_projection.py /projects/lca-group/local-dev/lib/python2.6/site-packages/pytz/__init__.py:29: UserWarning: Module readline was already imported from /projects/lca-group/local-dev/lib/python2.6/lib-dynload/readline.so, but /projects/lca-group/local-dev/lib/python2.6/site-packages is being added to sys.path from pkg_resources import resource_stream 1.0 0.714285714286 yt INFO 2010-08-01 14:25:11,864 Created plot collection with default plot-center = [0.5, 0.5, 0.5] yt INFO 2010-08-01 14:25:11,875 Getting the binary hierarchy yt INFO 2010-08-01 14:25:11,878 Finished with binary hierarchy reading Traceback (most recent call last): File "multi_all_projection.py", line 27, in <module> cbar = cb.Colorbar(cax, p.image, orientation=orient) NameError: name 'cb' is not defined [hipacc-16@login-4-0 unigrid]$ Thanks again. -Robert Thompson On Aug 1, 2010, at 8:51 AM, John Wise wrote:
On 1 Aug 2010, at 02:09, Robert Thompson wrote:
Hello fellow yt users!
I'm new at yt and have been working through the cookbook for a few days now. So far I've got 2 issues that I cannot resolve. I'm trying to make Phase diagrams (using time_series_phase.py form the cookbook), and I'm getting the following error on the SDSC cluster Triton (who's environment & installations were set up by Matt Turk):
[snip]
My second issue is that I'm not getting color bars when making multiplots through the use of multi_plot.py. Here is the script (slightly altered from the cookbook) I am using:
from yt.mods import * # set up our namespace orient = 'horozontal' for i in range(0,27): fn = "RD%04i/RedshiftOutput%04i" % (i,i) # parameter file to load pf = load(fn) # load data fig, axes, colorbars = raven.get_multi_plot(3, 1, colorbar=orient, bw=4) pc = PlotCollection(pf, center=[0.5,0.5,0.5]) p = pc.add_projection("Density", 0, figure=fig, axes = axes[0][0], use_colorbar\ =False) pc.set_cmap("bds_highcontrast") p = pc.add_projection("Temperature", 0, figure=fig, axes=axes[0][1], use_colorb\ ar=False) p = pc.add_projection("particle_density_pyx", 0, figure=fig, axes=axes[0][2], u\ se_colorbar=False) for p, cax in zip(pc.plots, colorbars): cbar = cb.Colorbar(cax, p.image, orientation=orient) p.colorbar = cbar p._autoset_label() fig.savefig("%s_projection" % pf)
Hi Robert,
I don't know how to solve your first problem, but I see the problem in your second issue. You misspelled 'horizontal'. So I think that'll solve your missing colorbar problem.
John _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Robert, For the first issue, it looks like the profile is simply empty. My guess is that you've supplied some bounds, inside which no matter falls. For the second issue, make sure that at the top of your script you have: import matplotlib.colorbar as cb (like in the recipe: http://yt.enzotools.org/doc/cookbook/recipes.html#multi-plot-3x2 ) Let us know if there's anything else, Matt On Sun, Aug 1, 2010 at 2:26 PM, Robert Thompson <rthompsonj@gmail.com> wrote:
After correcting my silly spelling mistake I am now getting an issue saying that the name 'cb' is not defined. [hipacc-16@login-4-0 unigrid]$ python multi_all_projection.py /projects/lca-group/local-dev/lib/python2.6/site-packages/pytz/__init__.py:29: UserWarning: Module readline was already imported from /projects/lca-group/local-dev/lib/python2.6/lib-dynload/readline.so, but /projects/lca-group/local-dev/lib/python2.6/site-packages is being added to sys.path from pkg_resources import resource_stream 1.0 0.714285714286 yt INFO 2010-08-01 14:25:11,864 Created plot collection with default plot-center = [0.5, 0.5, 0.5] yt INFO 2010-08-01 14:25:11,875 Getting the binary hierarchy yt INFO 2010-08-01 14:25:11,878 Finished with binary hierarchy reading Traceback (most recent call last): File "multi_all_projection.py", line 27, in <module> cbar = cb.Colorbar(cax, p.image, orientation=orient) NameError: name 'cb' is not defined [hipacc-16@login-4-0 unigrid]$ Thanks again. -Robert Thompson
On Aug 1, 2010, at 8:51 AM, John Wise wrote:
On 1 Aug 2010, at 02:09, Robert Thompson wrote:
Hello fellow yt users! I'm new at yt and have been working through the cookbook for a few days now. So far I've got 2 issues that I cannot resolve. I'm trying to make Phase diagrams (using time_series_phase.py form the cookbook), and I'm getting the following error on the SDSC cluster Triton (who's environment & installations were set up by Matt Turk):
[snip]
My second issue is that I'm not getting color bars when making multiplots through the use of multi_plot.py. Here is the script (slightly altered from the cookbook) I am using: from yt.mods import * # set up our namespace
orient = 'horozontal' for i in range(0,27): fn = "RD%04i/RedshiftOutput%04i" % (i,i) # parameter file to load
pf = load(fn) # load data
fig, axes, colorbars = raven.get_multi_plot(3, 1, colorbar=orient, bw=4) pc = PlotCollection(pf, center=[0.5,0.5,0.5]) p = pc.add_projection("Density", 0, figure=fig, axes = axes[0][0], use_colorbar\ =False) pc.set_cmap("bds_highcontrast") p = pc.add_projection("Temperature", 0, figure=fig, axes=axes[0][1], use_colorb\ ar=False) p = pc.add_projection("particle_density_pyx", 0, figure=fig, axes=axes[0][2], u\ se_colorbar=False) for p, cax in zip(pc.plots, colorbars): cbar = cb.Colorbar(cax, p.image, orientation=orient) p.colorbar = cbar p._autoset_label() fig.savefig("%s_projection" % pf)
Hi Robert, I don't know how to solve your first problem, but I see the problem in your second issue. You misspelled 'horizontal'. So I think that'll solve your missing colorbar problem. John _______________________________________________ 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
participants (3)
-
John Wise
-
Matthew Turk
-
Robert Thompson