additions and bug fixes in script
This commit is contained in:
@@ -13,7 +13,8 @@ python crystfel_split.py -l <path-to-list-file>
|
|||||||
-g <path-to-geom-file>
|
-g <path-to-geom-file>
|
||||||
-c <path-to-cell-file>
|
-c <path-to-cell-file>
|
||||||
-n <name-of-job>
|
-n <name-of-job>
|
||||||
# note -p True/False will make a progress bar
|
|
||||||
|
# crystfel parameter may need some editing in the function - write_crystfel_run
|
||||||
|
|
||||||
# output
|
# output
|
||||||
a series of stream files from crystfel in the current working directory
|
a series of stream files from crystfel in the current working directory
|
||||||
@@ -48,6 +49,11 @@ def h5_split( lst, chunk_size ):
|
|||||||
|
|
||||||
def write_crystfel_run( proc_dir, name, chunk, chunk_lst_file, geom_file, cell_file ):
|
def write_crystfel_run( proc_dir, name, chunk, chunk_lst_file, geom_file, cell_file ):
|
||||||
|
|
||||||
|
"""
|
||||||
|
crystfel run file - spot-finding and indexing parameters may need some editing
|
||||||
|
only change from inside the quote ("")
|
||||||
|
"""
|
||||||
|
|
||||||
# stream file name
|
# stream file name
|
||||||
stream_file = "{0}_{1}.stream".format( name, chunk )
|
stream_file = "{0}_{1}.stream".format( name, chunk )
|
||||||
|
|
||||||
@@ -62,9 +68,21 @@ def write_crystfel_run( proc_dir, name, chunk, chunk_lst_file, geom_file, cell_f
|
|||||||
run_sh.write( " --output={0} \\\n".format( stream_file ) )
|
run_sh.write( " --output={0} \\\n".format( stream_file ) )
|
||||||
run_sh.write( " --geometry={0} \\\n".format( geom_file ) )
|
run_sh.write( " --geometry={0} \\\n".format( geom_file ) )
|
||||||
run_sh.write( " --pdb={0} \\\n".format( cell_file ) )
|
run_sh.write( " --pdb={0} \\\n".format( cell_file ) )
|
||||||
run_sh.write( " --indexing=xgandalf-latt-cell --peaks=peakfinder8 \\\n" )
|
run_sh.write( " --indexing=xgandalf-latt-cell \\\n" )
|
||||||
run_sh.write( " --threshold=15 --min-snr=10 --int-radius=3,5,9 \\\n" )
|
run_sh.write( " --peaks=peakfinder8 \\\n" )
|
||||||
run_sh.write( " -j 32 --no-multi --no-retry --max-res=3000 --min-pix-count=2 --min-res=85\\\n" )
|
run_sh.write( " --integration=rings-grad \\\n" )
|
||||||
|
run_sh.write( " --tolerance=10.0,10.0,10.0,2,3,2 \\\n" )
|
||||||
|
run_sh.write( " --threshold=10 \\\n" )
|
||||||
|
run_sh.write( " --min-snr=5 \\\n" )
|
||||||
|
run_sh.write( " --int-radius=3,5,9 \\\n" )
|
||||||
|
run_sh.write( " -j 32 \\\n" )
|
||||||
|
run_sh.write( " --no-multi \\\n" )
|
||||||
|
run_sh.write( " --check-peaks \\\n" )
|
||||||
|
run_sh.write( " --no-retry \\\n" )
|
||||||
|
run_sh.write( " --max-res=3000 \\\n" )
|
||||||
|
run_sh.write( " --min-pix-count=2 \\\n" )
|
||||||
|
run_sh.write( " --local-bg-radius=4 \\\n" )
|
||||||
|
run_sh.write( " --min-res=85" )
|
||||||
run_sh.close()
|
run_sh.close()
|
||||||
|
|
||||||
# make file executable
|
# make file executable
|
||||||
@@ -107,7 +125,7 @@ def wait_for_jobs( job_ids, total_jobs ):
|
|||||||
job_ids.difference_update(completed_jobs)
|
job_ids.difference_update(completed_jobs)
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
|
|
||||||
def run_splits( cwd, name, lst, chunk_size, geom_file, cell_file, progress ):
|
def run_splits( cwd, name, lst, chunk_size, geom_file, cell_file ):
|
||||||
|
|
||||||
print( "reading SwissFEL lst file" )
|
print( "reading SwissFEL lst file" )
|
||||||
print( "creating {0} image chunks of lst".format( chunk_size ) )
|
print( "creating {0} image chunks of lst".format( chunk_size ) )
|
||||||
@@ -158,7 +176,6 @@ def run_splits( cwd, name, lst, chunk_size, geom_file, cell_file, progress ):
|
|||||||
print( "DONE" )
|
print( "DONE" )
|
||||||
|
|
||||||
# include progress bar if required
|
# include progress bar if required
|
||||||
if progress==True:
|
|
||||||
wait_for_jobs(submitted_job_ids, chunk)
|
wait_for_jobs(submitted_job_ids, chunk)
|
||||||
print("slurm processing done")
|
print("slurm processing done")
|
||||||
|
|
||||||
@@ -195,7 +212,7 @@ if __name__ == "__main__":
|
|||||||
"--chunk_size",
|
"--chunk_size",
|
||||||
help="how big should each chunk be? - the bigger the chunk, the fewer jobs, the slower it will be",
|
help="how big should each chunk be? - the bigger the chunk, the fewer jobs, the slower it will be",
|
||||||
type=int,
|
type=int,
|
||||||
default=1000
|
default=2500
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-g",
|
"-g",
|
||||||
@@ -216,14 +233,7 @@ if __name__ == "__main__":
|
|||||||
type=str,
|
type=str,
|
||||||
default="split"
|
default="split"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
"-p",
|
|
||||||
"--progress",
|
|
||||||
help="gives you the option of also having a progress bar",
|
|
||||||
type=bool,
|
|
||||||
default=True
|
|
||||||
)
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
# run geom converter
|
# run geom converter
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
run_splits( cwd, args.job_name, args.lst_file, args.chunk_size, args.geom_file, args.cell_file, args.progress )
|
run_splits( cwd, args.job_name, args.lst_file, args.chunk_size, args.geom_file, args.cell_file )
|
||||||
|
|||||||
Reference in New Issue
Block a user