Skip to content

Commit

Permalink
properly apply all dimensions to deeply nested variables (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 authored Nov 14, 2024
1 parent 50af59d commit 4539e82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion icepyx/core/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ def _combine_nested_vars(is2ds, ds, grp_path, wanted_dict):
pass

ds = ds[grp_spec_vars].swap_dims({"delta_time": "photon_idx"})
# add the rest of the dimensions of length 1 from is2ds to ds
ds = ds.expand_dims(dim=[dim for dim in is2ds.dims if is2ds[dim].size == 1])
is2ds = is2ds.assign(ds)

return is2ds
Expand Down Expand Up @@ -812,7 +814,7 @@ def _build_single_file_dataset(self, file, groups_list):

# if there are any deeper nested variables,
# get those so they have actual coordinates and add them
# this may apply to (at a minimum): ATL08
# this may apply to (at a minimum): ATL06, ATL08
if any(grp_path in grp_path2 for grp_path2 in wanted_groups_list):
for grp_path2 in wanted_groups_list:
if grp_path in grp_path2:
Expand Down

0 comments on commit 4539e82

Please sign in to comment.