Skip to content

Commit

Permalink
debugging result.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Jul 7, 2023
1 parent 6a2a0ca commit 9595bfa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions synop2bufr/pygeoapi_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#
###############################################################################
import base64
import json
import logging
from pygeoapi.process.base import BaseProcessor

Expand Down Expand Up @@ -89,7 +90,7 @@
},
"example": {
"inputs": {
"data":r"AAXX 21121 15015 02999 02501 10103 21090 39765 42952 57020 60001 333 4/000 55310 0//// 22591 3//// 60007 91003 91104=", # noqa
"data": r"AAXX 21121 15015 02999 02501 10103 21090 39765 42952 57020 60001 333 4/000 55310 0//// 22591 3//// 60007 91003 91104=", # noqa
"metadata": r"station_name,wigos_station_identifier,traditional_station_identifier,facility_type,latitude,longitude,elevation,territory_name,wmo_region\\nOCNA SUGATAG,0-20000-0-15015,15015,Land (fixed),47.77706163,23.94046026,503,Romania,6", #noqa
"year": 2022,
"month": 2
Expand Down Expand Up @@ -133,7 +134,11 @@ def execute(self, data):
# and add to single output object

for result in bufr_generator:
# need to convert BUFR binary to base64
result['bufr4'] = base64.b64encode( result['bufr4'] ).decode("utf-8") # noqa
# convert datetime to string
result['_meta']['properties']['datetime'] = \
result['_meta']['properties']['datetime'].isoformat()
bufr.append(result)

except Exception as e:
Expand All @@ -142,8 +147,6 @@ def execute(self, data):

output = {"result": json.dumps(bufr), "errors": json.dumps(errors)}


LOGGER.error("returning")
return mimetype, output

def __repr__(self):
Expand Down

0 comments on commit 9595bfa

Please sign in to comment.