Skip to content

Commit

Permalink
Clarify handling of frame_time_offset variables #17
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Sep 12, 2022
1 parent 8d617a9 commit 344b28a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/stactools/goes_glm/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,9 @@ def create_asset(

var_name = f"{type}_{col}"
if var_name not in dataset.variables:
if col.startswith("frame_"):
# Some datasets don't contain these variables so generate files without them
logger.warning(
f"Variable {var_name} is missing, not exporting them to geoparquet"
)
if col.startswith("frame_time_offset"):
# Some older datasets don't contain these variables so generate files without them.
# See https://github.com/stactools-packages/goes-glm/issues/17
continue
else:
raise Exception(f"Variable '{var_name}' is missing")
Expand Down
4 changes: 3 additions & 1 deletion tests/test_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ def test_create_item(self) -> None:

self.assertTrue("cube:variables" in asset)
vars = asset["cube:variables"]
self.assertGreaterEqual(len(vars), 45) # often 48, sometimes less
# Some older files have 45 variables, newer ones have 48. See
# https://github.com/stactools-packages/goes-glm/issues/17#issuecomment-1241875842
self.assertTrue(len(vars) == 45 or len(vars) == 48)
for var in vars.values():
self.assertTrue("dimensions" in var)
self.assertTrue("type" in var)
Expand Down

0 comments on commit 344b28a

Please sign in to comment.