Skip to content

Commit

Permalink
fix wrong isosurface estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
clatlan committed Feb 18, 2023
1 parent 5eb1c4c commit 89e936f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cdiutils/processing/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ def orthogonalize(self):
# check if the reconstructed object is correctly centered
reconstructed_amplitude = np.abs(reconstructed_object)

# Need to hard code the isosurface if it is negative
# Need to hard code the isosurface if it is < 0 or > 1
isosurface = find_isosurface(reconstructed_amplitude)
if isosurface < 0:
if isosurface < 0 or isosurface > 1:
isosurface = 0.3
support = make_support(
reconstructed_amplitude,
Expand Down Expand Up @@ -642,10 +642,10 @@ def postprocess(self) -> None:
)
isosurface = self.parameters["isosurface"]

elif isosurface < 0:
elif isosurface < 0 or isosurface > 1:
isosurface = 0.3
self.verbose_print(
f"[INFO] isosurface being negative is set to 0.3")
f"[INFO] isosurface < 0 or > 1 is set to 0.3")


# store the the averaged dspacing and lattice constant in variables
Expand Down

0 comments on commit 89e936f

Please sign in to comment.