Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit c6ad9e4

Browse files
committed
Address comments
#minor
1 parent 19b02a5 commit c6ad9e4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

nowcasting_dataset/data_sources/satellite/satellite_data_source.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ def get_spatial_region_of_interest(
163163

164164
# Check whether the requested region of interest steps outside of the available data:
165165
# Need to know how much to pad the outputs, so can do that here
166-
min_width_padding = max(-min_x_and_y_index_width.x_index_at_center, 0)
167-
max_width_padding = max(
166+
left_width_padding = max(-min_x_and_y_index_width.x_index_at_center, 0)
167+
right_width_padding = max(
168168
max_x_and_y_index_width.x_index_at_center - len(data_array.x_geostationary), 0
169169
)
170-
min_height_padding = max(-min_x_and_y_index_height.y_index_at_center, 0)
171-
max_height_padding = max(
170+
bottom_height_padding = max(-min_x_and_y_index_height.y_index_at_center, 0)
171+
top_height_padding = max(
172172
max_x_and_y_index_height.y_index_at_center - len(data_array.y_geostationary), 0
173173
)
174174

@@ -189,15 +189,15 @@ def get_spatial_region_of_interest(
189189
# isel is wrong if padding before, so add padding after to be the correct size
190190
# Get the difference for each direction and use that
191191
if (
192-
min_height_padding > 0
193-
or min_width_padding > 0
194-
or max_height_padding > 0
195-
or max_width_padding > 0
192+
bottom_height_padding > 0
193+
or left_width_padding > 0
194+
or top_height_padding > 0
195+
or right_width_padding > 0
196196
):
197197
data_array = data_array.pad(
198198
pad_width={
199-
"x_geostationary": (min_width_padding, max_width_padding),
200-
"y_geostationary": (min_height_padding, max_height_padding),
199+
"x_geostationary": (left_width_padding, right_width_padding),
200+
"y_geostationary": (bottom_height_padding, top_height_padding),
201201
},
202202
mode="constant",
203203
constant_values=0,

0 commit comments

Comments
 (0)