Bug #3327
openRemove proc2d from makestack2.py
0%
Description
Part of a larger goal, but first I wanted to remove proc2d from makestack2.py, and make corresponding web changes.
Updated by Neil Voss over 9 years ago
- Related to Feature #2997: create an Appion alternative to EMAN1 proc2d added
Updated by Neil Voss over 9 years ago
- Blocks Bug #2840: Remove EMAN1 functions from Appion added
Updated by Neil Voss over 9 years ago
Done, just a couple of more tests to do before I check it in. Probably best to wait until Monday to check it in, because it is hard to do work over weekend.
Updated by Neil Voss over 9 years ago
Hi Scott, I agree approc2d should be a thing, but it was going to take longer than I had to spend. I would be happy to work on it as well. I have made some changes to your script, I will upload them and you can revert them if you do not like them. Move this discussion to #2997.
Updated by Neil Voss over 9 years ago
- Status changed from Assigned to In Code Review
- Assignee changed from Neil Voss to Anchi Cheng
Changes have been uploaded. makestack2 no longer uses EMAN1 proc2d! Please test and report any failures/bugs/slow downs. Thanks, Neil.
I assigned the code review to Anchi, but I know you are busy.
Updated by Sargis Dallakyan over 9 years ago
I've got an email from NYSBC user who writes:
"I'm able to create a stack however there are no particles in the stack output. The program also runs very quickly, so I don't think it's actually using any of my picked particles..."
I've checked the log file and I see AttributeError: 'numpy.ndarray' object has no attribute 'tobytes' there:
[root@guppy stack8]# tail -50 stack8.appionsub.log ... sorting particles ... received 0 stack particles in 3.46 msec !!! WARNING: file exists but no particles in database, deleting stack file ... Starting at particle number: 0 Beginning Main Loop Starting image 1 ( skip:260, remain:53 ) id:84837, file: 15jun18a_03en ... Pixel size: 1.408 ... Found 398 particles ... Boxing is done on /emg/data00/leginon/cwarren/15jun18a/rawdata/15jun18a_00003en.mrc [CTF run] method: ctffind | runname ctffindrun1 [CTF param] def1: 1.32e-06 | def2: 1.33e-06 | angle: -52.3 | ampcontr 0.15 | defratio 1.012 [CTF stats] conf_30-10: 0.993 | conf_5peak: 0.989 | res_0.8: 5.4A | res_0.5 4.7A ... using ctfvaluesfile: tmp_ctfvaluesfile.txt ... ace2 command: /opt/myamisnap/bin/ace2correct.exe -ctf tmp_ctfvaluesfile.txt -apix 1.408 -img /emg/data00/leginon/cwarren/15jun18a/rawdata/15jun18a_00003en.mrc -out /emg/data00/appion/cwarren/15jun18a/stacks/stack8/15jun18a_00003en.mrc.corrected.mrc -wiener 0.1 ... phaseflipping entire micrograph with defocus 1.323 microns ... boxing 364 particles into temp file: /emg/data00/appion/cwarren/15jun18a/stacks/stack8/15jun18a_03en.hed ... writing stack to disk from memory: /emg/data00/appion/cwarren/15jun18a/stacks/stack8/15jun18a_03en.hed ... wrote 364 particles to header file ... finished in 1.84 sec ... reading stack from disk into memory: 15jun18a_03en.hed ... read 364 particles equaling 28.8 MB in size ... finished in 69.51 msec ... gathering mean and stdev data ... phase flipped whole image already ... 364 particles were boxed out from 15jun18a_03en ... do not break function now otherwise it will corrupt stack ... filtering particles and adding to stack Found 1 ctf values 0.185 -- ctffindrun1 *** 0.185 Traceback (most recent call last): File "/opt/myamisnap/bin/makestack2.py", line 1227, in <module> makeStack.run() File "/opt/myamisnap/lib/appionlib/appionLoop2.py", line 90, in run results = self.loopProcessImage(imgdata) File "/opt/myamisnap/lib/appionlib/appionLoop2.py", line 140, in loopProcessImage return self.processImage(imgdata) File "/opt/myamisnap/lib/appionlib/apParticleExtractor.py", line 510, in processImage total_processed_particles = self.processParticles(imgdata,partdatas,shiftdata) File "/opt/myamisnap/bin/makestack2.py", line 94, in processParticles totalpart = self.mergeImageStackIntoBigStack(self.imgstackfile, imgdata) File "/opt/myamisnap/bin/makestack2.py", line 810, in mergeImageStackIntoBigStack msg=self.params['debug']) File "/opt/myamisnap/lib/appionlib/apImagicFile.py", line 596, in appendParticleListToStackFile mergedata.write(part32bit.tobytes()) AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'
I've searched and found this Stack Overflow link http://stackoverflow.com/questions/18325154/numpy-error-when-creating-gif-using-images2gif-py
We are using Pytohn 2.6 and PIL 1.1.6. I'll try to upgrade to the latest version of Pillow to see if that fixes this.
Updated by Sargis Dallakyan over 9 years ago
r18958 fixes AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'. Installing latest version of Pillow didn't fix this. I've searched the codebase for tobytes and tostring. tobytes is only used in apImagicFile.py, whereas the rest of the code is using tostring. r18958 makes sure that the code works both on guppy and on Neil's computer.
Updated by Neil Voss over 9 years ago
Hi Sargis, Thanks for fixing, I think just using .tostring() all the time would be fine, but I saw the .tobytes() on my system and used it.
.tobytes() was introduced in numpy v1.9, if you have 1.8 or older installed it will fail:
http://docs.scipy.org/doc/numpy-1.9.0/reference/generated/numpy.ndarray.tobytes.html
http://docs.scipy.org/doc/numpy-1.9.0/reference/generated/numpy.ndarray.tostring.html
[This function is a compatibility alias for tobytes. Despite its name it returns bytes not strings.]
I think for simplicity we should change it to just .tostring()
Updated by Neil Voss over 9 years ago
- Assignee changed from Anchi Cheng to Sargis Dallakyan
Updated by Sargis Dallakyan over 9 years ago
Hi Neil, thank you too. Using .tostring() all the time sounds good.
Updated by Anchi Cheng about 9 years ago
- Related to Bug #3656: prepRefineFrealign.py does not convert stack properly added