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

point2grid: support the 2D time variable #1580

Closed
3 of 21 tasks
hsoh-u opened this issue Nov 20, 2020 · 4 comments · Fixed by #1616 or #1619
Closed
3 of 21 tasks

point2grid: support the 2D time variable #1580

hsoh-u opened this issue Nov 20, 2020 · 4 comments · Fixed by #1616 or #1619
Assignees
Labels
priority: medium Medium Priority reporting: DTC NOAA R2O NOAA Research to Operations DTC Project type: new feature Make it do something new
Milestone

Comments

@hsoh-u
Copy link
Collaborator

hsoh-u commented Nov 20, 2020

Requested from RT ticket (Binyu, https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=97459)

Describe the New Feature

The sample file of RT-Ticket 97459 has (x,y) dimensions for coordinate variables (lat/lon/time) and MET's NCCF library does not support 2 dimensional time variable. The 2D time variable does not make sense for the gridded data. But it could be used for the point observation data (sparse point data). It would be nice to support 2D time variable for the point2grid.

Background assessment from helpdesk ticket:

From John:
Binyu,

I'm adding my response here and will then reassign this ticket to Howard Soh to see if he has any more ideas.

I downloaded your file to our anonymous ftp site:

ftp://ftp.rap.ucar.edu/incoming/irap/met_help/wang_data_20201116/VOLCAT_HIMAWARI-8_FLDK_s2020296_173000_v300250_VCB_w167_FLDK_b2020295_204000_g001.nc

I'm able to replicate the same error you're getting:

terminate called after throwing an instance of 'netCDF::exceptions::NcInvalidCoords'

After some testing I see that this is caused by the time variable having 2 dimensions: int time(y, x) ;

When reading 2-D gridded data, the code expects the time variable to be 1 dimensional. A file may contain multiple timesteps and a coordinate variable defines what those timesteps are. To sidestep this issue, I just removed the "time(y, x)" variable entirely. But then MET isn't able to read the projection info:

ERROR : NcCfFile::read_netcdf_grid() -> Couldn't figure out projection from information in netCDF file.

Looking closely at the latitude and longitude variables, I see that this really is not gridded data at all. Instead, it's a dense set of pixels, but it doesn't appear that the lat/lon's are evenly spaced or follow any sort of projection (e.g. Lambert Conformal, Mercator, PolarStereographic, and so on).

Since this is a dense collection of individual points, you'll still need to run the Point2Grid tool to place them onto a real grid. And that's the question to Howard. Is there anyway that Binyu could format this NetCDF file that would enable it to be read easily by the Point2Grid tool?

From Howard:
The point2grid handles a CF complaint NetCDF which has

  1. 2D variables with lat/lon dimensions and the time variable with 1 value OR
  2. 3D variables with time/lat/lon dimensions and the time variable with 1 dimension.

The point2grid should be enhanced to support the 2-dimensional time variable (if the enhancement is approved).

The sample NetCDF has two time offsets: 1603387817 and 1603387833 ("seconds since 1970-01-01 00:00:00"). One possible way without changing MET applications is generating two files (one file with time offset 1603387817 and the other file with time offset 1603387817).

netcdf1:
int time(1);
time = 1603387817
fill the missing value for the time 1603387833

netcdf2:
int time(1);
time = 1603387833
fill the missing value for the time 1603387817

Acceptance Testing

point2grid should process the file at /d3/personal/hsoh/data/RT-97459//VOLCAT_HIMAWARI-8_FLDK_s2020296_173000_v300250_VCB_w167_FLDK_b2020295_204000_g001.nc

Time Estimate

1 or 2 days

Sub-Issues

Consider breaking the new feature down into sub-issues.

  • Add a checkbox for each sub-issue here.

Relevant Deadlines

NONE.

Funding Source

2791541

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required (Howard)
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Review projects and select relevant Repository and Organization ones or add "alert:NEED PROJECT ASSIGNMENT" label
  • Select milestone to next major version milestone or "Future Versions"

Define Related Issue(s)

Consider the impact to the other METplus components.

