233 def download_hirelpp(self, measurement_id): |
233 def download_hirelpp(self, measurement_id): |
234 """ Download hirelpp files for the measurement id. """ |
234 """ Download hirelpp files for the measurement id. """ |
235 # Construct the download url |
235 # Construct the download url |
236 download_url = self.download_hirelpp_pattern.format(measurement_id) |
236 download_url = self.download_hirelpp_pattern.format(measurement_id) |
237 try: |
237 try: |
238 self.download_files(measurement_id, 'scc_hirelpp', download_url) |
238 self.download_files(measurement_id, 'hirelpp', download_url) |
239 except Exception as e: |
239 except Exception as e: |
240 logger.error("Could not download HiRElPP files. Error message: {}".format(e)) |
240 logger.error("Could not download HiRElPP files. Error message: {}".format(e)) |
241 logger.debug('Download exception:', exc_info=True) |
241 logger.debug('Download exception:', exc_info=True) |
242 |
242 |
243 def download_cloudmask(self, measurement_id): |
243 def download_cloudmask(self, measurement_id): |
244 """ Download cloudmask files for the measurement id. """ |
244 """ Download cloudmask files for the measurement id. """ |
245 # Construct the download url |
245 # Construct the download url |
246 download_url = self.download_cloudmask_pattern.format(measurement_id) |
246 download_url = self.download_cloudmask_pattern.format(measurement_id) |
247 try: |
247 try: |
248 self.download_files(measurement_id, 'scc_cloudscreen', download_url) |
248 self.download_files(measurement_id, 'cloudscreen', download_url) |
249 except Exception as e: |
249 except Exception as e: |
250 logger.error("Could not download cloudscreen files. Error message: {}".format(e)) |
250 logger.error("Could not download cloudscreen files. Error message: {}".format(e)) |
251 logger.debug('Download exception:', exc_info=True) |
251 logger.debug('Download exception:', exc_info=True) |
252 |
252 |
253 def download_elpp(self, measurement_id): |
253 def download_elpp(self, measurement_id): |
254 """ Download preprocessed files for the measurement id. """ |
254 """ Download preprocessed files for the measurement id. """ |
255 # Construct the download url |
255 # Construct the download url |
256 download_url = self.download_elpp_pattern.format(measurement_id) |
256 download_url = self.download_elpp_pattern.format(measurement_id) |
257 try: |
257 try: |
258 self.download_files(measurement_id, 'scc_preprocessed', download_url) |
258 self.download_files(measurement_id, 'elpp', download_url) |
259 except Exception as e: |
259 except Exception as e: |
260 logger.error("Could not download ElPP files. Error message: {}".format(e)) |
260 logger.error("Could not download ElPP files. Error message: {}".format(e)) |
261 logger.debug('Download exception:', exc_info=True) |
261 logger.debug('Download exception:', exc_info=True) |
262 |
262 |
263 def download_elda(self, measurement_id): |
263 def download_elda(self, measurement_id): |
264 """ Download optical files for the measurement id. """ |
264 """ Download optical files for the measurement id. """ |
265 # Construct the download url |
265 # Construct the download url |
266 download_url = self.download_elda_pattern.format(measurement_id) |
266 download_url = self.download_elda_pattern.format(measurement_id) |
267 try: |
267 try: |
268 self.download_files(measurement_id, 'scc_optical', download_url) |
268 self.download_files(measurement_id, 'elda', download_url) |
269 except Exception as e: |
269 except Exception as e: |
270 logger.error("Could not download ELDA files. Error message: {}".format(e)) |
270 logger.error("Could not download ELDA files. Error message: {}".format(e)) |
271 logger.debug('Download exception:', exc_info=True) |
271 logger.debug('Download exception:', exc_info=True) |
272 |
272 |
273 def download_plots(self, measurement_id): |
273 def download_plots(self, measurement_id): |
274 """ Download profile graphs for the measurement id. """ |
274 """ Download profile graphs for the measurement id. """ |
275 # Construct the download url |
275 # Construct the download url |
276 download_url = self.download_plots_pattern.format(measurement_id) |
276 download_url = self.download_plots_pattern.format(measurement_id) |
277 try: |
277 try: |
278 self.download_files(measurement_id, 'scc_plots', download_url) |
278 self.download_files(measurement_id, 'elda_plots', download_url) |
279 except Exception as e: |
279 except Exception as e: |
280 logger.error("Could not download ELDA plots. Error message: {}".format(e)) |
280 logger.error("Could not download ELDA plots. Error message: {}".format(e)) |
281 logger.debug('Download exception:', exc_info=True) |
281 logger.debug('Download exception:', exc_info=True) |
282 |
282 |
283 def download_elic(self, measurement_id): |
283 def download_elic(self, measurement_id): |
284 """ Download ELIC files for the measurement id. """ |
284 """ Download ELIC files for the measurement id. """ |
285 # Construct the download url |
285 # Construct the download url |
286 download_url = self.download_elic_pattern.format(measurement_id) |
286 download_url = self.download_elic_pattern.format(measurement_id) |
287 try: |
287 try: |
288 self.download_files(measurement_id, 'scc_elic', download_url) |
288 self.download_files(measurement_id, 'elic', download_url) |
289 except Exception as e: |
289 except Exception as e: |
290 logger.error("Could not download ELIC files. Error message: {}".format(e)) |
290 logger.error("Could not download ELIC files. Error message: {}".format(e)) |
291 logger.debug('Download exception:', exc_info=True) |
291 logger.debug('Download exception:', exc_info=True) |
292 |
292 |
293 def download_eldec(self, measurement_id): |
293 def download_eldec(self, measurement_id): |
294 """ Download ELDEC files for the measurement id. """ |
294 """ Download ELDEC files for the measurement id. """ |
295 # Construct the download url |
295 # Construct the download url |
296 download_url = self.download_elda_pattern.format(measurement_id) # ELDA patter is used for now |
296 download_url = self.download_elda_pattern.format(measurement_id) # ELDA patter is used for now |
297 try: |
297 try: |
298 self.download_files(measurement_id, 'scc_eldec', download_url) |
298 self.download_files(measurement_id, 'eldec', download_url) |
299 except Exception as e: |
299 except Exception as e: |
300 logger.error("Could not download EDELC files. Error message: {}".format(e)) |
300 logger.error("Could not download EDELC files. Error message: {}".format(e)) |
301 logger.debug('Download exception:', exc_info=True) |
301 logger.debug('Download exception:', exc_info=True) |
302 |
302 |
303 def rerun_elpp(self, measurement_id, monitor=True): |
303 def rerun_elpp(self, measurement_id, monitor=True): |
343 """ Upload a file for processing and wait for the processing to finish. |
343 """ Upload a file for processing and wait for the processing to finish. |
344 If the processing is successful, it will download all produced files. |
344 If the processing is successful, it will download all produced files. |
345 """ |
345 """ |
346 logger.info("--- Processing started on %s. ---" % datetime.datetime.now()) |
346 logger.info("--- Processing started on %s. ---" % datetime.datetime.now()) |
347 # Upload file |
347 # Upload file |
348 logger.info("--- Uploading file") |
348 logger.info("Uploading file.") |
349 measurement_id = self.upload_file(filename, system_id, force_upload, delete_related, |
349 measurement_id = self.upload_file(filename, system_id, force_upload, delete_related, |
350 rs_filename=rs_filename, |
350 rs_filename=rs_filename, |
351 lr_filename=lr_filename, |
351 lr_filename=lr_filename, |
352 ov_filename=ov_filename) |
352 ov_filename=ov_filename) |
353 |
353 |
354 if measurement_id and monitor: |
354 if measurement_id and monitor: |
355 logger.info("--- Monitoring processing") |
355 logger.info("Monitoring processing") |
356 return self.monitor_processing(measurement_id) |
356 return self.monitor_processing(measurement_id) |
357 |
357 |
358 return None |
358 return None |
359 |
359 |
360 def monitor_processing(self, measurement_id): |
360 def monitor_processing(self, measurement_id): |