You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The & logic doesn't make sense to me. I'm not sure this is actually doing anything. This should be or or should be specified for range between lower_percentile and upper_percentile.
with rasterio.open(dsm_file) as ds:
img = ds.read(1, window=rasterio.windows.from_bounds(minx, miny, maxx, maxy, transform=ds.transform)).flatten()
img = np.ma.masked_where(img == ds.nodata, img)
std_values.append(np.std(img))
See previously issue about opening directly as masked array using rasterio, rather than a separate step.
I haven't tested, but if img is a masked array, then you should be able to directly do img.std() here to computed std of unmasked values. I don't know if np.std will honor the masked array values, or if you need to explicitly use np.ma.std - and behavior may be different for numpy 1.X vs 2.X. I noticed environment.yml has numpy pinned at 1.26.4 (https://github.com/uw-cryo/DeepDEM/blob/main/environment.yml#L11), not entirely sure why.
The text was updated successfully, but these errors were encountered:
In https://github.com/uw-cryo/DeepDEM/blob/main/notebooks/0d_Calculating_Scale_Factor.ipynb
The
&
logic doesn't make sense to me. I'm not sure this is actually doing anything. This should beor
or should be specified for range betweenlower_percentile
andupper_percentile
.See previously issue about opening directly as masked array using rasterio, rather than a separate step.
I haven't tested, but if
img
is a masked array, then you should be able to directly doimg.std()
here to computed std of unmasked values. I don't know ifnp.std
will honor the masked array values, or if you need to explicitly usenp.ma.std
- and behavior may be different for numpy 1.X vs 2.X. I noticedenvironment.yml
has numpy pinned at 1.26.4 (https://github.com/uw-cryo/DeepDEM/blob/main/environment.yml#L11), not entirely sure why.The text was updated successfully, but these errors were encountered: