From 41fb3c81db466fb0683f7a46d273af432a22940b Mon Sep 17 00:00:00 2001 From: adrabent Date: Mon, 4 Jul 2022 15:15:46 +0000 Subject: [PATCH 1/2] Update interpolate.py --- losoto/operations/interpolate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/losoto/operations/interpolate.py b/losoto/operations/interpolate.py index 5aff27b8..39f73a62 100644 --- a/losoto/operations/interpolate.py +++ b/losoto/operations/interpolate.py @@ -147,11 +147,11 @@ def run( soltab, outsoltab, axisToRegrid, newdelta, delta='', maxFlaggedWidth=0, if log: vals = np.log10(vals) new_vals[selection] = np.interp(new_axisvals, orig_axisvals[unflagged], - vals[unflagged], left=np.nan, right=np.nan) + vals[unflagged], left=np.nan, right=np.nan, dtype=object) # For the weights, interpolate without the mask new_weights[selection] = np.round(np.interp(new_axisvals, orig_axisvals, weights, - left=np.nan, right=np.nan)) + left=np.nan, right=np.nan, dtype=object)) # Check for flagged gaps if maxFlaggedWidth > 1: From a850fc37d8805ddf3ad3be933d31827e49f7a01e Mon Sep 17 00:00:00 2001 From: adrabent Date: Wed, 6 Jul 2022 13:04:56 +0000 Subject: [PATCH 2/2] Update interpolate.py --- losoto/operations/interpolate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/losoto/operations/interpolate.py b/losoto/operations/interpolate.py index 39f73a62..3bcea8a5 100644 --- a/losoto/operations/interpolate.py +++ b/losoto/operations/interpolate.py @@ -135,8 +135,8 @@ def run( soltab, outsoltab, axisToRegrid, newdelta, delta='', maxFlaggedWidth=0, orig_shape = soltab.val.shape new_shape = list(orig_shape) new_shape[axisind] = len(new_axisvals) - new_vals = np.zeros(new_shape, dtype='float') - new_weights = np.zeros(new_shape, dtype='float') + new_vals = np.zeros(new_shape, dtype='float').astype('object') + new_weights = np.zeros(new_shape, dtype='float').astype('object') for vals, weights, coord, selection in soltab.getValuesIter(returnAxes=[axisToRegrid], weight=True): flagged = np.logical_or(np.equal(weights, 0.0), np.isnan(vals)) @@ -147,11 +147,11 @@ def run( soltab, outsoltab, axisToRegrid, newdelta, delta='', maxFlaggedWidth=0, if log: vals = np.log10(vals) new_vals[selection] = np.interp(new_axisvals, orig_axisvals[unflagged], - vals[unflagged], left=np.nan, right=np.nan, dtype=object) + vals[unflagged], left=np.nan, right=np.nan) # For the weights, interpolate without the mask new_weights[selection] = np.round(np.interp(new_axisvals, orig_axisvals, weights, - left=np.nan, right=np.nan, dtype=object)) + left=np.nan, right=np.nan)) # Check for flagged gaps if maxFlaggedWidth > 1: