@@ -87,6 +87,7 @@ def __init__(self, acquisition_software: str, basepath: Path):
8787 super ().__init__ ("Tomography" , acquisition_software )
8888 self ._basepath = basepath
8989 self ._tilt_series : Dict [str , List [Path ]] = {}
90+ self ._tilt_series_with_pjids : List [str ] = []
9091 self ._tilt_series_sizes : Dict [str , int ] = {}
9192 self ._completed_tilt_series : List [str ] = []
9293 self ._aligned_tilt_series : List [str ] = []
@@ -117,57 +118,59 @@ def register_tomography_data_collections(
117118 capture_post (dcg_url , json = dcg_data )
118119
119120 for tilt_series in self ._tilt_series .keys ():
120- dc_url = f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /{ environment .murfey_session } /start_data_collection"
121- dc_data = {
122- "experiment_type" : "tomography" ,
123- "file_extension" : file_extension ,
124- "acquisition_software" : self ._acquisition_software ,
125- "image_directory" : image_directory ,
126- "data_collection_tag" : tilt_series ,
127- "source" : str (self ._basepath ),
128- "tag" : tilt_series ,
129- }
130- if (
131- environment .data_collection_parameters
132- and environment .data_collection_parameters .get ("voltage" )
133- ):
134- # Once mdoc parameters are known register processing jobs
135- dc_data .update (
136- {
137- "voltage" : environment .data_collection_parameters [
138- "voltage"
139- ],
140- "pixel_size_on_image" : environment .data_collection_parameters [
141- "pixel_size_on_image"
142- ],
143- "image_size_x" : environment .data_collection_parameters [
144- "image_size_x"
145- ],
146- "image_size_y" : environment .data_collection_parameters [
147- "image_size_y"
148- ],
149- "magnification" : environment .data_collection_parameters [
150- "magnification"
151- ],
152- }
153- )
154- capture_post (dc_url , json = dc_data )
155-
156- proc_url = f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /{ environment .murfey_session } /register_processing_job"
157- for recipe in ("em-tomo-preprocess" , "em-tomo-align" ):
158- capture_post (
159- proc_url ,
160- json = {
161- "tag" : tilt_series ,
162- "source" : str (self ._basepath ),
163- "recipe" : recipe ,
164- "experiment_type" : "tomography" ,
165- },
121+ if tilt_series not in self ._tilt_series_with_pjids :
122+ dc_url = f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /{ environment .murfey_session } /start_data_collection"
123+ dc_data = {
124+ "experiment_type" : "tomography" ,
125+ "file_extension" : file_extension ,
126+ "acquisition_software" : self ._acquisition_software ,
127+ "image_directory" : image_directory ,
128+ "data_collection_tag" : tilt_series ,
129+ "source" : str (self ._basepath ),
130+ "tag" : tilt_series ,
131+ }
132+ if (
133+ environment .data_collection_parameters
134+ and environment .data_collection_parameters .get ("voltage" )
135+ ):
136+ # Once mdoc parameters are known register processing jobs
137+ dc_data .update (
138+ {
139+ "voltage" : environment .data_collection_parameters [
140+ "voltage"
141+ ],
142+ "pixel_size_on_image" : environment .data_collection_parameters [
143+ "pixel_size_on_image"
144+ ],
145+ "image_size_x" : environment .data_collection_parameters [
146+ "image_size_x"
147+ ],
148+ "image_size_y" : environment .data_collection_parameters [
149+ "image_size_y"
150+ ],
151+ "magnification" : environment .data_collection_parameters [
152+ "magnification"
153+ ],
154+ }
155+ )
156+ capture_post (dc_url , json = dc_data )
157+
158+ proc_url = f"{ str (environment .url .geturl ())} /visits/{ environment .visit } /{ environment .murfey_session } /register_processing_job"
159+ for recipe in ("em-tomo-preprocess" , "em-tomo-align" ):
160+ capture_post (
161+ proc_url ,
162+ json = {
163+ "tag" : tilt_series ,
164+ "source" : str (self ._basepath ),
165+ "recipe" : recipe ,
166+ "experiment_type" : "tomography" ,
167+ },
168+ )
169+ self ._tilt_series_with_pjids .append (tilt_series )
170+ else :
171+ logger .info (
172+ "Cannot register data collection yet as no values from mdoc"
166173 )
167- else :
168- logger .info (
169- "Cannot register data collection yet as no values from mdoc"
170- )
171174
172175 except Exception as e :
173176 logger .error (f"ERROR { e } , { environment .data_collection_parameters } " )
0 commit comments