Skip to content

Commit

Permalink
Enhance radar and geo coordinates detection for stacked datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Jul 9, 2024
1 parent 88697f5 commit 2c41377
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pygmtsar/pygmtsar/datagrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ def is_ra(grid):
True if the grid is in radar coordinates, False otherwise.
"""
dims = grid.dims
coords = grid.coords
if 'stack' in dims and 'y' in coords and 'x' in coords:
return True
if 'y' in dims and 'x' in dims:
return True
return False
Expand All @@ -150,6 +153,9 @@ def is_geo(grid):
True if the grid is in geographic coordinates, False otherwise.
"""
dims = grid.dims
coords = grid.coords
if 'stack' in dims and 'lat' in coords and 'lon' in coords:
return True
if 'lat' in dims and 'lon' in dims:
return True
return False
Expand Down

0 comments on commit 2c41377

Please sign in to comment.