From bc5089a056480d3ba57bdd63112127de8b2aebe2 Mon Sep 17 00:00:00 2001 From: Alain Klotz Date: Mon, 2 Oct 2023 10:52:05 +0200 Subject: [PATCH] Cosmetic finalization of the agent ImgProcessor. --- src/core/pyros_django/img_process/A_ImgProcessor.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/core/pyros_django/img_process/A_ImgProcessor.py b/src/core/pyros_django/img_process/A_ImgProcessor.py index 46442b2..2765ee7 100755 --- a/src/core/pyros_django/img_process/A_ImgProcessor.py +++ b/src/core/pyros_django/img_process/A_ImgProcessor.py @@ -432,7 +432,6 @@ class A_ImgProcessor(Agent): log.info("\n" + "="*70 + f"\n=== End process an image for L0->L1\n" + "="*70 + "\n") return None - # - Get datedict from DATE-OBS of img date_obs = self._ima.getkwd("DATE-OBS") log.info(f"DATE-OBS: {date_obs}") @@ -471,14 +470,14 @@ class A_ImgProcessor(Agent): log.info("\n" + "-"*60 + f"\n--- Cosmetic correction\n" + "-"*60 + "\n") self.cosmetic_correction() - # - Save the L1a file name + # - Prepare the L1a file name self._ima.fcontext = "img_L1a" param_img['ftype'] = 'L1A' - fname = self._ima.naming_set(param_img) + #fname = self._ima.naming_set(param_img) + #fname = self._ima.join(fname) - fname = self._ima.join(fname) + # - Save and fill the database infos of the table images image_db.set_attribute_and_save(img_obj=self._ima, plan_id=image_db.plan.id) - #self._ima.save(fname) if param_img['ftype'] == "L1A" or param_img['ftype'] == "L1B": @@ -486,13 +485,14 @@ class A_ImgProcessor(Agent): log.info("\n" + "-"*60 + f"\n--- WCS calibration\n" + "-"*60 + "\n") nmatched = self.wcs_calibration() - # - Save the L1a file name + # - Prepare the L1a file name self._ima.fcontext = "img_L1b" param_img['ftype'] = 'L1B' - fname = self._ima.naming_set(param_img) - fname = self._ima.join(fname) + #fname = self._ima.naming_set(param_img) + #fname = self._ima.join(fname) + + # - Save and fill the database infos of the table images image_db.set_attribute_and_save(img_obj=self._ima, plan_id=image_db.plan.id) - #self._ima.save(fname) # - TODO Resampling (img_L1c) @@ -577,14 +577,13 @@ class A_ImgProcessor(Agent): log.info(f"{file_out=}") self._ima.setkwd("FILTER", filter_symbol) + # - Save and fill the database infos of the table images try: db_image = Image() - db_image.set_attribute_and_save(img_obj=self._ima, plan_id=plan_db.id) # db_image has an id assigned except Exception as e: print(e) - #self._ima.save(file_out) # --- Build a bias image filled by zeros log.info("Build a test bias") @@ -734,7 +733,6 @@ class A_ImgProcessor(Agent): db_image.save(img_obj=self._ima) except Exception as e: print(e) - #self._ima.save(file_out) # --- Build a bias image log.info("Build a test bias") -- libgit2 0.21.2