Skip to content

Commit

Permalink
Add odc.aspect property
Browse files Browse the repository at this point in the history
useful for plotting, instead xx.odc.geobox.aspect do xx.odc.aspect
  • Loading branch information
Kirill888 committed Nov 9, 2023
1 parent 39fbaad commit cd39e9c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions odc/geo/_xr_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,13 @@ def geobox(self) -> Optional[SomeGeoBox]:
"""Query :py:class:`~odc.geo.geobox.GeoBox` or :py:class:`~odc.geo.gcp.GCPGeoBox`."""
return self._state.geobox

@property
def aspect(self) -> float:
gbox = self._state.geobox
if gbox is None:
return 1
return gbox.aspect

def output_geobox(self, crs: SomeCRS, **kw) -> GeoBox:
"""
Compute geobox of this data in other projection.
Expand Down

0 comments on commit cd39e9c

Please sign in to comment.