Commit 51dae7c2 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Alignment: using logging for warnings



Signed-off-by: Nicola Vigano's avatarNicola VIGANÒ <nicola.vigano@esrf.fr>
parent fa77e048
Pipeline #27408 passed with stages
in 6 minutes and 34 seconds
import numpy as np
import math
import logging
from numpy.polynomial.polynomial import Polynomial
from nabu.utils import previouspow2
......@@ -371,7 +372,9 @@ class CenterOfRotation(AlignmentBase):
self._check_img_sizes(img_1, img_2)
if peak_fit_radius < 1:
print("WARNING: peak_fit_radius should be at least 1, given: %d instead." % peak_fit_radius)
logging.getLogger(__name__).warning(
"Parameter peak_fit_radius should be at least 1, given: %d instead." % peak_fit_radius
)
peak_fit_radius = 1
img_shape = img_2.shape
......@@ -506,7 +509,9 @@ class DetectorTranslationAlongBeam(AlignmentBase):
self._check_img_sizes(img_stack, img_pos)
if peak_fit_radius < 1:
print("WARNING: peak_fit_radius should be at least 1, given: %d instead." % peak_fit_radius)
logging.getLogger(__name__).warning(
"Parameter peak_fit_radius should be at least 1, given: %d instead." % peak_fit_radius
)
peak_fit_radius = 1
num_imgs = img_stack.shape[0]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment