climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject [1/3] climate git commit: CLIMATE-890 - Changing time format when calendar in the netcdf file is 360_day
Date Wed, 09 Nov 2016 16:29:10 GMT
Repository: climate
Updated Branches:
  refs/heads/master 386f7b924 -> f06103b03


CLIMATE-890 - Changing time format when calendar in the netcdf file is 360_day

- utils.decode_time_values has been updated


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/39e9e2cc
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/39e9e2cc
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/39e9e2cc

Branch: refs/heads/master
Commit: 39e9e2cca75e254a1222423281cf33c6df4339ff
Parents: 386f7b9
Author: huikyole <huikyole@argo.jpl.nasa.gov>
Authored: Tue Nov 8 09:18:22 2016 -0800
Committer: huikyole <huikyole@argo.jpl.nasa.gov>
Committed: Tue Nov 8 09:18:22 2016 -0800

----------------------------------------------------------------------
 ocw/utils.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/39e9e2cc/ocw/utils.py
----------------------------------------------------------------------
diff --git a/ocw/utils.py b/ocw/utils.py
index 468ef58..df9a0a6 100755
--- a/ocw/utils.py
+++ b/ocw/utils.py
@@ -69,6 +69,9 @@ def decode_time_values(dataset, time_var_name):
 
         times = num2date(
             time_data[:], units=time_format, calendar=times_calendar)
+        if times_calendar == '360_day':
+            for it,t in enumerate(times):
+                times[it] = dt.datetime.strptime(str(t),'%Y-%m-%d 00:00:00')
     return times
 
 


Mime
View raw message