corrected clen and position bugs

This commit is contained in:
Beale John Henry
2023-06-25 21:52:03 +02:00
parent 03d126aece
commit 882a4ebd29

View File

@@ -75,14 +75,14 @@ def scrub_poni( path_to_poni_file ):
wave = float(wave[0]) * np.float_power( 10, int( wave[1]) ) wave = float(wave[0]) * np.float_power( 10, int( wave[1]) )
# calculate beam_centre # calculate beam_centre
poni1_p = float( poni1_m ) / 0.000000075 poni1_p = float( poni1_m ) / 0.000075
poni2_p = float( poni2_m ) / 0.000000075 poni2_p = float( poni2_m ) / 0.000075
# calculate beam energy in eV # calculate beam energy in eV
eV = ( ( constants.c * constants.h ) / wave ) / constants.electron_volt eV = ( ( constants.c * constants.h ) / wave ) / constants.electron_volt
# return poni1 = y, poni2 = x and energy # return poni1 = y, poni2 = x and energy
return poni1_p, poni2_p, eV, round( float( clen )*1000, 5 ) return poni1_p, poni2_p, eV, round( float( clen ), 5 )
def write_new_positions( path_to_geom, beam_x, beam_y, clen, energy, jungfrau, p_group ): def write_new_positions( path_to_geom, beam_x, beam_y, clen, energy, jungfrau, p_group ):
@@ -194,7 +194,7 @@ if __name__ == "__main__":
elif args.poni is not None: elif args.poni is not None:
print( "reading poni file" ) print( "reading poni file" )
beam_y, beam_x, eV, clen = scrub_poni( args.poni ) beam_y, beam_x, eV, clen = scrub_poni( args.poni )
print( "beam x, beam_y = {0}, {1}\nphoton_energy = {2}\nclen = {3}".format( beam_x, beam_y, eV, clen ) ) print( "beam x, beam_y = {0}, {1}\nphoton_energy = {2}\nclen = {3} m".format( beam_x, beam_y, eV, clen ) )
new_geom_name = write_new_positions( args.geom, beam_x, beam_y, clen, eV, args.jungfrau, args.p_group ) new_geom_name = write_new_positions( args.geom, beam_x, beam_y, clen, eV, args.jungfrau, args.p_group )
print( "updated .geom file with poni calculations\n new .geom = {0}".format( new_geom_name ) ) print( "updated .geom file with poni calculations\n new .geom = {0}".format( new_geom_name ) )
else: else: