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

Flipped images #1

Open
scene-mosaic opened this issue Jul 10, 2023 · 1 comment
Open

Flipped images #1

scene-mosaic opened this issue Jul 10, 2023 · 1 comment

Comments

@scene-mosaic
Copy link

The code flips the product images at the end. Flips the y-axis, it seems.

@jennaguffogg
Copy link

I resolved this by adding these two lines, which uses numpy to vertically flip the data:

rem_flipped = xr.DataArray(np.flipud(rem.values), dims=rem.dims, coords=rem.coords)
cropped_flipped = xr.DataArray(np.flipud(cropped.values), dims=cropped.dims, coords=cropped.coords)

and then using the 'flipped' versions to create the final outputs:

colors = ['#f2f7fb', '#81a8cb', '#37123d']
shade(rem_flipped.squeeze(), cmap=colors, span=[0, 20], how='linear')

a = shade(xrspatial.hillshade(cropped_flipped.squeeze(), angle_altitude=1, azimuth=250), cmap=['black', 'white'], how='linear')
b = shade(rem_flipped.squeeze(), cmap=colors, span=[0, 10], how='linear', alpha=200)
stack(a, b)

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

2 participants