added % indexed + and sort index column

This commit is contained in:
Beale John Henry
2025-01-22 15:42:57 +01:00
parent a157901927
commit e08ba22e2c

View File

@@ -212,7 +212,8 @@ def scrub_index( index_dir_name ):
gamma, gamma_err = get_index_cell( index_log, "gamma" ) gamma, gamma_err = get_index_cell( index_log, "gamma" )
# put results into df # put results into df
data = [ { "images" : int( images ), "indexed" : int( indexed ), per_index = round( int( indexed )/int( images )*100, 2 )
data = [ { "images" : int( images ), "indexed" : int( indexed ), "indexed%" : per_index,
"index_res" : float( ind_res ), "index_res_err" : float( ind_res_err ), "index_res" : float( ind_res ), "index_res_err" : float( ind_res_err ),
"obs" : float( obs ), "obs_err" : float( obs_err ), "obs" : float( obs ), "obs_err" : float( obs_err ),
"a" : float( a ), "a_err" : float( a_err ), "a" : float( a ), "a_err" : float( a_err ),
@@ -350,12 +351,27 @@ def main( script_dir, cwd, runs,
# re-run check hkl # re-run check hkl
print( "running cc check/compare" ) print( "running cc check/compare" )
# move to partialator directory
os.chdir( part_run_name ) os.chdir( part_run_name )
check_run_file = part.run_compare_check( "{0}/{1}".format( proc_dir, part_run_name ), part_run_name, cell_file, bins, cc ) check_run_file = part.run_compare_check( "{0}/{1}".format( proc_dir, part_run_name ), part_run_name, cell_file, bins, cc )
submit_cmd = [ "{0}".format( check_run_file ) ] submit_cmd = [ "{0}".format( check_run_file ) ]
subprocess.call( submit_cmd ) subprocess.call( submit_cmd )
print( "done" ) print( "done" )
# get partialator metrics
try:
overcc = part.get_overall_cc()
except:
overcc = np.nan
try:
overrsplit = part.get_overall_rsplit()
except:
overrsplit = np.nan
try:
b_factor = part.get_b()
except AttributeError as e:
b_factor = np.nan
# make mtz # make mtz
print( "making final mtz" ) print( "making final mtz" )
cell = read_cell( cell_file ) cell = read_cell( cell_file )
@@ -372,20 +388,14 @@ def main( script_dir, cwd, runs,
except shutil.Error as e: except shutil.Error as e:
pass pass
# move back to top directory
os.chdir( proc_dir )
else: else:
print( "partialator not run. {0} > indexed".format( partialator_limit ) ) print( "partialator not run. {0} > indexed".format( partialator_limit ) )
os.chdir( part_run_name )
try:
cc = scrub_cc( part_run_name )
except AttributeError as e:
cc = np.nan cc = np.nan
overcc = np.nan
# get partialator metrics overrsplit = np.nan
overcc = part.get_overall_cc()
overrsplit = part.get_overall_rsplit()
try:
b_factor = part.get_b()
except AttributeError as e:
b_factor = np.nan b_factor = np.nan
# collate meta data # collate meta data
@@ -409,9 +419,10 @@ def main( script_dir, cwd, runs,
# output stats table # output stats table
print( df ) print( df )
df = df.reset_index( drop=True )
df.to_csv( "auto_process_summary.csv", sep="," ) df.to_csv( "auto_process_summary.csv", sep="," )
print( "finished all!" ) print( "finished all" )