Skip to content

Commit 2f4ddf7

Browse files
committed
np dtype fixes
1 parent 19e593b commit 2f4ddf7

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

fct/height/HeightAboveNearestDrainage.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@
2727
import fiona
2828
import fiona.crs
2929

30-
from .. import terrain_analysis as ta
31-
from .. import speedup
32-
from ..config import (
33-
config,
30+
from fct import terrain_analysis as ta
31+
from fct import speedup
32+
from fct.config import (
3433
LiteralParameter,
3534
DatasetParameter
3635
)
37-
from ..config.descriptors import DatasetResolver
38-
from ..rasterize import rasterize_linestringz
39-
# from ..swath import nearest_value_and_distance
40-
from ..measure.Measurement import nearest_value_and_distance
41-
from ..cli import starcall
36+
from fct.config.descriptors import DatasetResolver
37+
from fct.rasterize import rasterize_linestringz
38+
# from fct.swath import nearest_value_and_distance
39+
from fct.measure.Measurement import nearest_value_and_distance
40+
from fct.cli import starcall
4241

4342
class Parameters:
4443
"""
@@ -209,7 +208,7 @@ def accept_pixel(i, j):
209208
if refaxis_pixels:
210209

211210
nearest, reference, distance = nearest_value_and_distance(
212-
np.array(refaxis_pixels),
211+
np.array(refaxis_pixels, dtype='float32'),
213212
mask,
214213
ds.nodata)
215214

fct/profiles/SwathProfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def SwathProfileUnit(
197197
logger.error('Window error on swath (%d, %f)', axis, measure)
198198
return None
199199

200-
mask = (nearest == float(axis)) & (swaths == float(swath)) & (values != nodata)
200+
mask = (nearest.astype('float32') == float(axis)) & (swaths.astype('float32') == float(swath)) & (values != nodata)
201201

202202
if np.sum(mask) == 0:
203203
return None

0 commit comments

Comments
 (0)