From 26cecbb97df2a2390e57f933a5265b041b1b5355 Mon Sep 17 00:00:00 2001 From: Shinyoung Yi Date: Tue, 16 Jan 2024 17:17:02 +0900 Subject: [PATCH] No clip to 0-1 --- equilib/cube2equi/numpy.py | 2 +- equilib/equi2cube/numpy.py | 2 +- equilib/equi2equi/numpy.py | 2 +- equilib/equi2pers/numpy.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/equilib/cube2equi/numpy.py b/equilib/cube2equi/numpy.py index dd7817d4..0f8bde4c 100644 --- a/equilib/cube2equi/numpy.py +++ b/equilib/cube2equi/numpy.py @@ -323,7 +323,7 @@ def run( out = ( out.astype(horizon_dtype) if horizon_dtype == np.dtype(np.uint8) - else np.clip(out, 0.0, 1.0) + else np.clip(out, np.nanmin(out), np.nanmax(out)) ) return out diff --git a/equilib/equi2cube/numpy.py b/equilib/equi2cube/numpy.py index aefbdad9..c2f89516 100644 --- a/equilib/equi2cube/numpy.py +++ b/equilib/equi2cube/numpy.py @@ -206,7 +206,7 @@ def run( out = ( out.astype(equi_dtype) if equi_dtype == np.dtype(np.uint8) - else np.clip(out, 0.0, 1.0) + else np.clip(out, np.nanmin(out), np.nanmax(out)) ) # reformat the output diff --git a/equilib/equi2equi/numpy.py b/equilib/equi2equi/numpy.py index 79832bf2..19f7828b 100644 --- a/equilib/equi2equi/numpy.py +++ b/equilib/equi2equi/numpy.py @@ -172,7 +172,7 @@ def run( out = ( out.astype(src_dtype) if src_dtype == np.dtype(np.uint8) - else np.clip(out, 0.0, 1.0) + else np.clip(out, np.nanmin(out), np.nanmax(out)) ) return out diff --git a/equilib/equi2pers/numpy.py b/equilib/equi2pers/numpy.py index dbec2f93..3799e6ff 100644 --- a/equilib/equi2pers/numpy.py +++ b/equilib/equi2pers/numpy.py @@ -226,7 +226,7 @@ def run( out = ( out.astype(equi_dtype) if equi_dtype == np.dtype(np.uint8) or not clip_output - else np.clip(out, 0.0, 1.0) + else np.clip(out, np.nanmin(out), np.nanmax(out)) ) return out