Skip to content

Commit

Permalink
Merge pull request #8 from ornlneutronimaging/17_annoying_logging_war…
Browse files Browse the repository at this point in the history
…ning

fixed annoying message. this refs #17
  • Loading branch information
KedoKudo authored Feb 16, 2024
2 parents 69643da + 92cdf3e commit 4c29c02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/NeuNorm/_version.py

This file was deleted.

10 changes: 7 additions & 3 deletions src/NeuNorm/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,13 @@ def _auto_gamma_filtering(self, data=None):
# we may be dealing with a float time, that means it does not need any gamma filtering

try:
max = np.iinfo(data.dtype).max
except Exception as e:
logging.warning(f"Use default max value for data type: {e}")
data_type = data.dtype
if data_type in [float, "float32"]:
max = np.finfo(data_type).max
else:
max = np.iinfo(data.dtype).max
except Exception as error:
logging.warning(f"Use default max value for data type: {error}")
return data

manual_gamma_threshold = max - 5
Expand Down

0 comments on commit 4c29c02

Please sign in to comment.