From 35243d27dbe09e67000ca6656dc95198c5defc1a Mon Sep 17 00:00:00 2001 From: Beale John Henry Date: Thu, 23 Mar 2023 12:21:49 +0100 Subject: [PATCH] updated user instructions at the beginning of the script --- pyfai-tools/update-geom-from-lab6.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pyfai-tools/update-geom-from-lab6.py b/pyfai-tools/update-geom-from-lab6.py index f7f0d7a..ba1f811 100644 --- a/pyfai-tools/update-geom-from-lab6.py +++ b/pyfai-tools/update-geom-from-lab6.py @@ -1,5 +1,25 @@ #!/usr/bin/python +# author J.Beale + +""" +# aim +use .poni file from pyFAI or pixel x, y, clen inputs and energy to convert geom +file ready for initial hewl processing + +# usage + +python update-geom-from-lab6.py -g , -x beam x position (in pixels), + -y beam y postion (in pixels), -c camera length (in m), + -e pulse energy (in eV), -j name of jungfrau, -p p-group name + +python update-geom-from-lab6.py -g , -i , + -j name of jungfrau, -p p-group name + +# output +creates an updated .geom file with a naming convention __.geom +""" + from runpy import run_path import pandas as pd import numpy as np @@ -100,8 +120,7 @@ def write_new_positions( path_to_geom, beam_x, beam_y, clen, energy, jungfrau, p current_geom_file = re.sub( current_energy, new_energy, current_geom_file ) # create geom new file - geom_start = path_to_geom[:-5] - new_geom_name = "crmx8M_{0}_{1}.geom".format( p_group, date ) + new_geom_name = "{0}_{1}_{2}.geom".format( jungfrau, p_group, date ) # write new geom file f = open( new_geom_name, "w" )