Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make operations at full res #193

Open
vincelhx opened this issue Jan 10, 2024 · 1 comment
Open

make operations at full res #193

vincelhx opened this issue Jan 10, 2024 · 1 comment

Comments

@vincelhx
Copy link
Contributor

force full resolution for DN operations
and then reproject on user grid with rasterio.warp.reproject

@vincelhx
Copy link
Contributor Author

vincelhx commented Jan 10, 2024

idea of the code to use to reproject at the end (after denoising & recalibration)
inspired by code in https://github.com/umr-lops/xarray-safe-s1/blob/main/safe_s1/metadata.py

sigma0_vv = s1DatasetfullRes.dataset.sigma0.sel(pol='VV')
src_crs = sigma0_vv.rio.crs  
src_transform = sigma0_vv.rio.transform() 
dst_crs = src_crs

sample, _ = translate * scale * (s1DatasetfullRes.dataset.sample, 0)
_, line = translate * scale * (0, s1DatasetfullRes.dataset.line)
dst2 = translate * scale
destination = np.empty(shape=out_shape, dtype=sigma0_vv.dtype)

zzzz_rms = rasterio.warp.reproject(
    source=sigma0_vv,
    destination=destination,
    src_transform=src_transform,
    src_crs=src_crs,
    dst_transform=dst2,
    dst_crs=dst_crs,
    resampling=Resampling.rms  
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant