Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. import genfire as gf
  2. import sys, os, shutil
  3. import argparse
  4.  
  5. # Parse command line arguments.
  6. parser = argparse.ArgumentParser()
  7. parser.add_argument("fileroot", help="There should be an aligned tomo stack named fileroot_aligned.npy in the directory and a the reconstruction will be named fileroot_reconstruction.mrc.")
  8. parser.add_argument("-n", "--numIterations", help="Default number of GENFIRE iterations. See GENFIRE documentation. Default=100.", type=int, default=100, action="store")
  9. parser.add_argument("-o", "--oversamplingRatio", help="How many times bigger to make the fourier space. Bigger is more accurate, but you may run out of memory. See GENFIRE documentation. Default=4.", type=int, default=4, action="store")
  10. args = parser.parse_args()
  11.  
  12. # Make a reconstruction using paramaters from default or from the command line.
  13. GF = gf.reconstruct.GenfireReconstructor(
  14. projections = f"{args.fileroot}_aligned.npy",
  15. eulerAngles = "tilts.txt",
  16. resultsFilename = f"{args.fileroot}_reconstruction.mrc",
  17. numIterations = args.numIterations,
  18. interpolationCutoffDistance=0.7,
  19. oversamplingRatio=args.oversamplingRatio,
  20. resolutionExtensionSuppressionState=2,
  21. )
  22.  
  23. # Number crunch.
  24. results = GF.reconstruct()
  25.  
  26. # Save results.
  27. gf.fileio.saveResults(results, GF.params.resultsFilename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement