Skip to content

Commit

Permalink
open ifile with dask. supply name to stacked dataarray to avaoid obsc…
Browse files Browse the repository at this point in the history
…ure default name like "stack-23412h4234kj"
  • Loading branch information
ahijevyc committed Aug 15, 2023
1 parent 0636546 commit 4ae4719
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions metplotpy/contributed/fv3_physics_tend/cross_section_vert.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def main():

# Open input file
logging.debug("open %s", ifile)
fv3ds = xarray.open_dataset(ifile)
fv3ds = xarray.open_mfdataset(ifile)

if subtract:
logging.info("subtracting %s", subtract)
Expand Down Expand Up @@ -176,7 +176,7 @@ def main():

# Stack variables along new tendency dimension of new DataArray.
tendency_dim = f"{variable} tendency"
tendencies_avg = tendencies_avg.to_array(dim=tendency_dim)
tendencies_avg = tendencies_avg.to_array(dim=tendency_dim, name=tendency_dim)
# Assign long_names to a new DataArray coordinate.
# It will have the same shape as tendency dimension.
tendencies_avg = tendencies_avg.assign_coords(
Expand Down
4 changes: 2 additions & 2 deletions metplotpy/contributed/fv3_physics_tend/planview_fv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main():

# Open input file
logging.debug("open %s", ifile)
fv3ds = xarray.open_dataset(ifile)
fv3ds = xarray.open_mfdataset(ifile)

if subtract:
logging.info("subtracting %s", subtract)
Expand Down Expand Up @@ -184,7 +184,7 @@ def main():

# Stack variables along new tendency dimension of new DataArray.
tendency_dim = f"{variable} tendency"
tendencies_avg = tendencies_avg.to_array(dim=tendency_dim)
tendencies_avg = tendencies_avg.to_array(dim=tendency_dim, name=tendency_dim)
# Assign long_names to a new DataArray coordinate.
# It will have the same shape as tendency dimension.
tendencies_avg = tendencies_avg.assign_coords(
Expand Down
4 changes: 2 additions & 2 deletions metplotpy/contributed/fv3_physics_tend/vert_profile_fv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def main():

# Open input file
logging.debug("open %s", ifile)
fv3ds = xarray.open_dataset(ifile)
fv3ds = xarray.open_mfdataset(ifile)

if subtract:
logging.info("subtracting %s", subtract)
Expand Down Expand Up @@ -171,7 +171,7 @@ def main():

# Stack variables along new tendency dimension of new DataArray.
tendency_dim = f"{variable} tendency"
tendencies_avg = tendencies_avg.to_array(dim=tendency_dim)
tendencies_avg = tendencies_avg.to_array(dim=tendency_dim, name=tendency_dim)
# Assign long_names to a new DataArray coordinate.
# It will have the same shape as tendency dimension.
tendencies_avg = tendencies_avg.assign_coords(
Expand Down

0 comments on commit 4ae4719

Please sign in to comment.