Skip to content

Commit

Permalink
quotes bis
Browse files Browse the repository at this point in the history
  • Loading branch information
spjuhel committed Aug 23, 2024
1 parent 2d98fcf commit 447f6da
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions doc/tutorial/climada_engine_Forecast.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@
"\n",
"### generate exposure\n",
"# find out which hazard coord to consider\n",
"CHE_borders = u_plot._get_borders(np.stack([exposure.gdf["latitude"].values,\n",
" exposure.gdf["longitude"].values],\n",
"CHE_borders = u_plot._get_borders(np.stack([exposure.gdf['latitude'].values,\n",
" exposure.gdf['longitude'].values],\n",
" axis=1)\n",
" )\n",
"centroid_selection = np.logical_and(np.logical_and(hazard.centroids.lat >= CHE_borders[2],\n",
Expand Down Expand Up @@ -390,4 +390,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
10 changes: 5 additions & 5 deletions doc/tutorial/climada_engine_Impact.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"| event_id |list(int)| id (>0) of each hazard event (Hazard.event_id)|\n",
"| event_name |(list(str))| name of each event (Hazard.event_name)|\n",
"| date |np.array| date of events (Hazard.date)|\n",
"| coord_exp |np.array| exposures coordinates [lat, lon] (in degrees) (Exposure.gdf["latitudes"], Exposure.gdf["longitude"])|\n",
"| coord_exp |np.array| exposures coordinates [lat, lon] (in degrees) (Exposure.gdf['latitudes'], Exposure.gdf['longitude'])|\n",
"| frequency |np.array| frequency of events (Hazard.frequency)|\n",
"| frequency_unit |str| unit of event frequency, by default '1/year', i.e., annual (Hazard.frequency_unit)|\n",
"| unit |str| value unit used (Exposure.value_unit)|\n",
Expand Down Expand Up @@ -1468,7 +1468,7 @@
"\n",
"# Set Hazard in Exposures points\n",
"# set centroids from exposures coordinates\n",
"centr_pnt = Centroids.from_lat_lon(exp_pnt.gdf["latitude"].values, exp_pnt.gdf["longitude"].values, exp_pnt.crs)\n",
"centr_pnt = Centroids.from_lat_lon(exp_pnt.gdf['latitude'].values, exp_pnt.gdf['longitude'].values, exp_pnt.crs)\n",
"# compute Hazard in that centroids\n",
"tr_pnt = TCTracks.from_ibtracs_netcdf(storm_id='2007314N10093')\n",
"tc_pnt = TropCyclone.from_tracks(tr_pnt, centroids=centr_pnt)\n",
Expand All @@ -1492,7 +1492,7 @@
"# Compute Impact\n",
"imp_pnt = ImpactCalc(exp_pnt, impf_pnt, tc_pnt).impact()\n",
"# nearest neighbor of exposures to centroids gives identity\n",
"print('Nearest neighbor hazard.centroids indexes for each exposure:', exp_pnt.gdf["centr_TC"].values)\n",
"print('Nearest neighbor hazard.centroids indexes for each exposure:', exp_pnt.gdf['centr_TC'].values)\n",
"imp_pnt.plot_scatter_eai_exposure(ignore_zero=False, buffer=0.05);"
]
},
Expand Down Expand Up @@ -1716,7 +1716,7 @@
"# Compute impact\n",
"imp_ras = ImpactCalc(exp_ras, impf_ras, haz_ras).impact(save_mat=False)\n",
"# nearest neighbor of exposures to centroids is not identity because litpop does not contain data outside the country polygon\n",
"print('\\n Nearest neighbor hazard.centroids indexes for each exposure:', exp_ras.gdf["centr_FL"].values)\n",
"print('\\n Nearest neighbor hazard.centroids indexes for each exposure:', exp_ras.gdf['centr_FL'].values)\n",
"imp_ras.plot_raster_eai_exposure();"
]
},
Expand Down Expand Up @@ -1967,7 +1967,7 @@
"\n",
"# compute sequence of hazards using TropCyclone video_intensity method\n",
"exp_sea = add_sea(exp_video, (100, 5))\n",
"centr_video = Centroids.from_lat_lon(exp_sea.gdf["latitude"].values, exp_sea.gdf["longitude"].values)\n",
"centr_video = Centroids.from_lat_lon(exp_sea.gdf['latitude'].values, exp_sea.gdf['longitude'].values)\n",
"centr_video.check()\n",
"\n",
"track_name = '2017242N16333'\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/climada_entity_Exposures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@
"# Example 3: plot_raster method\n",
"from climada.util.plot import add_cntry_names # use climada's plotting utilities\n",
"ax = exp.plot_raster(); # plot with same resolution as data\n",
"add_cntry_names(ax, [exp.gdf["longitude"].min(), exp.gdf["longitude"].max(), exp.gdf["latitude"].min(), exp.gdf["latitude"].max()])\n",
"add_cntry_names(ax, [exp.gdf['longitude'].min(), exp.gdf['longitude'].max(), exp.gdf['latitude'].min(), exp.gdf['latitude'].max()])\n",
"\n",
"# use keyword argument save_tiff='filepath.tiff' to save the corresponding raster in tiff format\n",
"# use keyword argument raster_res='desired number' to change resolution of the raster."
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/climada_entity_LitPop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@
" raise err\n",
"exp.plot_scatter();\n",
"\n",
"# Note that `exp.gdf["region_id"]` is a number identifying each country:\n",
"# Note that `exp.gdf['region_id']` is a number identifying each country:\n",
"print('\\n Region IDs (`region_id`) in this exposure:')\n",
"print(exp.gdf["region_id"].unique())"
"print(exp.gdf['region_id'].unique())"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/climada_util_calibrate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@
"# tracks.plot()\n",
"\n",
"# # Calculate windfield for the tracks\n",
"# centroids = Centroids.from_lat_lon(exposure.gdf["latitude"], exposure.gdf["longitude"])\n",
"# centroids = Centroids.from_lat_lon(exposure.gdf['latitude'], exposure.gdf['longitude'])\n",
"# hazard = TropCyclone.from_tracks(tracks, centroids)"
]
},
Expand Down

0 comments on commit 447f6da

Please sign in to comment.