@@ -106,7 +106,9 @@ def _file_transferred_to(
106106 environment : MurfeyInstanceEnvironment , source : Path , file_path : Path
107107):
108108 machine_config = get_machine_config (
109- str (environment .url .geturl ()), demo = environment .demo
109+ str (environment .url .geturl ()),
110+ instrument_name = environment .instrument_name ,
111+ demo = environment .demo ,
110112 )
111113 if environment .visit in environment .default_destinations [source ]:
112114 return (
@@ -160,7 +162,7 @@ def _grid_square_data(xml_path: Path, grid_square: int, session_id: int) -> Grid
160162 )
161163 if image_paths :
162164 image_paths .sort (key = lambda x : x .stat ().st_ctime )
163- image_path = image_paths [0 ]
165+ image_path = image_paths [- 1 ]
164166 with open (Path (image_path ).with_suffix (".xml" )) as gs_xml :
165167 gs_xml_data = xmltodict .parse (gs_xml .read ())
166168 readout_area = gs_xml_data ["MicroscopeImage" ]["microscopeData" ]["acquisition" ][
@@ -175,8 +177,8 @@ def _grid_square_data(xml_path: Path, grid_square: int, session_id: int) -> Grid
175177 session_id = session_id ,
176178 readout_area_x = full_size [0 ] if image_path else None ,
177179 readout_area_y = full_size [1 ] if image_path else None ,
178- thumbnail_size_x = None ,
179- thumbnail_size_y = None ,
180+ thumbnail_size_x = int (( 512 / max ( full_size )) * full_size [ 0 ]) ,
181+ thumbnail_size_y = int (( 512 / max ( full_size )) * full_size [ 1 ]) ,
180182 pixel_size = float (pixel_size ) if image_path else None ,
181183 image = str (image_path ),
182184 )
@@ -417,7 +419,7 @@ def gather_metadata(
417419 binning_factor = 1
418420 if environment :
419421 server_config_response = capture_get (
420- f"{ str (environment .url .geturl ())} /machine"
422+ f"{ str (environment .url .geturl ())} /instruments/ { environment . instrument_name } / machine"
421423 )
422424 if server_config_response is None :
423425 return None
@@ -677,7 +679,9 @@ def post_transfer(
677679 if self ._acquisition_software == "epu" :
678680 if environment :
679681 machine_config = get_machine_config (
680- str (environment .url .geturl ()), demo = environment .demo
682+ str (environment .url .geturl ()),
683+ instrument_name = environment .instrument_name ,
684+ demo = environment .demo ,
681685 )
682686 else :
683687 machine_config = {}
@@ -720,7 +724,7 @@ def post_transfer(
720724 eer_fractionation_file = None
721725 if file_transferred_to .suffix == ".eer" :
722726 response = capture_post (
723- f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /eer_fractionation_file" ,
727+ f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /{ environment . murfey_session } / eer_fractionation_file" ,
724728 json = {
725729 "eer_path" : str (file_transferred_to ),
726730 "fractionation" : environment .data_collection_parameters [
@@ -863,7 +867,9 @@ def _register_processing_job(
863867 environment .id_tag_registry ["processing_job" ].append (tag )
864868 proc_url = f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /{ environment .murfey_session } /register_processing_job"
865869 machine_config = get_machine_config (
866- str (environment .url .geturl ()), demo = environment .demo
870+ str (environment .url .geturl ()),
871+ instrument_name = environment .instrument_name ,
872+ demo = environment .demo ,
867873 )
868874 image_directory = str (
869875 Path (machine_config .get ("rsync_basepath" , "." ))
0 commit comments