diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index b0fb7f55c..53e1dc5c7 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -52,7 +52,8 @@ def get_chip_prog_values( ): name = inspect.stack()[0][3] logger.info("%s" % name) - if chip_type in ["0", "1", "5", "7", "8", "10"]: + if chip_type in ["1", "3", "9"]: + # '1' = 'Oxford ' = [8, 8, 20, 20, 0.125, 3.175, 3.175] ( xblocks, yblocks, @@ -67,34 +68,9 @@ def get_chip_prog_values( x_block_size = ((x_num_steps - 1) * w2w) + b2b_horz y_block_size = ((y_num_steps - 1) * w2w) + b2b_vert - """ - '0' = 'Toronto' = [9, 9, 12, 12, 0.125, 2.2 , 2.5 ] - '1' = 'Oxford ' = [8, 8, 20, 20, 0.125, 3.175, 3.175] - '2' = 'Hamburg' = [3, 3, 53, 53, 0.150, 8.58 , 8.58 ] - '5' = 'Regina ' = [7, 7, 20, 20, 0.125, 3.7 , 3.7 ] - """ - - elif chip_type == "2": - if caget(pv.me14e_gp2) == 2: - print("Full Mapping on Hamburg -> xblocks = 6") - logger.info("%s Full Mapping on Hamburg -> xblocks = 6" % name) - xblocks = 6 - else: - xblocks = 3 - - elif chip_type == "4": - print("This is a Bismuth Chip") - logger.info("%s This is a Bismuth Chip" % name) - x_num_steps = caget(pv.me14e_gp6) - y_num_steps = caget(pv.me14e_gp7) - x_step_size = caget(pv.me14e_gp8) - y_step_size = x_step_size - xblocks = 7 - yblocks = 7 - x_block_size = 15 # placeholder - y_block_size = 15 # placeholder - elif chip_type == "6": + # This is set by the user in the edm screen + # The chip format might change every time and is read from PVs. print("This is a Custom Chip") logger.info("%s This is a Custom Chip" % name) x_num_steps = caget(pv.me14e_gp6) @@ -221,7 +197,7 @@ def get_prog_num(chip_type, map_type, pump_repeat): name = inspect.stack()[0][3] logger.info("%s Get Program Number" % name) if str(pump_repeat) == "0": - if chip_type in ["0", "1", "2", "5", "10"]: + if chip_type in ["1", "3"]: if map_type == "0": logger.info("%s\t:Map Type = None" % name) print("Map Type is None") @@ -242,18 +218,10 @@ def get_prog_num(chip_type, map_type, pump_repeat): print("Unknown map_type") print(map_type) return 0 - elif chip_type == "4": - logger.info("%s\t:Bismuth Chip Type 2" % name) - print("Bismuth Chip Type 2") - return 12 elif chip_type == "6": logger.info("%s\t:Custom Chip" % name) print("Custom Chip Type") return 11 - elif chip_type in ["7", "8"]: - logger.info("%s\t:Heidelberg Chip" % name) - print("Heidelberg Chip Type") - return 11 else: logger.debug("%s\t:Unknown chip_type, chip_tpe = = %s" % (name, chip_type)) print("Unknown Chip Type") @@ -288,7 +256,6 @@ def datasetsizei24(): ) = scrape_parameter_file() if map_type == "0": - chip_format = get_format(chip_type)[:4] if chip_type == "6": # Chip Type 6 is Custom print("Calculating total number of images") @@ -299,6 +266,7 @@ def datasetsizei24(): ) print(total_numb_imgs) else: + chip_format = get_format(chip_type)[:4] total_numb_imgs = np.prod(chip_format) elif map_type == "1": @@ -321,22 +289,13 @@ def datasetsizei24(): total_numb_imgs = np.prod(chip_format) * block_count * n_exposures - # For X-ray pump X-ray probe XPXP comment out total_numb_imgs = line above and uncomment below until double line of ##### - # print('X-ray Pump Probe. XPXP. X-ray Pump Probe. XPXP.') - # if pump_repeat == '0': - # total_numb_imgs = np.prod(chip_format) * block_count * n_exposures - # elif pump_repeat in ['1','3', '4', '5', '6', '7']: - # total_numb_imgs = np.prod(chip_format) * block_count * n_exposures * 2 - # else: - # print('Unknown pump_repeat') - elif map_type == "2": logger.warning("%s\t:Not Set Up For Full Mapping=%s" % (name)) - print("FIX ME, Im not set up for full mapping ") + raise ValueError("The beamline is currently not set for Full Mapping.") else: logger.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) - print("Unknown map type") + raise ValueError("Unknown map type") print("Total number of images", total_numb_imgs, "\n\n\n") caput(pv.me14e_gp10, total_numb_imgs) @@ -646,7 +605,7 @@ def main(): # If alignment type is Oxford inner it is still an Oxford type chip if str(chip_type) == "3": - logger.debug("%s\tMain: Change chip type Oxford Inner to Oxford" % name) + logger.debug("%s\tMain: Change chip type Oxford Inner to Oxford." % name) chip_type = "1" chip_prog_dict = get_chip_prog_values( diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 864f130e8..8a207c332 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -534,7 +534,7 @@ def load_lite_map(litemap_path: Path | str = LITEMAP_PATH): 'H1': '64', 'H2': '63', 'H3': '62', 'H4': '61', 'H5': '60', 'H6': '59', 'H7': '58', 'H8': '57', } # fmt: on - chip_type = caget(pv.me14e_gp1) + chip_type = int(caget(pv.me14e_gp1)) if chip_type == 1 or chip_type == 3: logger.info("%s Oxford Block Order" % name) print("Oxford Block Order") @@ -661,8 +661,8 @@ def moveto(place: str): caput(pv.me14e_stage_y, 25.40) else: - print("Unknown chip_type move") logger.warning("%s Unknown chip_type move" % name) + raise ValueError("Unknown chip_type move") # Non Chip Specific Move if place == "zero": diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index ce87b625e..eeeedbb9b 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -93,7 +93,7 @@ def convert_chip_to_hex(fid, chip_type): check_files(["%s.full" % chip_type]) with open("%s.full" % fid[:-5], "w") as g: # Normal - if chip_type in ["0", "1", "5"]: + if chip_type in ["1", "3"]: shot_order_list = get_shot_order(chip_type) logger.info("%s Shot Order List: \n" % (name)) logger.info("%s" % shot_order_list[:14]) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index c7bd1603e..df01d2dff 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -140,11 +140,6 @@ def get_format(chip_type): b2b_horz = 0.0 b2b_vert = 0.0 chip_format = [1, 1, 25, 25] - elif chip_type == "6": # Custom - w2w = 0.100 - b2b_horz = 0 - b2b_vert = 0 - chip_format = [1, 1, 20, 20] elif chip_type == "9": # Mini oxford (1 block) w2w = 0.125 b2b_horz = 0