sdap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SDAP-96) TimeSeriesSpark
Date Tue, 18 Sep 2018 17:41:00 GMT

    [ https://issues.apache.org/jira/browse/SDAP-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16619440#comment-16619440
] 

ASF GitHub Bot commented on SDAP-96:
------------------------------------

fgreg closed pull request #32: SDAP-96 Clean up and document TimeSeriesSpark
URL: https://github.com/apache/incubator-sdap-nexus/pull/32
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/analysis/webservice/algorithms_spark/TimeSeriesSpark.py b/analysis/webservice/algorithms_spark/TimeSeriesSpark.py
index e89a00e..a24c2d5 100644
--- a/analysis/webservice/algorithms_spark/TimeSeriesSpark.py
+++ b/analysis/webservice/algorithms_spark/TimeSeriesSpark.py
@@ -505,6 +505,10 @@ def spark_driver(daysinrange, bounding_polygon, ds, fill=-9999., spark_nparts_ne
 
 def calc_average_on_day(tile_in_spark):
     import shapely.wkt
+    from datetime import datetime
+    from pytz import timezone
+    ISO_8601 = '%Y-%m-%dT%H:%M:%S%z'
+
     (bounding_wkt, dataset, timestamps, fill) = tile_in_spark
     if len(timestamps) == 0:
         return []
@@ -561,7 +565,8 @@ def calc_average_on_day(tile_in_spark):
             'mean': daily_mean,
             'cnt': data_count,
             'std': data_std,
-            'time': int(timeinseconds)
+            'time': int(timeinseconds),
+            'iso_time': datetime.utcfromtimestamp(int(timeinseconds)).replace(tzinfo=timezone('UTC')).strftime(ISO_8601)
         }
         stats_arr.append(stat)
     return stats_arr


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> TimeSeriesSpark
> ---------------
>
>                 Key: SDAP-96
>                 URL: https://issues.apache.org/jira/browse/SDAP-96
>             Project: Apache Science Data Analytics Platform
>          Issue Type: Sub-task
>          Components: nexus
>            Reporter: Frank Greguska
>            Priority: Minor
>
> Determine necessary updates to and document API.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message