Skip to content

Commit

Permalink
fix FIRE
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed May 27, 2024
1 parent a8e67ac commit c32da2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions notebooks/wp5/FIRE_burned_area_trends.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"ds.rio.write_crs(crs, inplace=True)\n",
"\n",
"regions = regionmask.from_geopandas(gdf, names=\"NUTS_NAME\")\n",
"mask = regions.mask(ds[\"longitude\"], ds[\"latitude\"])"
"mask = regions.mask_3D(ds[\"longitude\"], ds[\"latitude\"])"
]
},
{
Expand All @@ -180,8 +180,8 @@
"metadata": {},
"outputs": [],
"source": [
"da_grouped = da.groupby(mask.rename(\"region\")).sum((\"latitude\", \"longitude\", \"month\"))\n",
"da_grouped = da_grouped.assign_coords(region=regions.names).compute()\n",
"da_grouped = da.where(mask).sum((\"latitude\", \"longitude\", \"month\"))\n",
"da_grouped = da_grouped.assign_coords(region=mask[\"names\"]).compute()\n",
"\n",
"df_dict = {\"slope\": [], \"intercept\": [], \"tau\": [], \"p-value\": []}\n",
"for region in gdf[\"NUTS_NAME\"]:\n",
Expand Down Expand Up @@ -321,7 +321,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down

0 comments on commit c32da2f

Please sign in to comment.