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

update tutorials using eodag-cube #1385

Open
3 tasks
sbrunato opened this issue Nov 5, 2024 · 2 comments
Open
3 tasks

update tutorials using eodag-cube #1385

sbrunato opened this issue Nov 5, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sbrunato
Copy link
Collaborator

sbrunato commented Nov 5, 2024

Update the following tutorials, using eodag-cube:

Also use cartopy , like on this example that plots Sea ice area fraction from an dedt_lumi product type on an European cropped area:

import cartopy.crs as crs
import cartopy.feature as cfeature

# europe crop
mask_lon = (ds.longitude >= 348) | (ds.longitude <= 48)
mask_lat = (ds.latitude >= 32) & (ds.latitude <= 72)
ds_eu = ds.where(mask_lon & mask_lat, drop=True)

fig = plt.figure(figsize=(8,6))

ax = fig.add_subplot(1,1,1, projection=crs.Mercator())

ax.add_feature(cfeature.COASTLINE)
ax.gridlines(draw_labels=True)

sc = plt.scatter(
    x=ds_eu.longitude[::5], y=ds_eu.latitude.data[::5], c=ds_eu.siconc[::5], 
    cmap="cool", s=1, transform=crs.PlateCarree()
)
plt.colorbar(sc, label=ds.siconc.long_name)

plt.show()

image

@sbrunato sbrunato added the enhancement New feature or request label Nov 5, 2024
@amarandon
Copy link
Collaborator

amarandon commented Nov 8, 2024

@sbrunato I started looking at the cds tutorial and one potential issue I can see with replacing the call to .download by a call to eodag-cube's .get_data is that it requires a band argument which in the case of grib data is not known until we download the data and look at the file names.

Unless there's a way to know it in advance and I'm not aware of it?

@amarandon
Copy link
Collaborator

amarandon commented Nov 12, 2024

@sbrunato I started looking at the cds tutorial and one potential issue I can see with replacing the call to .download by a call to eodag-cube's .get_data is that it requires a band argument which in the case of grib data is not known until we download the data and look at the file names.

Unless there's a way to know it in advance and I'm not aware of it?

As per discussion with @sbrunato, let's use a regular expression similar to .*\.grib$ to match the single grib file that will have been downloaded.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants