diff --git a/CHANGELOG.md b/CHANGELOG.md index 846a62f..4036bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased](https://github.com/mllam/mllam-data-prep/compare/v0.7.0...HEAD) +### Changed +- consider full time information for derived calculation of TOA radiation [\#84](https://github.com/mllam/mllam-data-prep/pull/84) @observingClouds + ### Fixes - fix bug where coordinate selection of an unshared dimension isn't applied to subsequent ouput variables when an output variable without this dimension is processed before the others [\#90](https://github.com/mllam/mllam-data-prep/pull/90) @zweihuehner & @leifdenby diff --git a/mllam_data_prep/ops/derive_variable/physical_field.py b/mllam_data_prep/ops/derive_variable/physical_field.py index d7b9617..392b19c 100644 --- a/mllam_data_prep/ops/derive_variable/physical_field.py +++ b/mllam_data_prep/ops/derive_variable/physical_field.py @@ -38,10 +38,10 @@ def calculate_toa_radiation(lat, lon, time): # Different handling if xr.DataArray or datetime object if isinstance(time, xr.DataArray): day = time.dt.dayofyear - hour_utc = time.dt.hour + hour_utc = time.dt.hour + time.dt.minute / 60 + time.dt.second / 3600 elif isinstance(time, datetime.datetime): day = time.timetuple().tm_yday - hour_utc = time.hour + hour_utc = time.hour + time.minute / 60 + time.second / 3600 else: raise TypeError( "Expected an instance of xr.DataArray or datetime object,"