Skip to content

Commit d0cecf5

Browse files
Levi Pfantzdjhoese
authored andcommitted
Fix #458: Add units parameter to resolution warning log
1 parent 3b88efc commit d0cecf5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pyresample/area_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def _convert_coordinate_for_metered_units(var, units: str, src_crs: CRS, dst_crs
739739
return transformer.transform(*var)
740740

741741

742-
def _round_shape(shape, radius=None, resolution=None):
742+
def _round_shape(shape, radius=None, resolution=None, units="meters"):
743743
"""Make sure shape is an integer.
744744
745745
Rounds down if shape is less than .01 above nearest whole number to
@@ -765,8 +765,8 @@ def _round_shape(shape, radius=None, resolution=None):
765765
if radius is not None and resolution is not None:
766766
new_resolution = (2 * radius[0] / width, 2 * radius[1] / height)
767767
logger.warning('shape found from radius and resolution does not contain only '
768-
'integers: {0}\nRounding shape to {1} and resolution from {2} meters to '
769-
'{3} meters'.format(shape, (height, width), resolution, new_resolution))
768+
'integers: {0}\nRounding shape to {1} and resolution from {2} {3} to '
769+
'{4} {3}'.format(shape, (height, width), resolution, units, new_resolution))
770770
else:
771771
logger.warning('shape provided does not contain only integers: {0}\n'
772772
'Rounding shape to {1}'.format(shape, (height, width)))
@@ -829,7 +829,7 @@ def _extrapolate_information(area_extent, shape, center, radius, resolution, upp
829829
if radius is not None and resolution is not None:
830830
# Function 2-A
831831
new_shape = _round_shape((2 * radius[1] / resolution[1], 2 * radius[0] / resolution[0]), radius=radius,
832-
resolution=resolution)
832+
resolution=resolution, units=units)
833833
shape = _validate_variable(shape, new_shape, 'shape', ['radius', 'resolution'])
834834
elif resolution is not None and shape is not None:
835835
# Function 2-B

0 commit comments

Comments
 (0)