We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8879741 commit 5d04201Copy full SHA for 5d04201
1 file changed
workflow/scripts/resample.py
@@ -107,9 +107,9 @@ def determine_pixel_areas(raster_input):
107
"""
108
# the following is based on https://gis.stackexchange.com/a/288034/77760
109
# and assumes the data to be in EPSG:4326
110
- assert (
111
- raster_input.rio.crs.to_epsg() == 4326
112
- ), "raster_input does not have the projection EPSG:4326"
+ assert raster_input.rio.crs.to_epsg() == 4326, (
+ "raster_input does not have the projection EPSG:4326"
+ )
113
resolution = raster_input.rio.resolution()[0] # resolution in degrees
114
varea_of_pixel = np.vectorize(lambda lat: _area_of_pixel(resolution, lat))
115
pixel_area = varea_of_pixel(raster_input.y) * 1000**2 # convert to m^2
0 commit comments