New Feature Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding source.
  • Fork this repository or create a branch of develop.
    Branch name: feature_<Issue Number>_<Description>
  • Complete the development and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into develop.
    Pull request: feature <Issue Number> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s), Project(s), Milestone, and Linked issues
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@hsoh-u hsoh-u added component: application code type: new feature Make it do something new priority: medium Medium Priority alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle labels Nov 20, 2020
@hsoh-u hsoh-u self-assigned this Nov 20, 2020
@TaraJensen TaraJensen added this to the MET 10.0 milestone Dec 1, 2020
@TaraJensen TaraJensen added this to To do in MET-10.0.0-beta3 (1/27/21) via automation Dec 1, 2020
@JohnHalleyGotway JohnHalleyGotway removed the alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle label Dec 8, 2020
@hsoh-u hsoh-u moved this from To do to In progress in MET-10.0.0-beta3 (1/27/21) Dec 11, 2020
@TaraJensen TaraJensen added reporting: DTC NOAA R2O NOAA Research to Operations DTC Project and removed alert: NEED ACCOUNT KEY Need to assign an account key to this issue labels Dec 15, 2020
@hsoh-u
Copy link
Collaborator Author

hsoh-u commented Dec 15, 2020

The sample file does not have the standard_name attribute. MET fails to find the projection information (lat/lon).
It is a CF complaint NetCDF file (the "standard_name" attribute is optional if the "long_name" attribute exists). The long_name attribute is not standardized. MET does not identify the coordinate variables from the long_name. The "standard_name" attribute is required for MET.

hsoh-u added a commit that referenced this issue Jan 5, 2021
hsoh-u added a commit that referenced this issue Jan 5, 2021
hsoh-u added a commit that referenced this issue Jan 7, 2021
hsoh-u added a commit that referenced this issue Jan 7, 2021
hsoh-u added a commit that referenced this issue Jan 7, 2021
hsoh-u added a commit that referenced this issue Jan 8, 2021
@hsoh-u hsoh-u linked a pull request Jan 8, 2021 that will close this issue
8 tasks
@hsoh-u hsoh-u moved this from In progress to Pull request review in MET-10.0.0-beta3 (1/27/21) Jan 8, 2021
JohnHalleyGotway pushed a commit that referenced this issue Jan 13, 2021
* #1580 Added get_grid_from_lat_lon_vars

* #1580 Added get_grid_from_lat_lon_vars and support 2D time variable

* #1580 Support int type variable without scale_factor and add_offset attributes

* #1580 Support 2D time variable. Implemented filtering by valid_time

* #1580 Bug fix: read time with dimension 0

* #1580 Support time variable with no dimension

* #1580 Initial release

* #1580 Added point2grid_2D_time

* #1580 Check project attribute for GOES

* #1580 Changed NULL to 0 to avoid co,pilation warning

* #1580 Added point2grid_2D_time

* #1580 Added "point2grid configuration file" section

* #1580 Changed to_grid for point2grid_NCCF_UK & point2grid_2D_time

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
MET-10.0.0-beta3 (1/27/21) automation moved this from Pull request review to Done Jan 13, 2021
MET-10.0.0-beta3 (1/27/21) automation moved this from Done to In progress Jan 13, 2021
@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Jan 13, 2021

While the changes merged for PR #1616 did not cause any of the MET unit tests to fail, they did cause 2 failures for METplus which were found by GitHub actions:
https://github.com/dtcenter/METplus/runs/1697787026?check_suite_focus=true

On kiowa, here's a plot_data_plane command that works fine for met-9.1:

/usr/local/met-9.1/bin/plot_data_plane \
/d1/projects/METplus/METplus_Data/model_applications/space_weather/glotec_vs_glotec/GLO_20190422_without_cosmic/GloTEC_TEC_2015_03_17.nc \
plot.ps \
'name="TEC"; level="(20150317_000500,*,*)"; file_type=NETCDF_NCCF;'

But the same command fails with these changes:

/d1/projects/MET/MET_pull_requests/met-10.0.0_beta3/feature_1580/MET-feature_1580_2d_time_into_develop/met/bin/plot_data_plane \
/d1/projects/METplus/METplus_Data/model_applications/space_weather/glotec_vs_glotec/GLO_20190422_without_cosmic/GloTEC_TEC_2015_03_17.nc \
plot.ps \
'name="TEC"; level="(20150317_000500,*,*)"; file_type=NETCDF_NCCF;'

And here's the output:

WARNING: 
WARNING: MetNcCFDataFile::data_plane(VarInfo &, DataPlane &) -> the requested time 20150317_000500 for "TEC" variable does not exist (20150317_000416 and 20150317_235544).
WARNING: 
ERROR  : 
ERROR  : plot_data_plane -> trouble getting field "name="TEC"; level="(20150317_000500,*,*)"; file_type=NETCDF_NCCF;" from file "/d1/projects/METplus/METplus_Data/model_applications/space_weather/glotec_vs_glotec/GLO_20190422_without_cosmic/GloTEC_TEC_2015_03_17.nc"
ERROR  : 

