Skip to content

Added masking on shapefile using salem#1

Open
mirkodandrea wants to merge 1 commit into
cvitolo:masterfrom
mirkodandrea:master
Open

Added masking on shapefile using salem#1
mirkodandrea wants to merge 1 commit into
cvitolo:masterfrom
mirkodandrea:master

Conversation

@mirkodandrea

Copy link
Copy Markdown
Collaborator

I've implemented an example of dataset masking on a shapefile using the salem library

The code is included at the end of the notebook

import salem

ds = xr.open_dataset(ds_name)
# Load the shapefile
shp_df = salem.read_shapefile(shapefile)
# Query for the US
shp_df_us = shdf.query('CNTRY_NAME=="United States"')
# mask the dataset on the selected geometries
ds_us = ds.salem.roi(shape=shp_df_us)

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

Successfully merging this pull request may close these issues.

1 participant