diff --git a/pyfai-tools/update-geom-from-lab6.py b/pyfai-tools/update-geom-from-lab6.py index e555bf7..bfcc2c9 100644 --- a/pyfai-tools/update-geom-from-lab6.py +++ b/pyfai-tools/update-geom-from-lab6.py @@ -139,56 +139,53 @@ if __name__ == "__main__": parser.add_argument( "-g", "--geom", - help="give the path to the cristallina 8M geom file to be updated", + help="give the path to the geom file to be updated.", type=str, - default="/sf/cristallina/applications/mx/crmx-tools/geom_files/crmx8M_230322.geom", - ) - parser.add_argument( - "-x", - "--beam_x", - help="beam_x in pixels", - type=float, - default=1603.73 - ) - parser.add_argument( - "-y", - "--beam_y", - help="beam_y in pixels", - type=float, - default=1661.99 + required=True ) parser.add_argument( "-j", "--jungfrau", - help="name of jungfrau, i.e., JF17T16V01 for Cristallina 8M", - type=str, - default="JF17T16V01" - ) - parser.add_argument( - "-c", - "--clen", - help="detector distance in m", - type=int, - default=0.111 - ) - parser.add_argument( - "-e", - "--energy", - help="photon energy", - type=int, - default=12400 - ) - parser.add_argument( - "-i", - "--poni", - help="path to poni file", + help="SwissFEL name of jungfrau, i.e., JF17T16V01 for Cristallina 8M. Default = JF17T16V01.", type=str, + required=True ) parser.add_argument( "-p", "--p_group", help="p-group name", type=str, + required=True + ) + parser.add_argument( + "-i", + "--poni", + help="AUTOMATIC option to path to poni file from pyFAI calculation. simply give all values taken from this.", + type=str, + ) + parser.add_argument( + "-x", + "--beam_x", + help="manual option to add beam_x in pixels. Must be a float. You must also give following arguements.", + type=float + ) + parser.add_argument( + "-y", + "--beam_y", + help="manual option to add beam_y in pixels. Must be a float. You must also give following arguements.", + type=float + ) + parser.add_argument( + "-c", + "--clen", + help="manual option to add detector distance in m. Must be a float. You must also give following arguements.", + type=float + ) + parser.add_argument( + "-e", + "--energy", + help="manual option to add photon energy in eV. Must be an int", + type=int ) args = parser.parse_args() # run geom converter @@ -197,14 +194,16 @@ if __name__ == "__main__": elif args.poni is not None: print( "reading poni file" ) beam_y, beam_x, eV, clen = scrub_poni( args.poni ) - print( "beam x, beam_y = {0}, {1}\nphoton_energy = {2}\nclen = {3} m".format( beam_x, beam_y, eV, clen ) ) + print( "beam x, beam_y = {0}, {1} pixels\nphoton_energy = {2} eV\nclen = {3} m".format( round( beam_x, 3 ), round( beam_y, 3 ), eV, clen ) ) 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\nnew .geom = {0}".format( new_geom_name ) ) + print( "please check the result" ) else: print( "manually input positions" ) - print( "beam x, beam_y = {0}, {1}\nphoton_energy = {2}\nclen = {3}".format( args.beam_x, args.beam_y, args.energy, args.clen ) ) + print( "beam x, beam_y = {0}, {1} pixels\nphoton_energy = {2} eV\nclen = {3} m".format( args.beam_x, args.beam_y, args.energy, args.clen ) ) new_geom_name = write_new_positions( args.geom, args.beam_x, args.beam_y, args.clen, args.energy, args.jungfrau, args.p_group ) print( "updated .geom file with poni calculations\nnew .geom = {0}".format( new_geom_name ) ) + print( "please check the result" )