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

Feature 380 phys tend plot actual #381

Closed

Conversation

ahijevyc
Copy link
Contributor

@ahijevyc ahijevyc commented Aug 7, 2023

Pull Request Testing

  • Describe testing already performed for these changes:
    plot all 4 state variables (tmp, spfh, ugrd, vgrd) in all 3 scripts (planview, cross section, and vertical profile) with 1-hour time window and 2-hour time window, starting at or after initialization time.

  • planview with and without vmin vmax, with all 3 types of vertical interpolation

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
    Not sure how to import physics_tend.py. Is it import physics_tend? or from . import physics_tend? pylint recommends from ., but this doesn't work when I test it. it has to be simpler import physics_tend

  • upload new fv3_history.nc and grid_spec.nc

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes or No]

  • Do these changes include sufficient testing updates? [Yes or No]

  • Will this PR result in changes to the test suite? [Yes or No]

    If yes, describe the new output and/or changes to the existing output:

  • Please complete this pull request review by [Fill in date].

Pull Request Checklist

See the METplus Workflow for details.

  • Add any new Python packages to the METplus Components Python Requirements table.
  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s)
    Select: Organization level software support Project or Repository level development cycle Project
    Select: Milestone as the version that will include these changes
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

Only apply add_time0 function if time0 if needed.

Round times to nearest millisecond. This fixes times like 2019-06-15 18:03:0.000003,
which is supposed to be 2019-06-15 18:03 but has imprecise floating-point value.

Allow metpy.quantify() to protect units
This eliminates the need to restore units after applying .mean to DataArray.

Round times to nearest millisecond. Model output times are sometimes
imprecise due to floating point error.

Let argparse assume arguments are strings unless specified otherwise.

Allow time window to be a float, not just an int.

Refer to sum of all tendencies as "all_tendencies" instead of "total".

"dstate_variable" ->  "actual_tendency"

Don't treat nophys tendency differently. UFS output changed.
Removed bug where final units are assumed to be temperature tendency "K/hour".
Keep the tendencies in their native units of "[something] per second" instead
of converting to "[something] per hour".

Define time slice starting with time-after-time0 and ending with validtime.
We use the time *after* time0 because the time range of the tendency field is the period
immediately prior to the tendency timestamp.
That way, slice(time_after_time0, validtime) has a time range of [time0,validtime].
Compute the time-weighted mean tendencies for time index slice.

Be clear about "all" tendencies. It is the sum of all tendencies,
physics and non-physics. It does not include the
physics tendency variable, which may be part of the history file and
included in the tendency_vars list. That would be double-counting.

Subtract physics tendency variable if it was in tendency_vars.

Command line changes:
 Read file-type command line args as strings, not argparse.FileType('r').
 For simpler code.

 --norobust flag (to use data extremes for colormap range, not 99th
 and 2nd percentiles.)

logging info about renaming variables.
 Keep characters after final underscore. The first part is redundant.
 For example dtend_u_pbl -> pbl

actual_change -> actual_tendency

Test for shp is not None, not shp.
(Accept shp=something evaluated as False, like 0)

Print entire arg Namespace as fineprint, not just select variables.
Use plt.figtext instead of plt.annotate. Makes for cleaner code.

Reduce xarray time selection tolerance from 1 sec to 1 millisecond.

pep8 changes

reorder load modules

module and function documentation

shorten lines

lazy logging messages (no f-string)

specify encoding on open
Fix names of tendency variables in config file. The
state variables are not the same as the tendency variable
prefixes. For example spfh vs. qv.
new variable names

add table for derived tendencies

note about time window starting at initialization time and dealing
with it by appending state variables at time0.
equation for residual in description
new date for new history file in Users Guide

new figures for Users Guide

fill -> tendencytype

simplify construction of da2plot in planview_fv3.py

don't allow user to plot state variable at validtime or time0.
it makes code so much uglier for such a simple request.

No explicit debug option for physics_tend.pts_in_shp

Restore statevariable in default output filename in planview_fv3.py.

100 dpi default instead of 150
fix link to cross section png
Remove time_varname from yaml config file.
Assert time0 exists, and if not, help the user by listing the
nearest time available.

Make longitude the xaxis of cross section instead of 'index'.

Dequantify *after* cross section to preserve units.
Specify lat lon order of endpoints in cross_section_vert.py.

Remove dindex argument. xarray does a good job of choosing the
major axis interval.

Note vertical interpolation method in planview_fv3.py and reveal
actual pressure level in title instead of requested level.
@ahijevyc ahijevyc added type: enhancement Improve something that it is currently doing priority: medium Medium Priority requestor: NOAA/GSL NOAA Global Systems Laboratory requestor: NCAR National Center for Atmospheric Research METplotpy: Plots labels Aug 7, 2023
@ahijevyc ahijevyc added this to the Consider for Next Release milestone Aug 7, 2023
@ahijevyc ahijevyc requested a review from bikegeek August 7, 2023 20:09
@ahijevyc ahijevyc self-assigned this Aug 7, 2023
@ahijevyc ahijevyc linked an issue Aug 7, 2023 that may be closed by this pull request
33 tasks
@ahijevyc
Copy link
Contributor Author

ahijevyc commented Aug 7, 2023

retrying pull request with dtcenter/METplotpy.git instead of ahijevyc/METplotpy.git

@ahijevyc ahijevyc closed this Aug 7, 2023
@ahijevyc ahijevyc deleted the feature_380_phys_tend_plot_actual branch August 7, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
METplotpy: Plots priority: medium Medium Priority requestor: NCAR National Center for Atmospheric Research requestor: NOAA/GSL NOAA Global Systems Laboratory type: enhancement Improve something that it is currently doing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update fv3_physics_tend for new FV3 output format
1 participant