Skip to content

Commit

Permalink
API: Move noise model selection to ExitwaveOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
carterbox committed Dec 6, 2023
1 parent d4eb7c3 commit 3ff052d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ptychodus/model/tike/reconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,27 @@ def __call__(self, parameters: ReconstructInput,
logger.debug(f'object shape={psi.shape}')
logger.debug(f'num_gpu={numGpus}')

exitwave_options = tike.ptycho.ExitWaveOptions(
# FIXME: Use a user supplied `measured_pixels` instead
measured_pixels=numpy.ones(probe.shape[-2:], dtype=numpy.bool_),
noise_model=self._settings.noiseModel.value,
)

ptychoParameters = tike.ptycho.solvers.PtychoParameters(
probe=probe,
psi=psi,
scan=scan,
algorithm_options=algorithmOptions,
probe_options=self.getProbeOptions(),
object_options=self.getObjectOptions(),
position_options=self.getPositionOptions(scan))
position_options=self.getPositionOptions(scan),
exitwave_options=exitwave_options,
)

if self._multigridSettings.useMultigrid.value:
result = tike.ptycho.reconstruct_multigrid(
data=data,
parameters=ptychoParameters,
model=self._settings.noiseModel.value,
num_gpu=numGpus,
use_mpi=False,
num_levels=self._multigridSettings.numLevels.value,
Expand All @@ -190,7 +197,6 @@ def __call__(self, parameters: ReconstructInput,
with tike.ptycho.Reconstruction(
data=data,
parameters=ptychoParameters,
model=self._settings.noiseModel.value,
num_gpu=numGpus,
use_mpi=False,
) as context:
Expand Down

0 comments on commit 3ff052d

Please sign in to comment.