Commit b97a297f authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Remove logger for resources.cor

parent 544109a2
Pipeline #27860 passed with stages
in 2 minutes and 6 seconds
import numpy as np
from import get_data
from .logger import LoggerOrPrint
from ..preproc.ccd import FlatField
from ..preproc.alignment import CenterOfRotation
......@@ -8,7 +7,7 @@ class CORFinder:
An application-type class for finding the Center Of Rotation (COR).
def __init__(self, dataset_info, angles=None, halftomo=False, logger=None):
def __init__(self, dataset_info, angles=None, halftomo=False):
Initialize a CORFinder object.
......@@ -21,10 +20,7 @@ class CORFinder:
the rotation angles available in `dataset_info`, if any.
halftomo: bool, optional
Whether the scan was performed in "half tomography" acquisition.
logger: logging object, optional
A logging object
self.logger = LoggerOrPrint(logger)
self.halftomo = halftomo
self.dataset_info = dataset_info
self.shape = dataset_info._radio_dims_notbinned[::-1]
......@@ -38,8 +34,8 @@ class CORFinder:
def _get_angles(self, angles):
dataset_angles = self.dataset_info.rotation_angles
if dataset_angles is None:
if angles is None:
self.logger.warning("No information on angles was found for this dataset. Using default [0, 180[ range.")
if angles is None: # should not happen with hdf5
print("Warning: no information on angles was found for this dataset. Using default [0, 180[ range.")
angles = np.linspace(0, np.pi, len(self.dataset_info.projections), False)
dataset_angles = angles
self.angles = dataset_angles
......@@ -66,10 +62,6 @@ class CORFinder:
self.radios = np.zeros((self._n_radios, ) + self.shape, "f")
for i in range(self._n_radios):
radio_idx = self._radios_indices[i]
"Loading radio %d: %.1f"
% (radio_idx, np.rad2deg(self.angles[_min_indices[i]]))
self.radios[i] = get_data(self.dataset_info.projections[radio_idx]).astype("f")
......@@ -85,7 +77,6 @@ class CORFinder:
def _apply_flatfield(self):
self.logger.debug("Applying Flat-Field on radios")
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