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

WIP: _reset_sub_region()

parent 5333b110
Pipeline #78321 passed with stage
in 6 minutes and 12 seconds
......@@ -163,10 +163,6 @@ class NewPipeline:
self.extra_options.update(extra_options or {})
def _check_subregion(self):
pass # TODO
#
# Callbacks
#
......@@ -194,8 +190,6 @@ class NewPipeline:
self._callbacks[step_name] = [callback]
# TODO _get_shape() ?
#
# Memory management
#
......@@ -212,15 +206,11 @@ class NewPipeline:
self.n_slices -= sum(self.margin[0])
self.recs = self._allocate_array((self.n_slices, ny, nx), "f", name="recs")
def _reset_memory(self):
pass
#
# Runtime attributes
#
@property
def sub_region_xz(self):
"""
......@@ -384,7 +374,6 @@ class NewPipeline:
sigma_filter=options["sigma"]
)
@use_options("ccd_correction", "ccd_correction")
def _init_ccd_corrections(self):
options = self.processing_options["ccd_correction"]
......@@ -640,15 +629,6 @@ class NewPipeline:
% (str(shp), el)
)
def _reset_reader_subregion(self):
if self._resume_from_step is None:
self.chunk_reader._set_subregion(self.sub_region)
self.chunk_reader._init_reader()
self.chunk_reader._loaded = False
else:
self.chunk_reader._set_subregion(self.datadump_manager.get_read_dump_subregion())
self.chunk_reader._loaded = False
@pipeline_step("flatfield", "Applying flat-field")
def _flatfield(self):
......@@ -804,11 +784,26 @@ class NewPipeline:
self._process_finalize()
def process_chunk(self, sub_region):
self._reset_sub_region(sub_region)
self._reset_memory()
def _reset_reader_subregion(self):
if self._resume_from_step is None:
self.chunk_reader._set_subregion(self.sub_region)
self.chunk_reader._init_reader()
self.chunk_reader._loaded = False
else:
self.chunk_reader._set_subregion(self.datadump_manager.get_read_dump_subregion())
self.chunk_reader._loaded = False
def _reset_sub_region(self, sub_region):
self.set_subregion(sub_region)
# When sub_region is changed, all components involving files reading have to be updated
self._reset_reader_subregion()
self._init_flatfield() # reset flatfield
self._init_writer()
self._init_double_flatfield()
# self._configure_data_dumps()
def process_chunk(self, sub_region):
self._reset_sub_region(sub_region)
self._read_data()
self._process_chunk()
\ No newline at end of file
self._process_chunk()
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