Skip to content

Commit

Permalink
fix(Raster): resample_to_grid failure no data masking failure with in…
Browse files Browse the repository at this point in the history
…t dtype (#1328)

* update(test_raster_sampling_methods): update for mean resampling
  • Loading branch information
jlarsen-usgs committed Jan 21, 2022
1 parent 16b84e8 commit dced106
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autotest/t065_test_gridintersect.py
Expand Up @@ -1398,7 +1398,7 @@ def test_raster_sampling_methods():
methods = {
"min": 2088.52343,
"max": 2103.54882,
"mean": 2097.05053,
"mean": 2097.05035,
"median": 2097.36254,
"nearest": 2097.81079,
"linear": 2097.81079,
Expand Down
4 changes: 2 additions & 2 deletions flopy/utils/rasters.py
Expand Up @@ -454,7 +454,7 @@ def resample_to_grid(
else:
for node in range(ncpl):
verts = modelgrid.get_cell_vertices(node)
rstr_data = self.sample_polygon(verts, band)
rstr_data = self.sample_polygon(verts, band).astype(float)
msk = np.in1d(rstr_data, self.nodatavals)
rstr_data[msk] = np.nan

Expand Down Expand Up @@ -539,7 +539,7 @@ def __threaded_resampling(
"""
container.acquire()
verts = modelgrid.get_cell_vertices(node)
rstr_data = self.sample_polygon(verts, band)
rstr_data = self.sample_polygon(verts, band).astype(float)
msk = np.in1d(rstr_data, self.nodatavals)
rstr_data[msk] = np.nan

Expand Down

0 comments on commit dced106

Please sign in to comment.