Skip to content

Commit

Permalink
Redo figures with colorbar labels that have field name.
Browse files Browse the repository at this point in the history
And correct order of nophys and phys.

Dequantify before cross_section to avoid NotImplementedError: Don't yet support
 nd fancy indexing from cross_section(). something to do with dask and units.
  • Loading branch information
ahijevyc committed Aug 15, 2023
1 parent b03bf90 commit d8eaff0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Binary file modified docs/Users_Guide/figure/tmp_500hPa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Users_Guide/figure/tmp_pbl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Users_Guide/figure/ugrd_28.0N-120.0E-26.0N-75.0E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions metplotpy/contributed/fv3_physics_tend/cross_section_vert.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,14 @@ def main():
longitude_of_central_meridian=-97.5,
latitude_of_projection_origin=fv3["standard_parallel"]).metpy.assign_y_x(
force=True, tolerance=55000*units.m)
logging.info("Define cross section.")
cross = cross_section(da2plot, startpt, endpt)

# dequantify moves units from DataArray to attributes. Now they show up in colorbar.
# and avoid NotImplementedError: Don't yet support nd fancy indexing from cross_section()
da2plot = da2plot.metpy.dequantify()

logging.info("Define cross section.")
cross = cross_section(da2plot, startpt, endpt)

logging.info("plot pcolormesh")
# normalized width and height of inset. Shrink colorbar to provide space.
wid_inset, hgt_inset = 0.18, 0.18
Expand Down Expand Up @@ -287,7 +289,7 @@ def main():

# Annotate figure with args namespace and timestamp
fineprint = f"{args} "
fineprint += f", created {datetime.datetime.now(tz=None)}"
fineprint += f"created {datetime.datetime.now(tz=None)}"
if nofineprint:
logging.debug(fineprint)
else:
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 @@ -300,9 +300,9 @@ def main():
title = f'{da2plot.coords["long_name"].data} {title}'
plt.suptitle(title, wrap=True)

# Annotate figure with args namespace, total area, and timestamp
# Annotate figure with args namespace and timestamp
fineprint = f"{args} "
fineprint += (f"created {datetime.datetime.now(tz=None)}")
fineprint += f"created {datetime.datetime.now(tz=None)}"
if nofineprint:
logging.debug(fineprint)
else:
Expand Down

0 comments on commit d8eaff0

Please sign in to comment.