Skip to content

Commit

Permalink
Fix #41 and #42: Do not expect all sections in correct_images.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelmassot committed Jan 18, 2022
1 parent 1c77fd1 commit 38fbde0
Show file tree
Hide file tree
Showing 3 changed files with 296 additions and 282 deletions.
5 changes: 5 additions & 0 deletions src/correct_images/correct_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ def call_rescale(args):
# install freeimage plugins if not installed
imageio.plugins.freeimage.download()

if correct_config.camerarescale is None:
Console.error("Camera rescale configuration not found")
Console.error("Please populate the correct_images.yaml file with a rescale configuration")
Console.quit("Malformed correct_images.yaml file")

# obtain parameters for rescale from correct_config
rescale_cameras = correct_config.camerarescale.rescale_cameras

Expand Down
6 changes: 6 additions & 0 deletions src/correct_images/corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ def __init__(self, force=False, suffix=None, camera=None, correct_config=None, p
"""Load general configuration parameters"""
self.correction_method = self.correct_config.method
if self.correction_method == "colour_correction":
if self.correct_config.color_correction is None:
Console.error(
"No color correction parameters found in the config file"
)
Console.error("Please populate the color_correction section")
Console.quit("Malformed correct_images.yaml file")
self.distance_metric = (
self.correct_config.color_correction.distance_metric
)
Expand Down
Loading

0 comments on commit 38fbde0

Please sign in to comment.