Skip to content

Commit

Permalink
Update of result time to be consistent with OMS (e.g. "Where sensor o…
Browse files Browse the repository at this point in the history
…bservation results are post-processed, the resultTime is the post-processing time, while the phenomenonTime is the time of initial interaction with the world.")
  • Loading branch information
david-i-berry committed Nov 27, 2024
1 parent 108eea1 commit b53057b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions bufr2geojson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,7 @@ def as_geojson(self, bufr_handle: int, id: str,
f"Error getting phenomenon time, skipping ({e})")
continue

# Get result time
if "/" in phenomenon_time:
result_time = phenomenon_time.split("/")
result_time = result_time[1]
else:
result_time = phenomenon_time
result_time = datetime.now().strftime('%Y-%m-%d %H:%M')

# check if we have statistic, if so modify observed_property
fos = self.get_qualifier("08","first_order_statistics",None)
Expand Down Expand Up @@ -1155,9 +1150,9 @@ def transform(data: bytes, guess_wsi: bool = False,
with BytesIO() as bufr_bytes:
codes_write(single_subset, bufr_bytes)
bufr_bytes.seek(0)
sha512 = hashlib.sha512()
sha512.update(bufr_bytes.getvalue())
reportIdentifier = sha512.hexdigest()
bhash = hashlib.md5()
bhash.update(bufr_bytes.getvalue())
reportIdentifier = bhash.hexdigest()

LOGGER.debug("Unpacking")
codes_set(single_subset, "unpack", True)
Expand Down

0 comments on commit b53057b

Please sign in to comment.