NOTE!!! that the reported range of timestamps (20150317_000416 and 20150317_235544) does not match the ACTUAL range of timestamps within the file:
1426550700 to 1426636500 which is 20150317_000500 to 20150317_235500.

@JohnHalleyGotway
Copy link
Collaborator

Howard, please fix this and also add this example as a new MET unit test. Perhaps just add it to unit_plot_data_plane.xml.

Once it is fixed, please do a new pull request.

@hsoh-u
Copy link
Collaborator Author

hsoh-u commented Jan 13, 2021

lat/long variables will be decided by

  • By checking standard_name attribute
  • By checking units attribute

GLO_20190422_without_cosmic/GloTEC_TEC_2015_03_17.nc does have the standard_name attribute.
If there are two or more variables with "degrees_north" or "degrees_east", it will log proper message and quit.

The sample data file (VOLCAT_HIMAWARI-8_FLDK_s2020296_173000_v300250_VCB_w167_FLDK_b2020295_204000_g001.nc) has multiple variables with "degree_north:

   geospatial_lat_lon_extent:geospatial_lat_units = "degrees_north" ;
   feature_lat_lon_extent:geospatial_lat_units = "degrees_north" ;
   pc_feature_lat_lon_extent:geospatial_lat_units = "degrees_north" ;
   volcano_info:latitude_units = "degrees_north" ;
   feature_latitude:units = "degrees_north" ;
   pc_feature_latitude:units = "degrees_north" ;
   feature_polygon_latitude:units = "degrees_north" ;
   pc_feature_polygon_latitude:units = "degrees_north" ;
   latitude:units = "degrees_north" ;
   pc_latitude:units = "degrees_north" ;

@JohnHalleyGotway JohnHalleyGotway linked a pull request Jan 14, 2021 that will close this issue
8 tasks
JohnHalleyGotway pushed a commit that referenced this issue Jan 14, 2021
* #1580 Correct the precision at _apply_scale_factor

* #1580 Added unit test plot_data_plane_NCCF_time

* #1580 Changed argument type to double at _apply_scale_factor(double)
jprestop pushed a commit that referenced this issue Jan 14, 2021
* Getting rid of compiler warnings in PB2NC by replacing several instances of the NULL pointer with the nul character (\0) instead.

* Fix typo in config_options.rst.

