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