Skip to content

Commit

Permalink
Merge pull request #5 from gregory-halverson/main
Browse files Browse the repository at this point in the history
adding `hour_of_day` property to tiled product classes
  • Loading branch information
gregory-halverson authored Dec 4, 2024
2 parents 69dcb2e + 0e0854f commit a493de3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ECOv002_granules/L3TSEB.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from rasters import Raster

from .tiled_granule import ECOSTRESSTiledGranule

class L3TSEB(ECOSTRESSTiledGranule):
_PRIMARY_VARIABLE = "Rn"
_PRODUCT_NAME = "L3T_SEB"

@property
def Rn(self) -> Raster:
return self.variable("Rn")
4 changes: 4 additions & 0 deletions ECOv002_granules/tiled_granule.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ def time_solar(self) -> datetime:
else:
return self.UTC_to_solar(self.time_UTC, self.geometry.centroid_latlon.x)

@property
def hour_of_day(self) -> float:
return self.time_solar.hour + self.time_solar.minute / 60

@property
def build(self) -> str:
if self._build is not None:
Expand Down
2 changes: 1 addition & 1 deletion ECOv002_granules/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ECOv002_granules"
version = "1.0.1"
version = "1.0.2"
description = "ECOSTRESS Collection 2 Data Product Granule Encapsulation Classes"
readme = "README.md"
authors = [
Expand Down

0 comments on commit a493de3

Please sign in to comment.