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 1020 set_attrs #1406

Merged
merged 41 commits into from
Jul 9, 2020
Merged

Feature 1020 set_attrs #1406

merged 41 commits into from
Jul 9, 2020

Conversation

JohnHalleyGotway
Copy link
Collaborator

After merging the latest version of develop in feature_1020_set_attrs, I ran a regression test in kiowa:/d1/projects/MET/MET_pull_requests/met-9.1_beta2/feature_1020/regression

The only differences should new set_attr output files generated by Grid-Stat.

Please read the last comment on #1020 which explains the change I had to make, replacing set_attr_... bareword entries instead of grouping them together into a set_attrs dictionary.

…f the set_attrs dictionary config entries. Still need to add code to parse those entries and update the tests and documentation.
…units to the OBS_UNITS output column instead of writing a constant NA string.
…name_attr() for example returns SetAttrsName, if set, and simply Name otherwise.
…st_var, set_obs_var, set_fcst_level, set_obs_level, set_fcst_units, and set_obs_units with calls to the corresponding attrs access function. Still many more updates to the code required.
…in a DataPlane object using the contents of a set_attr Dictionary stored in a VarInfo object.
… always having to type out grid.nx()*grid.ny().
… object. And parse that grid in the set_dict() function. The huge drawback here is that the grid may be specified as a named grid or using a grid specification string... but it cannot be defined as the path to a gridded data file. The library dependency logic is just too complex, and I'd need to move a lot of code around to make this work. For now, just leave that feature out.
…d spec parsed from the file. Also, update the process_data_plane() function to handle updating the metadata and grid defintions.
…le, parse them as set_attrs.set_name instead of set_name from the set_attrs dictionary. That makes setting up the config file more flexible.
…evel_attr, and units_attr instead of name(), level_name(), and units(). This change should be made everywhere NetCDF output files are written.
…nd units() with calls to name_attr(), level_attr(), and units_attr().
…nits() with calls to name_attr(), level_attr(), and units_attr().
… units() with calls to name_attr(), level_attr(), and units_attr().
…eplace calls to name(), level_name(), and units() with calls to name_attr(), level_attr(), and units_attr().
…el_name(), and units() with calls to name_attr(), level_attr(), and units_attr().
…d units() with calls to name_attr(), level_attr(), and units_attr().
@JohnHalleyGotway JohnHalleyGotway added this to the MET 9.1 milestone Jul 4, 2020
Copy link
Collaborator

@georgemccabe georgemccabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had issues building from this branch on my laptop, so I added a single docker image for this specific feature branch. I was able to run a METplus use case (GridStat.conf) in docker. I changed the GridStatConfig file to write a raw NC file. I added a couple set_attrs values to the forecast data (based on the unit test example) and reran. The level value updated to "TROPO" as expected, but the long name appears to be different than the explicit value I provided.

My configuration:
FCST_FIELD={ name="APCP"; level="A03"; cat_thresh=[ gt12.7,gt25.4,gt50.8,gt76.2 ]; set_attr_level = "TROPO"; set_attr_long_name = "Temperature at the tropopause"; }

netcdf grid_stat_WRF_APCP_vs_MC_PCP_APCP_03_120000L_20050807_120000V_pairs {
dimensions:
lat = 129 ;
lon = 185 ;
variables:
float FCST_APCP_03_TROPO_FULL(lat, lon) ;
FCST_APCP_03_TROPO_FULL:name = "FCST_APCP_03_TROPO_FULL" ;
FCST_APCP_03_TROPO_FULL:long_name = "APCP_03 at TROPO" ;
FCST_APCP_03_TROPO_FULL:level = "TROPO" ;

The value was overwritten by at instead of my value.

So good news, you are able to add set_attrs items to a METplus config via:

FCST_VAR1_OPTIONS = set_attr_level = "TROPO"; set_attr_long_name = "Temperature at the tropopause";

but bad news, not all of the options may be working as expected.

@JohnHalleyGotway
Copy link
Collaborator Author

Hey George, I’m not surprised by the long name behavior you describe. I think I realized that I wasn’t actually checking for that when setting up the long name in Grid-Star matched pairs file. Here’s the issue... each variable can result in multiple output fields in that file. The code constructs the long name to differentiate between them... and it wasn’t immediately obvious to me how to use the user-defined long name in that context... but I could try.

@JohnHalleyGotway
Copy link
Collaborator Author

OK George, I update Grid-Stat to include the user-specified long_name string in the NetCDF matched pairs output file from Grid-Stat.

@georgemccabe
Copy link
Collaborator

OK, the changes look good to me as far as I can tell. I will let you merge the changes so you can control the differences that will come up from the tests.

@JohnHalleyGotway
Copy link
Collaborator Author

JohnHalleyGotway commented Jul 8, 2020 via email

@JohnHalleyGotway JohnHalleyGotway merged commit b823c43 into develop Jul 9, 2020
@JohnHalleyGotway JohnHalleyGotway deleted the feature_1020_set_attrs branch July 9, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants