Replace deprecated numpy.float and numpy.bool with native float and bool
parent
f55fda5c74
commit
ae6ffd2502
|
@ -188,7 +188,7 @@ class Radarsat2_GRD(Component):
|
|||
gcps = self.readGCPsFromXML()
|
||||
#print('gcps=',gcps)
|
||||
|
||||
azt = np.zeros((len(gcps),3), dtype=np.float)
|
||||
azt = np.zeros((len(gcps),3), dtype=float)
|
||||
nvalid = 0
|
||||
for ind,gcp in enumerate(gcps):
|
||||
try:
|
||||
|
|
|
@ -227,7 +227,7 @@ class Terrasar_GRD(Component):
|
|||
#gcps = self.readGCPsFromXML()
|
||||
#print('gcps=',gcps)
|
||||
|
||||
#azt = np.zeros((len(gcps),3), dtype=np.float)
|
||||
#azt = np.zeros((len(gcps),3), dtype=float)
|
||||
#nvalid = 0
|
||||
#for ind,gcp in enumerate(gcps):
|
||||
#try:
|
||||
|
|
|
@ -317,7 +317,7 @@ class autoRIFT:
|
|||
self.ChipSizeMaxX = self.ChipSizeMaxX.astype(np.float32)
|
||||
|
||||
ChipSizeX = np.zeros(self.xGrid.shape, np.float32)
|
||||
InterpMask = np.zeros(self.xGrid.shape, np.bool)
|
||||
InterpMask = np.zeros(self.xGrid.shape, bool)
|
||||
Dx = np.empty(self.xGrid.shape, dtype=np.float32)
|
||||
Dx.fill(np.nan)
|
||||
Dy = np.empty(self.xGrid.shape, dtype=np.float32)
|
||||
|
@ -372,7 +372,7 @@ class autoRIFT:
|
|||
|
||||
M0 = (ChipSizeX == 0) & (self.ChipSizeMinX <= ChipSizeUniX[i]) & (self.ChipSizeMaxX >= ChipSizeUniX[i])
|
||||
M0 = colfilt(M0.copy(), (int(1/Scale*6), int(1/Scale*6)), 0, self.colfiltChunkSize)
|
||||
M0 = cv2.resize(np.logical_not(M0).astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(np.bool)
|
||||
M0 = cv2.resize(np.logical_not(M0).astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(bool)
|
||||
|
||||
SearchLimitX0 = colfilt(self.SearchLimitX.copy(), (int(1/Scale), int(1/Scale)), 0, self.colfiltChunkSize) + colfilt(self.Dx0.copy(), (int(1/Scale), int(1/Scale)), 4, self.colfiltChunkSize)
|
||||
SearchLimitY0 = colfilt(self.SearchLimitY.copy(), (int(1/Scale), int(1/Scale)), 0, self.colfiltChunkSize) + colfilt(self.Dy0.copy(), (int(1/Scale), int(1/Scale)), 4, self.colfiltChunkSize)
|
||||
|
@ -467,7 +467,7 @@ class autoRIFT:
|
|||
MC2 = ndimage.distance_transform_edt(np.logical_not(MC)) < self.BuffDistanceC
|
||||
dstShape = (int(MC2.shape[0]*(self.sparseSearchSampleRate*ChipSize0_GridSpacing_oversample_ratio)),int(MC2.shape[1]*(self.sparseSearchSampleRate*ChipSize0_GridSpacing_oversample_ratio)))
|
||||
|
||||
MC2 = cv2.resize(MC2.astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(np.bool)
|
||||
MC2 = cv2.resize(MC2.astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(bool)
|
||||
# pdb.set_trace()
|
||||
if np.logical_not(np.all(MC2.shape == SearchLimitX0.shape)):
|
||||
rowAdd = SearchLimitX0.shape[0] - MC2.shape[0]
|
||||
|
@ -505,7 +505,7 @@ class autoRIFT:
|
|||
DyFM = colfilt(DyF.copy(), (self.fillFiltWidth, self.fillFiltWidth), 3, self.colfiltChunkSize)
|
||||
|
||||
# M0 is mask for original valid estimates, MF is mask for filled ones, MM is mask where filtered ones exist for filling
|
||||
MF = np.zeros(M0.shape, dtype=np.bool)
|
||||
MF = np.zeros(M0.shape, dtype=bool)
|
||||
MM = np.logical_not(np.isnan(DxFM))
|
||||
|
||||
for j in range(3):
|
||||
|
@ -555,8 +555,8 @@ class autoRIFT:
|
|||
dstShape = (Dx.shape[0],Dx.shape[1])
|
||||
DxF = cv2.resize(DxF,dstShape[::-1],interpolation=cv2.INTER_CUBIC)
|
||||
DyF = cv2.resize(DyF,dstShape[::-1],interpolation=cv2.INTER_CUBIC)
|
||||
MF = cv2.resize(MF.astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(np.bool)
|
||||
M0 = cv2.resize(M0.astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(np.bool)
|
||||
MF = cv2.resize(MF.astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(bool)
|
||||
M0 = cv2.resize(M0.astype(np.uint8),dstShape[::-1],interpolation=cv2.INTER_NEAREST).astype(bool)
|
||||
|
||||
idxRaw = M0 & (ChipSizeX == 0)
|
||||
idxFill = MF & (ChipSizeX == 0)
|
||||
|
|
Loading…
Reference in New Issue