Project

General

Profile

Actions

Bug #1470

closed

Frealign prep dtype float32 error

Added by Lauren Fisher over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Python scripting
Target version:
Start date:
11/18/2011
Due date:
% Done:

0%

Estimated time:
Affected Version:
Appion/Leginon 2.2.0 (trunk)
Show in known bugs:
No
Workaround:

Description

Hey Jim,
Niko and I were trying to do a frealign job today and came across a bug with prepRefineFrealign. Here is the error we are getting:

Traceback (most recent call last):
  File "/home/lfisher/myami/appion/bin/prepRefineFrealign.py", line 192, in ?
    app.start()
  File "/home/lfisher/myami/appion/appionlib/apPrepRefine.py", line 336, in start
    self.__processStack(prepdata)
  File "/home/lfisher/myami/appion/appionlib/apPrepRefine.py", line 297, in __processStack
    self.convertToRefineStack()
  File "/home/lfisher/myami/appion/bin/prepRefineFrealign.py", line 110, in convertToRefineStack
    self.ImagicStackToFrealignMrcStack()
  File "/home/lfisher/myami/appion/bin/prepRefineFrealign.py", line 94, in ImagicStackToFrealignMrcStack
    apIMAGIC.convertImagicStackToMrcStack(stackroot,stackbaseroot+'.mrc')
  File "/home/lfisher/myami/appion/appionlib/apIMAGIC.py", line 410, in convertImagicStackToMrcStack
    imagic2mrc.imagic_to_mrc(infile,outfile)
  File "/home/lfisher/myami/pyami/imagic2mrc.py", line 22, in imagic_to_mrc
    print pyami.mrc.numpy2mrc[mrc_header['dtype']]
KeyError: dtype('float32')

Using Python 2.4.3, imagic.py code_to_dtype is setting dtype to float32 instead of numpy.float32, which causes the keyerror in imagic2mrc.py.
Anchi provided assistance and when we changed the code from:

code_to_dtype = {
    numpy.frombuffer('REAL', numpy.int32)[0]:  numpy.dtype(numpy.float32),
    # ...
}

to:
code_to_dtype = {
    numpy.frombuffer('REAL', numpy.int32)[0]:  numpy.float32,
    # ...
} 

it solved the issue.

Actions #1

Updated by Lauren Fisher over 12 years ago

  • Category set to Python scripting
  • Assignee set to Jim Pulokas
Actions #2

Updated by Anchi Cheng over 12 years ago

Got the same error. Somehow imagic_header is not numpy. As a workaround, I commented out the offending line in imagic2mrc.py in my sandbox and it worked.

Jim. please still investigate.

Actions #3

Updated by Anchi Cheng over 12 years ago

  • Target version set to Appion/Leginon 2.2.0
  • Affected Version changed from Appion/Leginon 2.1.0 to Appion/Leginon 2.2.0 (trunk)
Actions #4

Updated by Anchi Cheng over 12 years ago

  • Status changed from New to In Test
  • Assignee changed from Jim Pulokas to Lauren Fisher

Jim fixed the bug (my workaround didn't work) in r16262

Actions #5

Updated by Amber Herold about 12 years ago

Can this be closed? It is a very small low risk change and the code has been in for 3 months and it sounds like you may have run Jims fix Anchi?

Actions #6

Updated by Anchi Cheng about 12 years ago

I did test it, when I updated the issue. Just wanted to make sure the reporter has a chance to test.

Actions #7

Updated by Lauren Fisher about 12 years ago

  • Status changed from In Test to Closed
Actions

Also available in: Atom PDF