[Chimera-users] Re: [chimera-dev] regd error when opening a .mrc file

Thomas Goddard goddard at cgl.ucsf.edu
Wed Jun 30 22:50:50 PDT 2004


Hi Sandeep,

  This error indicates that the mrc file data values are all zero.
The error occured when making the histogram that is shown in the
Volume Viewer dialog, when it was trying to scale it to fit the width
of the dialog.  Of course, our code should not generate an error in
this case.  I will fix it for the next release.

  If you will be opening mrc files that may be all zero you can
change chimera/share/VolumeViewer/histogram.py line 26

    hscale = float(cheight) / max_height

to

    if max_height == 0:
      hscale = 1
    else:
      hscale = float(cheight) / max_height

Then you will not get any error and the histogram will display correctly.

  Thanks for pointing out this problem.

  I am not familiar with pdb2mrc so I do not know why it is generating
a volume consisting of all zeros.

	Tom



> Date: Wed, 30 Jun 2004 21:33:12 -0600
> From: Sandeep N Seshadri <sandeep at nmsu.edu>
> To: chimera-dev at cgl.ucsf.edu
> Subject: [chimera-dev] regd error when opening a .mrc file
> 
> i am getting the following error when i try to open a .mrc file . i generated a
> .pdb file and use a pdb2mrc to generate a .mrc file . i tried opening the .pdb
> file it works fine but when i try to open the .mrc file it gives the error. 
> 
> if anyone has any idea on why this error occurs please let me know
> 
> thanks 
> sandeep
> 
> 
> Error while processing test-helix.mrc:
> ZeroDivisionError: float division
> (see reply log for Python traceback info)
> Traceback (most recent call last):
>   File "/home/sandeep/chimera/share/__main__.py", line 56, in ?
>     value = chimeraInit.init(sys.argv)
>   File "/home/sandeep/chimera/share/chimeraInit.py", line 275, in init
>     prefixableType=1)
>   File "/home/sandeep/chimera/share/chimera/__init__.py", line 886, in open
>     models = func(filename, *args, **kw)
>   File "/home/sandeep/chimera/share/VolumeViewer/ChimeraExtension.py", line 30,
> in open_cb
>     d.add_data_sets([g])
>   File "/home/sandeep/chimera/share/VolumeViewer/__init__.py", line 175, in
> add_data_sets
>     self.redisplay_cb()
>   File "/home/sandeep/chimera/share/VolumeViewer/__init__.py", line 459, in
> redisplay_cb
>     self.show_using_dialog_settings(self.focus_region)
>   File "/home/sandeep/chimera/share/VolumeViewer/__init__.py", line 380, in
> show_using_dialog_settings
>     tp.update_histograms(data_region)
>  File "/home/sandeep/chimera/share/VolumeViewer/__init__.py", line 1142, in
> update_histograms
>     cw.update_histogram(data_region, read_matrix, self.dialog.message)
>   File "/home/sandeep/chimera/share/VolumeViewer/__init__.py", line 1465, in
> update_histogram
>     h.show_data(Numeric.log(s.counts + 1))
>   File "/home/sandeep/chimera/share/VolumeViewer/histogram.py", line 26, in
> show_data
>     hscale = float(cheight) / max_height
> ZeroDivisionError: float division


More information about the Chimera-users mailing list