Commit 6895d272 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

CoR: refactored module and class names


Signed-off-by: Nicola Vigano's avatarNicola VIGANÒ <nicola.vigano@esrf.fr>
parent 91d431d4
Pipeline #26223 passed with stages
in 3 minutes and 43 seconds
nabu.preproc.cor module
nabu.preproc.alignment module
=======================
.. automodule:: nabu.preproc.cor
.. automodule:: nabu.preproc.alignment
:members:
:undoc-members:
:show-inheritance:
......@@ -9,7 +9,7 @@ Submodules
nabu.preproc.ccd
nabu.preproc.ccd_cuda
nabu.preproc.cor
nabu.preproc.alignment
nabu.preproc.double_flat_field
nabu.preproc.phase
nabu.preproc.phase_cuda
......
......@@ -7,7 +7,7 @@ from silx.math import medianfilter
from nabu.utils import previouspow2
class CORCalculation(object):
class CenterOfRotation(object):
def __init__(
self,
......@@ -187,7 +187,7 @@ class CORCalculation(object):
>>> radio1 = data[0, :, :]
... radio2 = np.fliplr(data[1, :, :])
... CoR_calc = CORCalculation(poly_deg=2)
... CoR_calc = CenterOfRotation(poly_deg=2)
... cor_position = CoR_calc.find_shift(radio1, radio2)
Or for noisy images:
......
......@@ -3,7 +3,7 @@ import numpy as np
import os
import h5py
from nabu.preproc.cor import CORCalculation
from nabu.preproc.alignment import CenterOfRotation
from nabu.testutils import utilstest
......@@ -36,7 +36,7 @@ class TestCor:
radio1 = self.data[0, :, :]
radio2 = np.fliplr(self.data[1, :, :])
CoR_calc = CORCalculation(poly_deg=2)
CoR_calc = CenterOfRotation(poly_deg=2)
cor_position = CoR_calc.find_shift(radio1, radio2)
message = "Computed CoR %f " % cor_position + " and real CoR %f do not coincide" % self.px
......@@ -49,14 +49,14 @@ class TestCor:
radio1 = np.random.poisson(radio1 * 400)
radio2 = np.random.poisson(np.fliplr(radio2) * 400)
CoR_calc = CORCalculation(poly_deg=2)
CoR_calc = CenterOfRotation(poly_deg=2)
cor_position = CoR_calc.find_shift(radio1, radio2, median_filt_shape=(3, 3))
message = "Computed CoR %f " % cor_position + " and real CoR %f do not coincide" % self.px
assert np.abs(self.px - cor_position) < self.cor_tol, message
def test_error_checking_001(self):
CoR_calc = CORCalculation(poly_deg=2)
CoR_calc = CenterOfRotation(poly_deg=2)
radio1 = self.data[0, :, :1:]
radio2 = self.data[1, :, :]
......@@ -68,7 +68,7 @@ class TestCor:
assert 'Images need to be 2-dimensional. Shape of image #1' in str(ex.value), message
def test_error_checking_002(self):
CoR_calc = CORCalculation(poly_deg=2)
CoR_calc = CenterOfRotation(poly_deg=2)
radio1 = self.data[0, :, :]
radio2 = self.data
......@@ -80,7 +80,7 @@ class TestCor:
assert 'Images need to be 2-dimensional. Shape of image #2' in str(ex.value), message
def test_error_checking_003(self):
CoR_calc = CORCalculation(poly_deg=2)
CoR_calc = CenterOfRotation(poly_deg=2)
radio1 = self.data[0, :, :]
radio2 = self.data[1, :, 0:10]
......
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