Skip to content

Commit

Permalink
add atl23 to product lists and tests (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 authored Sep 12, 2023
1 parent ece278c commit aa6dd4a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions icepyx/core/is2ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def _validate_product(product):
"ATL19",
"ATL20",
"ATL21",
"ATL23",
], "Please enter a valid product"
else:
raise TypeError("Please enter a product string")
Expand Down
10 changes: 8 additions & 2 deletions icepyx/core/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def _run_fast_scandir(dir, fn_glob):

return subfolders, files


# Need to post on intake's page to see if this would be a useful contribution...
# https://github.com/intake/intake/blob/0.6.4/intake/source/utils.py#L216
def _pattern_to_glob(pattern):
Expand Down Expand Up @@ -697,8 +698,12 @@ def _read_single_grp(self, file, grp_path):
"""

return xr.open_dataset(file, group=grp_path, engine='h5netcdf',
backend_kwargs={'phony_dims': 'access'})
return xr.open_dataset(
file,
group=grp_path,
engine="h5netcdf",
backend_kwargs={"phony_dims": "access"},
)

def _build_single_file_dataset(self, file, groups_list):
"""
Expand Down Expand Up @@ -740,6 +745,7 @@ def _build_single_file_dataset(self, file, groups_list):
"ATL19",
"ATL20",
"ATL21",
"ATL23",
]:
is2ds = xr.open_dataset(file)

Expand Down
12 changes: 12 additions & 0 deletions icepyx/tests/test_is2ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ def test_atl21_product():
assert obs == expected


def test_atl23_product():
lcds = "atl23"
obs = is2ref._validate_product(lcds)
expected = "ATL23"
assert obs == expected

ucds = "ATL23"
obs = is2ref._validate_product(ucds)
expected = "ATL23"
assert obs == expected


########## about_product ##########
# Note: requires internet connection
# could the github flat data option be used here? https://octo.github.com/projects/flat-data
Expand Down

0 comments on commit aa6dd4a

Please sign in to comment.