Commit 0ea4e217 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Merge branch 'fix_translations' into 'master'

Fix horizontal/vertical translations in pipeline

Closes #299 and #300

See merge request !175
parents 992a18ae 887e9bc8
Pipeline #72936 passed with stages
in 6 minutes and 21 seconds
__version__ = "2022.1.1"
__version__ = "2022.1.2"
__nabu_modules__ = [
"app",
"cuda",
......
......@@ -264,6 +264,8 @@ class GroupedPipeline(ChunkedPipeline):
def _init_ctf_phase(self):
options = self.processing_options["phase"]
translations_vh = getattr(self.dataset_info, "ctf_translations", None)
geo_pars_params = options["ctf_geo_pars"].copy()
geo_pars_params["logger"] = self.logger
geo_pars = GeoPars(**geo_pars_params)
......@@ -277,6 +279,7 @@ class GroupedPipeline(ChunkedPipeline):
fftw_num_threads=None, # TODO tune in advanced params of nabu config file
use_rfft=True,
normalize_by_mean=options["ctf_normalize_by_mean"],
translation_vh=translations_vh,
)
......
......@@ -62,7 +62,8 @@ class CudaGroupedPipeline(GroupedPipeline):
# overwrite
def _init_ctf_phase(self):
def _init_ctf_phase(self):
translations_vh = getattr(self.dataset_info, "ctf_translations", None)
options = self.processing_options["phase"]
geo_pars_params = options["ctf_geo_pars"].copy()
geo_pars_params["logger"] = self.logger
......@@ -75,6 +76,7 @@ class CudaGroupedPipeline(GroupedPipeline):
lim2=options["ctf_lim2"],
logger=self.logger,
normalize_by_mean=options["ctf_normalize_by_mean"],
translation_vh=translations_vh,
)
......
......@@ -56,6 +56,12 @@ class ProcessConfig(ProcessConfigBase):
print("Something wrong with translation_movements_file %s" % transl_file)
raise
setattr(self.dataset_info, dataset_info_attr, translations)
if translations is not None:
# Horizontal translations are handled by "axis_correction" in backprojector
horizontal_translations = translations[:, 0]
if np.max(np.abs(horizontal_translations)) > 1e-3:
self.dataset_info.axis_correction = horizontal_translations
def _get_rotation_axis_position(self):
super()._get_rotation_axis_position()
......
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