Skip to content

Commit

Permalink
Fix netcdf_to_tif to correctl shift longitude when custom 'lon' varia…
Browse files Browse the repository at this point in the history
…ble name given

lon was hard-coded as a variable name in the shifting logic, and was ignoring the variable being passed to the function. This fixes the bug
  • Loading branch information
jovanovski committed Sep 1, 2023
1 parent d099b85 commit ecd600e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4666,7 +4666,7 @@ def netcdf_to_tif(

if shift_lon:
xds.coords[lon] = (xds.coords[lon] + 180) % 360 - 180
xds = xds.sortby(xds.lon)
xds = xds.sortby(xds[lon])

allowed_vars = list(xds.data_vars.keys())
if isinstance(variables, str):
Expand Down

0 comments on commit ecd600e

Please sign in to comment.