[Yt-svn] New issue 308 in yt: callbacks on phase plots don't work

Bitbucket issues-noreply at bitbucket.org
Sat Sep 24 08:42:32 PDT 2011


--- you can reply above this line ---

New issue 308: callbacks on phase plots don't work
https://bitbucket.org/yt_analysis/yt/issue/308/callbacks-on-phase-plots-dont-work

Christine Simpson / cms2166 on Sat, 24 Sep 2011 17:42:32 +0200:

Description:
  Hi all,

It seems that callbacks on phase plots don't work.  I've tried to add text to a phase plot in this way:

pc.add_phase_sphere(r200[j],'kpc',["Density","Temperature","CellMassMsun"],weight = None)

pc.set_zlim(1.0e-2,1.0e5)

pc.set_xlim(1.0e-30,5.0e-19)

pc.set_ylim(10.0,1.0e7)  

pc.plots[-1].modify["text"]([0.92,0.92],redshift_string)

pc.save("output_%(file_num)s_branch_%(br)i" % {"file_num":fn,"axis":ax,"br":branch_index[j]})

And I get this error:

Traceback (most recent call last):
  File "test_phase_plots.py", line 41, in <module>
    pc.save("output_%(file_num)s_branch_%(br)i" % {"file_num":fn,"axis":ax,"br":branch_index[j]})
  File "/share/home/01112/tg803911/yt_17May2011/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py", line 157, in save
    override=override, force_save=force_save))
  File "/share/home/01112/tg803911/yt_17May2011/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py", line 108, in save_image
    self._redraw_image()
  File "/share/home/01112/tg803911/yt_17May2011/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py", line 903, in _redraw_image
    self._run_callbacks()
  File "/share/home/01112/tg803911/yt_17May2011/yt-x86_64/src/yt-hg/yt/visualization/plot_types.py", line 800, in _run_callbacks
    cb(self)
  File "/share/home/01112/tg803911/yt_17May2011/yt-x86_64/src/yt-hg/yt/visualization/plot_modifications.py", line 910, in __call__
    y = plot.image._A.shape[1] * self.pos[1]
IndexError: tuple index out of range

The error arises in the save command, but the issue is the modify["text"] command.  This issue arises only when I use this command or the modify["image_line"] callback.  I have tried to use that callback in this way:

pc.plots[-1].modify["image_line"]([5e-24,1e7],[5e-19,1e2])

In the exact same place in the code and I get the same error.

The text callback works fine on projections, this seems to be an issue with phase plots specifically.


Responsible:
  jsoishi
--

This is an issue notification from bitbucket.org. You are receiving
this either because you are the owner of the issue, or you are
following the issue.



More information about the yt-svn mailing list