Commit bc5089a056480d3ba57bdd63112127de8b2aebe2

Authored by Alain Klotz
1 parent 41f9ef6a
Exists in dev

Cosmetic finalization of the agent ImgProcessor.

Showing 1 changed file with 10 additions and 12 deletions   Show diff stats
src/core/pyros_django/img_process/A_ImgProcessor.py
... ... @@ -432,7 +432,6 @@ class A_ImgProcessor(Agent):
432 432 log.info("\n" + "="*70 + f"\n=== End process an image for L0->L1\n" + "="*70 + "\n")
433 433 return None
434 434  
435   -
436 435 # - Get datedict from DATE-OBS of img
437 436 date_obs = self._ima.getkwd("DATE-OBS")
438 437 log.info(f"DATE-OBS: {date_obs}")
... ... @@ -471,14 +470,14 @@ class A_ImgProcessor(Agent):
471 470 log.info("\n" + "-"*60 + f"\n--- Cosmetic correction\n" + "-"*60 + "\n")
472 471 self.cosmetic_correction()
473 472  
474   - # - Save the L1a file name
  473 + # - Prepare the L1a file name
475 474 self._ima.fcontext = "img_L1a"
476 475 param_img['ftype'] = 'L1A'
477   - fname = self._ima.naming_set(param_img)
  476 + #fname = self._ima.naming_set(param_img)
  477 + #fname = self._ima.join(fname)
478 478  
479   - fname = self._ima.join(fname)
  479 + # - Save and fill the database infos of the table images
480 480 image_db.set_attribute_and_save(img_obj=self._ima, plan_id=image_db.plan.id)
481   - #self._ima.save(fname)
482 481  
483 482 if param_img['ftype'] == "L1A" or param_img['ftype'] == "L1B":
484 483  
... ... @@ -486,13 +485,14 @@ class A_ImgProcessor(Agent):
486 485 log.info("\n" + "-"*60 + f"\n--- WCS calibration\n" + "-"*60 + "\n")
487 486 nmatched = self.wcs_calibration()
488 487  
489   - # - Save the L1a file name
  488 + # - Prepare the L1a file name
490 489 self._ima.fcontext = "img_L1b"
491 490 param_img['ftype'] = 'L1B'
492   - fname = self._ima.naming_set(param_img)
493   - fname = self._ima.join(fname)
  491 + #fname = self._ima.naming_set(param_img)
  492 + #fname = self._ima.join(fname)
  493 +
  494 + # - Save and fill the database infos of the table images
494 495 image_db.set_attribute_and_save(img_obj=self._ima, plan_id=image_db.plan.id)
495   - #self._ima.save(fname)
496 496  
497 497 # - TODO Resampling (img_L1c)
498 498  
... ... @@ -577,14 +577,13 @@ class A_ImgProcessor(Agent):
577 577 log.info(f"{file_out=}")
578 578 self._ima.setkwd("FILTER", filter_symbol)
579 579  
  580 + # - Save and fill the database infos of the table images
580 581 try:
581 582 db_image = Image()
582   -
583 583 db_image.set_attribute_and_save(img_obj=self._ima, plan_id=plan_db.id)
584 584 # db_image has an id assigned
585 585 except Exception as e:
586 586 print(e)
587   - #self._ima.save(file_out)
588 587  
589 588 # --- Build a bias image filled by zeros
590 589 log.info("Build a test bias")
... ... @@ -734,7 +733,6 @@ class A_ImgProcessor(Agent):
734 733 db_image.save(img_obj=self._ima)
735 734 except Exception as e:
736 735 print(e)
737   - #self._ima.save(file_out)
738 736  
739 737 # --- Build a bias image
740 738 log.info("Build a test bias")
... ...