Actions
Bug #1470
closedFrealign prep dtype float32 error
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