Skip to content

Commit

Permalink
cleanup madis changes
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Jan 25, 2023
1 parent 6f5835c commit 200e57a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/ingestors/madis/extract_hfmetar.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def find_fn(argv):
for i in range(start, 5):
ts = utcnow - datetime.timedelta(hours=i)
for j in range(300, -1, -1):
fn = ts.strftime(f"/mesonet/data/madis/hfmetar/%Y%m%d_%H00{j}.nc")
fn = ts.strftime(f"/mesonet/data/madis/hfmetar/%Y%m%d_%H00_{j}.nc")
if os.path.isfile(fn):
return fn
LOG.warning("no MADIS HFMETAR file found!")
Expand Down
5 changes: 3 additions & 2 deletions scripts/outgoing/madis2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ def main():
utc = datetime.datetime.utcnow()
fn = None
for i in range(300, -1, -1):
fn = f"/mesonet/data/madis/mesonet1/{utc:%Y%m%d_%H}00_{i}.nc"
if not os.path.isfile(fn):
testfn = f"/mesonet/data/madis/mesonet1/{utc:%Y%m%d_%H}00_{i}.nc"
if not os.path.isfile(testfn):
continue
fn = testfn
LOG.info("Found %s", fn)
break
if fn is None:
Expand Down

0 comments on commit 200e57a

Please sign in to comment.