Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue # 425, make fixes to the contour plot for the Z value to remove… #426

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Users_Guide/tcrmw_cross_section.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from the METcalcpy vertical interpolation module, *vertical_interpolation.py*:

https://metcalcpy.readthedocs.io/en/develop/Users_Guide/vertical_interpolation.html

**NOTE**:Data must have the following **required fields**: **temperature**, **relative humidity**, and **surface pressure**. These are required by the METcalcpy vertical_interpolation module to compute pressure indices.

Example
=======
Expand Down
12 changes: 10 additions & 2 deletions metplotpy/contributed/tc_rmw/plot_cross_section.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,25 @@ def plot_cross_section(config, data_set, args):

field = data_set[config['field']]
itime = config['index_time_slice']
field_azi_mean = np.mean(field, axis=1)[:, :, itime]

# originally, axis=1 but the order of dimensions was modified
# (Github issue:https://github.com/dtcenter/METcalcpy/issues/308)
field_azi_mean = np.mean(field, axis=0)[:, :, itime]


# originally, the transpose of the field_azi_mean was used, but this is no
# longer necessary. If the transpose is used, the dimensions are incorrect
# and a TypeError will be raised by the contour plot.
scalar_contour = ax.contour(data_set['range'],
data_set[config['vertical_coord_name']],
field_azi_mean.transpose(),
field_azi_mean,
levels=np.arange(config['contour_level_start'],
config['contour_level_end'],
config['contour_level_stepsize']),
colors=config['contour_line_colors'],
linewidths=(config['line_width'])
)

plt.title(config['plot_title'])
ax.clabel(scalar_contour, colors=config['contour_label_color'], fmt=config['contour_label_fmt'])
ax.set_xlabel(config['x_label'])
Expand Down