def _read(gbox, resampling='nearest', fallback_nodata=-999, dst_nodata=-999): rdr = open_reader(mm.path, nodata=fallback_nodata) yy = np.full(gbox.shape, dst_nodata, dtype=rdr.dtype) yy_, roi = read_time_slice_v2(rdr, gbox, resampling, dst_nodata) yy[roi] = yy_ return yy, roi
def _read(gbox, resampling='nearest', fallback_nodata=-999, dst_nodata=-999, check_paste=False): rdr = open_reader(mm.path, nodata=fallback_nodata) if check_paste: # check that we are using paste paste_ok, reason = can_paste( compute_reproject_roi(rdr_geobox(rdr), gbox)) assert paste_ok is True, reason yy = np.full(gbox.shape, dst_nodata, dtype=rdr.dtype) yy_, roi = read_time_slice_v2(rdr, gbox, resampling, dst_nodata) yy[roi] = yy_ return yy, roi