Skip to content

Commit

Permalink
Add cloud mask filename parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbieker committed Oct 4, 2021
1 parent 091e15e commit 4925297
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions satip/eumetsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,9 @@ def eumetsat_filename_to_datetime(inner_tar_name):
title_match = p.match(inner_tar_name)
date_str = title_match.group(1)
return datetime.datetime.strptime(date_str, "%Y%m%d%H%M%S")


def eumetsat_cloud_name_to_datetime(filename: str):
"""Takes a file from the EUMETSAT API and returns the date and time part of the file for Cloud mask files"""
date_str = filename.split("0100-0100-")[-1].split(".")[0]
return datetime.datetime.strptime(date_str, "%Y%m%d%H%M%S")

0 comments on commit 4925297

Please sign in to comment.