* Feature 1408 var_name_for_grib_code (#1617)

* #1408 Added get_var_id

* #1408 Check variable name in the configuration to use the variable name instewad of grib code

* #1408 Added point2grid_ascii2nc_surfrad_DW_PSP_by_name

* Feature 1580 2d time (#1616)

* #1580 Added get_grid_from_lat_lon_vars

* #1580 Added get_grid_from_lat_lon_vars and support 2D time variable

* #1580 Support int type variable without scale_factor and add_offset attributes

* #1580 Support 2D time variable. Implemented filtering by valid_time

* #1580 Bug fix: read time with dimension 0

* #1580 Support time variable with no dimension

* #1580 Initial release

* #1580 Added point2grid_2D_time

* #1580 Check project attribute for GOES

* #1580 Changed NULL to 0 to avoid co,pilation warning

* #1580 Added point2grid_2D_time

* #1580 Added "point2grid configuration file" section

* #1580 Changed to_grid for point2grid_NCCF_UK & point2grid_2D_time

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>

* feature 1580 nccf (#1619)

* #1580 Correct the precision at _apply_scale_factor

* #1580 Added unit test plot_data_plane_NCCF_time

* #1580 Changed argument type to double at _apply_scale_factor(double)

Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
@hsoh-u hsoh-u closed this as completed Jan 19, 2021
MET-10.0.0-beta3 (1/27/21) automation moved this from In progress to Done Jan 19, 2021
JohnHalleyGotway added a commit that referenced this issue Jan 22, 2021
* Getting rid of compiler warnings in PB2NC by replacing several instances of the NULL pointer with the nul character (\0) instead.

* Fix typo in config_options.rst.

* Feature 1408 var_name_for_grib_code (#1617)

* #1408 Added get_var_id

* #1408 Check variable name in the configuration to use the variable name instewad of grib code

* #1408 Added point2grid_ascii2nc_surfrad_DW_PSP_by_name

* Feature 1580 2d time (#1616)

* #1580 Added get_grid_from_lat_lon_vars

* #1580 Added get_grid_from_lat_lon_vars and support 2D time variable

* #1580 Support int type variable without scale_factor and add_offset attributes

* #1580 Support 2D time variable. Implemented filtering by valid_time

* #1580 Bug fix: read time with dimension 0

* #1580 Support time variable with no dimension

* #1580 Initial release

* #1580 Added point2grid_2D_time

* #1580 Check project attribute for GOES

* #1580 Changed NULL to 0 to avoid co,pilation warning

* #1580 Added point2grid_2D_time

* #1580 Added "point2grid configuration file" section

* #1580 Changed to_grid for point2grid_NCCF_UK & point2grid_2D_time

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>

* feature 1580 nccf (#1619)

* #1580 Correct the precision at _apply_scale_factor

* #1580 Added unit test plot_data_plane_NCCF_time

* #1580 Changed argument type to double at _apply_scale_factor(double)

* Bugfix 1618 develop pb2nc (#1623)

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>

* Feature 1624 OBS_COMMAND (#1625)

* Per #1627, add grid_data.regrid config option for PlotPointObs and update the tool to do the requested regridding. Still need to update the docs.

* Per #1627, update docs about grid_data.regrid config option for PlotPointObs.

* Per #1627, add another call to plot_point_obs to exercise the new regrid functionality.

* Feature 1624 obs_command second try (#1629)

* Per #1624, define OBS_COMMAND.

* Per #1624, unset the test-specific environment variables after completing the run.

* Per #1624, after PR #1625 merged these changes into develop, they caused 2 unexpected diffs in the NB output. These were caused by enviornment variables being unset after each test. Updating unit_netcdf.xml and unit_point2grid.xml to define more test-specific environment variables to reproduce previous NB output.

* Organizing NB climatology and point2grid output files into the appopriate directories rather than having them at the top-level directory.

* Update pull_request_template.md

* Update the point2grid unit tests to write their temp files to the point2grid subdirectory instead of the top-level test output directory.

* Update appendixC.rst

Split the definition of H_RATE and POD

Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue Jan 24, 2021
* Getting rid of compiler warnings in PB2NC by replacing several instances of the NULL pointer with the nul character (\0) instead.

* Fix typo in config_options.rst.

* Feature 1408 var_name_for_grib_code (#1617)

* #1408 Added get_var_id

* #1408 Check variable name in the configuration to use the variable name instewad of grib code

* #1408 Added point2grid_ascii2nc_surfrad_DW_PSP_by_name

* Feature 1580 2d time (#1616)

* #1580 Added get_grid_from_lat_lon_vars

* #1580 Added get_grid_from_lat_lon_vars and support 2D time variable

* #1580 Support int type variable without scale_factor and add_offset attributes

* #1580 Support 2D time variable. Implemented filtering by valid_time

* #1580 Bug fix: read time with dimension 0

* #1580 Support time variable with no dimension

* #1580 Initial release

* #1580 Added point2grid_2D_time

* #1580 Check project attribute for GOES

* #1580 Changed NULL to 0 to avoid co,pilation warning

* #1580 Added point2grid_2D_time

* #1580 Added "point2grid configuration file" section

* #1580 Changed to_grid for point2grid_NCCF_UK & point2grid_2D_time

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>

* feature 1580 nccf (#1619)

* #1580 Correct the precision at _apply_scale_factor

* #1580 Added unit test plot_data_plane_NCCF_time

* #1580 Changed argument type to double at _apply_scale_factor(double)

* Bugfix 1618 develop pb2nc (#1623)

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>

* Feature 1624 OBS_COMMAND (#1625)

* Per #1627, add grid_data.regrid config option for PlotPointObs and update the tool to do the requested regridding. Still need to update the docs.

* Per #1627, update docs about grid_data.regrid config option for PlotPointObs.

* Per #1627, add another call to plot_point_obs to exercise the new regrid functionality.

* Feature 1624 obs_command second try (#1629)

* Per #1624, define OBS_COMMAND.

* Per #1624, unset the test-specific environment variables after completing the run.

* Per #1624, after PR #1625 merged these changes into develop, they caused 2 unexpected diffs in the NB output. These were caused by enviornment variables being unset after each test. Updating unit_netcdf.xml and unit_point2grid.xml to define more test-specific environment variables to reproduce previous NB output.

* Organizing NB climatology and point2grid output files into the appopriate directories rather than having them at the top-level directory.

* Update pull_request_template.md

* Update the point2grid unit tests to write their temp files to the point2grid subdirectory instead of the top-level test output directory.

* Update appendixC.rst

Split the definition of H_RATE and POD

* Feature 1626 tc_gen (#1633)

* Per #1448, many changes for TC-Gen. Replace the oper_genesis dictionary with the oper_technique string. Add genesis_init_diff config entry. Update config_constants.h accordingly and the tc_gen_conf_info.h/.cc to parse the updated config entries.

* Per #1448, large overhaul of the tc_gen matching logic. This work is not yet complete. Still need to compute categorical MISSES but the current version does compile.

* Per #1448, add GenesisInfoArray::has_storm_id() function and remove the unused set_dland() function.

* Per #1448, more updates. Define the best genesis events while parsing the best tracks. We need to know the best genesis events in order to count up the forecast misses.

* Per #1448, lots more changes for tc_gen. Create a PairDataGenesis class to store genesis pairs. This will be needed to write a matched pair line type.

* Per #1448, minor tweaks to log messages.

* Per #1448, update PairDataGenesis class to store the BEST track Storm ID since the forecast genesis do not have meaningful Storm ID's.

* Per #1448, in GenesisInfoArray::add(), do NOT store multiple genesis events for the same storm, but do print a useful Debug(3) log message about it.

* Per #1448, update PairDataGenesis::has_case() logic to check the storm id and initialization time but NOT require an exact forecast hour match.

* Per #1448, update the tc_gen log messages to more concisely and consistently report the storm id.

* Per #1448, update the PairDataGenesis logic a bit to have all the misses and hits in chronological order.

* Per #1448, add genesis_init_diff entry.

* Per #1448, set the default genesis_init_diff entry to 48 hours since that's what Dan H used in his examples.

* Per #1448, work on comments and log messages.

* Per #1448, reimplement TrackInfoArray as a vector instead of managing the memory myself. This makes the implmentation of TrackInfoArray::erase_storm_id() very easy. Replace n_tracks() function with n() in several places.

* Per #1448, add valid_freq and basin_file config entries. Also rename load_dland.h/.cc to load_tc_data.h/.cc and add code to read the basin file.

* Per #1448, add GenesisInfoArray::erase_storm_id().

* Per #1448, update tc_gen code to handle new config options.

* Per #1448, had my units wrong. Was processing seconds when I thought it was hours!

* Per #1448, making test TC-Gen config file consistent with the default.

* Per #1448, also track the obs valid times.

* Per #1448, switch from tech1/tech2 to dev/ops methods. Update log messages and add lots of details to the tc_gen documentation.

* Per #1430, in tc_gen enable dev_method_flag, ops_method_flag, ci_alpha, and output_flag to be specified separately for each filter. Also add nc_pairs_flag and genesis_track_points_window config options. Add config constants entries for these options and update tc_gen to handle all of these changes.

* Per #1430, consolidate the parse_grid_mask() code a bit to avoid redundancy.:

* Per #1430, just cleaning up some messy comments.

* Per #1430, adding hooks for writing NetCDF output file.

* Per #1430, update DataPlane::set_size() function to take a 3rd argument to specify how the DataPlane should be initialized.

* Per #1430, update the nc_pairs_flag options and update the code to parse them.

* Per #1430, update the TrackInfo class to track and report the min/max warm core information.

* Per #1430, current state of development. Still a work in progress. I'm getting runtime segfaults when testing and I still need to NOT overcount the BEST track hits.

* Per #1430, committing changes described by #1430 (comment)

* Per #1430, forgot to rename genesis_match_window to genesis_hit_window as it is in the code.

* Per #1430, chaning GenesisInfo to just inherit directly from TrackInfo. Frankly, I should have thought of this a LONG time ago.

* Per #1430, change the default desc setting from NA to ALL and add the best_unique_flag option.

* Per #1430, simplify the logic now that GenesisInfo is derived from TrackInfo. Also support the best_unique_flag config option.

* Per #1430, instead of storing 12 individual DataPlane objects, store them in a map to make writing their output more convenient.

* Per #1430, updating documentation and comments.

* Per #1430, more doc updates.

* Per #1430, update unit test to only write NetCDF counts for the AL_BASIN and not the other filters.

* Per #1430, fix parsing logic for nc_pairs_flag = TRUE.

* Per #1430, fix bug. Check the VxOpt.NcInfo before calling write_nc(), not the top-level one.

* Per #1430, the docker build of tc_gen failed.

* Per #1430, working on DockerHub compilation.

* Per #1430, getting DockerHub build working.

* One more try.

* Per #1597, add hooks for new GENMPR stat line type.

* Per #1597, add config file option and column definitions for the GENMPR line type.

* Per #1597, finish writing the GENMPR line type.

* Per #1597, change the default output grid from a global 5 degree to global 1 degree grid.

* Per #1597, change GENMPR output columns to GEN_TDIFF and INIT_TDIFF since they're reported in HHMMSS format instead of seconds. Also, tweak the config file for the tc-gen unit test.

* Per #1597, have to add GENMPR header columns for Stat-Analysis and test scripts to handle it.

* Per #1597, update Stat-Analysis to handle the GENMPR line type.

* Per #1597, user's guide updates for the GENMPR and NetCDF output file.

* Per #1597, add AGEN_INIT and AGEN_FHR columns.

* Per #1597, add AGEN_INIT and AGEN_FHR columns.

* Per #1597, remove the AGEN_TIME and BGEN_TIME columns from the GENMPR line type and instead write the genesis times to the FCST_VALID_BEG/END and OBS_VALID_BEG/END header columns.

* Remove some unused output column name definitions. There are a remnant from very early versions of MET which included the CTP, CFP, and COP line types.

* Per #1597, update config file options to use dev_hit_radius, dev_hit_window, and opt_hit_tdiff. Also update log message to switch from 'lead' to 'forecast hour'.

* Per #1626, add met_regrid_nearest() utility function since I'm calling it twice.

* Per #1626, update the basin_global_tenth_degree.nc basin definition file to include basin name abbreviations.

* Per #1626, update load_tc_data.h/.cc to also read the basin abbreviations from the NetCDF basin file.

* Per #1626, add TC-Gen config file options for init_inc, init_exc, and basin_mask. Updated the library and application code, and updated the user's guide.

Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue Jan 26, 2021
* Getting rid of compiler warnings in PB2NC by replacing several instances of the NULL pointer with the nul character (\0) instead.

* Fix typo in config_options.rst.

* Feature 1408 var_name_for_grib_code (#1617)

* #1408 Added get_var_id

* #1408 Check variable name in the configuration to use the variable name instewad of grib code

* #1408 Added point2grid_ascii2nc_surfrad_DW_PSP_by_name

* Feature 1580 2d time (#1616)

* #1580 Added get_grid_from_lat_lon_vars

* #1580 Added get_grid_from_lat_lon_vars and support 2D time variable

* #1580 Support int type variable without scale_factor and add_offset attributes

* #1580 Support 2D time variable. Implemented filtering by valid_time

* #1580 Bug fix: read time with dimension 0

* #1580 Support time variable with no dimension

* #1580 Initial release

* #1580 Added point2grid_2D_time

* #1580 Check project attribute for GOES

* #1580 Changed NULL to 0 to avoid co,pilation warning

* #1580 Added point2grid_2D_time

* #1580 Added "point2grid configuration file" section

* #1580 Changed to_grid for point2grid_NCCF_UK & point2grid_2D_time

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>

* feature 1580 nccf (#1619)

* #1580 Correct the precision at _apply_scale_factor

* #1580 Added unit test plot_data_plane_NCCF_time

* #1580 Changed argument type to double at _apply_scale_factor(double)

* Bugfix 1618 develop pb2nc (#1623)

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>

* Feature 1624 OBS_COMMAND (#1625)

* Per #1627, add grid_data.regrid config option for PlotPointObs and update the tool to do the requested regridding. Still need to update the docs.

* Per #1627, update docs about grid_data.regrid config option for PlotPointObs.

* Per #1627, add another call to plot_point_obs to exercise the new regrid functionality.

* Feature 1624 obs_command second try (#1629)

* Per #1624, define OBS_COMMAND.

* Per #1624, unset the test-specific environment variables after completing the run.

* Per #1624, after PR #1625 merged these changes into develop, they caused 2 unexpected diffs in the NB output. These were caused by enviornment variables being unset after each test. Updating unit_netcdf.xml and unit_point2grid.xml to define more test-specific environment variables to reproduce previous NB output.

* Organizing NB climatology and point2grid output files into the appopriate directories rather than having them at the top-level directory.

* Update pull_request_template.md

* Update the point2grid unit tests to write their temp files to the point2grid subdirectory instead of the top-level test output directory.

* Update appendixC.rst

Split the definition of H_RATE and POD

* Feature 1626 tc_gen (#1633)

* Per #1448, many changes for TC-Gen. Replace the oper_genesis dictionary with the oper_technique string. Add genesis_init_diff config entry. Update config_constants.h accordingly and the tc_gen_conf_info.h/.cc to parse the updated config entries.

* Per #1448, large overhaul of the tc_gen matching logic. This work is not yet complete. Still need to compute categorical MISSES but the current version does compile.

* Per #1448, add GenesisInfoArray::has_storm_id() function and remove the unused set_dland() function.

* Per #1448, more updates. Define the best genesis events while parsing the best tracks. We need to know the best genesis events in order to count up the forecast misses.

* Per #1448, lots more changes for tc_gen. Create a PairDataGenesis class to store genesis pairs. This will be needed to write a matched pair line type.

* Per #1448, minor tweaks to log messages.

* Per #1448, update PairDataGenesis class to store the BEST track Storm ID since the forecast genesis do not have meaningful Storm ID's.

* Per #1448, in GenesisInfoArray::add(), do NOT store multiple genesis events for the same storm, but do print a useful Debug(3) log message about it.

* Per #1448, update PairDataGenesis::has_case() logic to check the storm id and initialization time but NOT require an exact forecast hour match.

* Per #1448, update the tc_gen log messages to more concisely and consistently report the storm id.

* Per #1448, update the PairDataGenesis logic a bit to have all the misses and hits in chronological order.

* Per #1448, add genesis_init_diff entry.

* Per #1448, set the default genesis_init_diff entry to 48 hours since that's what Dan H used in his examples.

* Per #1448, work on comments and log messages.

* Per #1448, reimplement TrackInfoArray as a vector instead of managing the memory myself. This makes the implmentation of TrackInfoArray::erase_storm_id() very easy. Replace n_tracks() function with n() in several places.

* Per #1448, add valid_freq and basin_file config entries. Also rename load_dland.h/.cc to load_tc_data.h/.cc and add code to read the basin file.

* Per #1448, add GenesisInfoArray::erase_storm_id().

* Per #1448, update tc_gen code to handle new config options.

* Per #1448, had my units wrong. Was processing seconds when I thought it was hours!

* Per #1448, making test TC-Gen config file consistent with the default.

* Per #1448, also track the obs valid times.

* Per #1448, switch from tech1/tech2 to dev/ops methods. Update log messages and add lots of details to the tc_gen documentation.

* Per #1430, in tc_gen enable dev_method_flag, ops_method_flag, ci_alpha, and output_flag to be specified separately for each filter. Also add nc_pairs_flag and genesis_track_points_window config options. Add config constants entries for these options and update tc_gen to handle all of these changes.

* Per #1430, consolidate the parse_grid_mask() code a bit to avoid redundancy.:

* Per #1430, just cleaning up some messy comments.

* Per #1430, adding hooks for writing NetCDF output file.

* Per #1430, update DataPlane::set_size() function to take a 3rd argument to specify how the DataPlane should be initialized.

* Per #1430, update the nc_pairs_flag options and update the code to parse them.

* Per #1430, update the TrackInfo class to track and report the min/max warm core information.

* Per #1430, current state of development. Still a work in progress. I'm getting runtime segfaults when testing and I still need to NOT overcount the BEST track hits.

* Per #1430, committing changes described by #1430 (comment)

* Per #1430, forgot to rename genesis_match_window to genesis_hit_window as it is in the code.

* Per #1430, chaning GenesisInfo to just inherit directly from TrackInfo. Frankly, I should have thought of this a LONG time ago.

* Per #1430, change the default desc setting from NA to ALL and add the best_unique_flag option.

* Per #1430, simplify the logic now that GenesisInfo is derived from TrackInfo. Also support the best_unique_flag config option.

* Per #1430, instead of storing 12 individual DataPlane objects, store them in a map to make writing their output more convenient.

* Per #1430, updating documentation and comments.

* Per #1430, more doc updates.

* Per #1430, update unit test to only write NetCDF counts for the AL_BASIN and not the other filters.

* Per #1430, fix parsing logic for nc_pairs_flag = TRUE.

* Per #1430, fix bug. Check the VxOpt.NcInfo before calling write_nc(), not the top-level one.

* Per #1430, the docker build of tc_gen failed.

* Per #1430, working on DockerHub compilation.

* Per #1430, getting DockerHub build working.

* One more try.

* Per #1597, add hooks for new GENMPR stat line type.

* Per #1597, add config file option and column definitions for the GENMPR line type.

* Per #1597, finish writing the GENMPR line type.

* Per #1597, change the default output grid from a global 5 degree to global 1 degree grid.

* Per #1597, change GENMPR output columns to GEN_TDIFF and INIT_TDIFF since they're reported in HHMMSS format instead of seconds. Also, tweak the config file for the tc-gen unit test.

* Per #1597, have to add GENMPR header columns for Stat-Analysis and test scripts to handle it.

* Per #1597, update Stat-Analysis to handle the GENMPR line type.

* Per #1597, user's guide updates for the GENMPR and NetCDF output file.

* Per #1597, add AGEN_INIT and AGEN_FHR columns.

* Per #1597, add AGEN_INIT and AGEN_FHR columns.

* Per #1597, remove the AGEN_TIME and BGEN_TIME columns from the GENMPR line type and instead write the genesis times to the FCST_VALID_BEG/END and OBS_VALID_BEG/END header columns.

* Remove some unused output column name definitions. There are a remnant from very early versions of MET which included the CTP, CFP, and COP line types.

* Per #1597, update config file options to use dev_hit_radius, dev_hit_window, and opt_hit_tdiff. Also update log message to switch from 'lead' to 'forecast hour'.

* Per #1626, add met_regrid_nearest() utility function since I'm calling it twice.

* Per #1626, update the basin_global_tenth_degree.nc basin definition file to include basin name abbreviations.

* Per #1626, update load_tc_data.h/.cc to also read the basin abbreviations from the NetCDF basin file.

* Per #1626, add TC-Gen config file options for init_inc, init_exc, and basin_mask. Updated the library and application code, and updated the user's guide.

* Fixing Fortify warnings for 'Poor Style: Variable Never Used' in 6 files.

* Fix Fortify warnings for 'Uninitialized variable' in tc_gen.cc and point2grid.cc.

* Fix Fortify warnings for 'Poor Style: Redundant Initialization' in plot_point_obs.cc and point2grid.cc.

* Feature 1346 valid time attr (#1634)

* #1346 get_att_value_unixtime supports yyyymmdd_hhmmss, too

* #1346 Check valid_time & init_time attributes, too

* #1346 Check valid_time & init_time attributes, too

Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>

* Feature 1473 python errors (#1615)

* Added sample script to read ascii data and create an xarray.

* Disabled use_xarray exit for testing.

* Get attrs from DataArray if using xarray.

* Removed some comments.

* Revised error messages for use with both numpy and xarray.

* Removing commented out code.

Co-authored-by: David Fillmore <fillmore@kiowa.rap.ucar.edu>
Co-authored-by: johnhg <johnhg@ucar.edu>

* Feature 1630 zero obs (#1637)

* Per #1630, update ascii2nc to change zero observations from an error (which returns bad status) to a warning message.

* Per #1630, update point2grid to read an empty input file and write fields of 0's or bad data to the output. Change previous error message to warning. Also, update LOTS of warning and error log messages to make them consistent.

* Per #1630, need to initialize the dataplanes before the loop (for when there are no obs) and within each loop iteration (for when there are multiple fields to process).

* Bugfix 1638 develop climo cdf (#1639)

* Per #1638, correct the order of arguments in the call to the normal_cdf() utility function.

* Per #1638, update the logic in derive_climo_prob(). For CDP thresholds, the constant climo probability should be based on the inequality type where less-than-types match the threshold percentile value while greater-than-types are 1.0 minus the threshold percentile.

* Per #1638, update normal_cdf() to initialize the output CDF field using the climo mean field instead of the observation data field. This makes the timestamps consistent for the climo mean, stdev, and cdf variables in the Grid-Stat NetCDF matched pairs output file.

* Update tc_gen.cc

Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
Co-authored-by: David Fillmore <davidfillmore@users.noreply.github.com>
Co-authored-by: David Fillmore <fillmore@kiowa.rap.ucar.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Medium Priority reporting: DTC NOAA R2O NOAA Research to Operations DTC Project type: new feature Make it do something new
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants