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 #2142 airnow_take2 #2373

Merged
merged 11 commits into from
Dec 9, 2022
Merged

Conversation

JohnHalleyGotway
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway commented Dec 7, 2022

  • Still waiting for confirmation from @Ho-ChunHuang-NOAA that his testing on Hera using the feature_2142_airnow_take2 branch works as expected.
  • This PR includes the following changes:
    • Updates documentation of the MET_AIRNOW_STATIONS environment variable.
    • Updates file_handler.h/.cc to provide StringArray obs_units and write its contents to the NetCDF output file.
    • Updates airnow_handler.h/.cc:
      • Improve error warning messages with more info about MET_AIRNOW_STATIONS
      • Fix bug in defining the varIndex for each observation.
      • Store the units string that was already being parsed.
      • Parse and write the "averaging period" as an integer number of seconds to the obs_lvl slot.
      • Write the obs_hgt as bad data since we don't know the height above ground level at which these obs are collected.

Expected Differences

  • Do these changes introduce new tools, command line arguments, or configuration file options? [No]

    If yes, please describe:

  • Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]

    If yes, please describe:

Pull Request Testing

  • Describe testing already performed for these changes:

  • Ran ascii2nc commands for AirNow inputs from unit_ascii2nc.xml many times.

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

  • Please review logic of code changes.

  • GHA will produce diffs in the output due to bugfix, but make sure that none are unexpected.

  • Review the doc updates at:

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

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

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

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

  • Updates the contents of the AirNow output files written by ascii2nc after varIndex bugfix.

  • Please complete this pull request review by [ASAP 12/9/22].

Pull Request Checklist

See the METplus Workflow for details.

  • 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 Development with the original issue number.
  • 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.

…variable names and report the correct index value. For daily v2 files, extract the time averaging number of hours and report it as the number of seconds in the observation level column to be consistent with the pb2nc handling of airnow observations.
…s 1-hour (3600 seconds). And report the height as bad data rather than using the elevation. That's more consistent with how we handle precip obs, and there's nothing in the input file to indicate the height above ground level at which these observations are collected.
@JohnHalleyGotway JohnHalleyGotway added this to the MET 11.0.0 milestone Dec 7, 2022
@JohnHalleyGotway JohnHalleyGotway linked an issue Dec 7, 2022 that may be closed by this pull request
16 tasks
@JohnHalleyGotway JohnHalleyGotway marked this pull request as ready for review December 9, 2022 18:48
@JohnHalleyGotway
Copy link
Collaborator Author

@davidalbo, FYI, here's more details about the testing I did for these changes. For each call to AirNow in unit_ascii2nc.xml, I ran that command with the updated version, used a python utility script to dump the output NetCDF file back to ascii, and then manually compared the input/output ascii files. I did this on my laptop, not seneca.

If you'd like like to the same on seneca, please LMK, and I can compile the feature branch there for your testing.

MET_BIN=/Volumes/d1/projects/MET/MET_development/MET-feature_2142_airnow_take2/bin
MET_TEST_INPUT=/Volumes/d1/projects/MET/MET_unit_test/MET_test_input
MET_TEST_OUTPUT=/Volumes/d1/projects/MET/MET_unit_test/MET_test_output

$MET_BIN/ascii2nc \
$MET_TEST_INPUT/obs_data/airnow/daily_data_v2.dat \
$MET_TEST_OUTPUT/ascii2nc/airnow/daily_data_v2_20220312.nc

python $MET_BIN/../scripts/utility/print_pointnc2ascii.py \
$MET_TEST_OUTPUT/ascii2nc/airnow/daily_data_v2_20220312.nc > daily_data_v2_20220312.txt

# Compare input daily_data_v2.dat to output daily_data_v2_20220312.txt

$MET_BIN/ascii2nc \
$MET_TEST_INPUT/obs_data/airnow/HourlyAQObs_2022031200.dat \
$MET_TEST_OUTPUT/airnow/HourlyAQObs_20220312.nc

python $MET_BIN/../scripts/utility/print_pointnc2ascii.py \
$MET_TEST_OUTPUT/ascii2nc/airnow/HourlyAQObs_20220312.nc > HourlyAQObs_20220312.txt

# Compare input HourlyAQObs_2022031200.dat to output HourlyAQObs_20220312.txt

$MET_BIN/ascii2nc \
$MET_TEST_INPUT/obs_data/airnow/HourlyData_2022031200.dat \
$MET_TEST_OUTPUT/ascii2nc/airnow/HourlyData_20220312.nc

python $MET_BIN/../scripts/utility/print_pointnc2ascii.py \
$MET_TEST_OUTPUT/ascii2nc/airnow/HourlyData_20220312.nc > HourlyData_20220312.txt

# Compare input HourlyData_2022031200.dat to output HourlyData_20220312.txt

@davidalbo
Copy link
Contributor

@davidalbo, FYI, here's more details about the testing I did for these changes. For each call to AirNow in unit_ascii2nc.xml, I ran that command with the updated version, used a python utility script to dump the output NetCDF file back to ascii, and then manually compared the input/output ascii files. I did this on my laptop, not seneca.

If you'd like like to the same on seneca, please LMK, and I can compile the feature branch there for your testing.

MET_BIN=/Volumes/d1/projects/MET/MET_development/MET-feature_2142_airnow_take2/bin
MET_TEST_INPUT=/Volumes/d1/projects/MET/MET_unit_test/MET_test_input
MET_TEST_OUTPUT=/Volumes/d1/projects/MET/MET_unit_test/MET_test_output

$MET_BIN/ascii2nc \
$MET_TEST_INPUT/obs_data/airnow/daily_data_v2.dat \
$MET_TEST_OUTPUT/ascii2nc/airnow/daily_data_v2_20220312.nc

python $MET_BIN/../scripts/utility/print_pointnc2ascii.py \
$MET_TEST_OUTPUT/ascii2nc/airnow/daily_data_v2_20220312.nc > daily_data_v2_20220312.txt

# Compare input daily_data_v2.dat to output daily_data_v2_20220312.txt

$MET_BIN/ascii2nc \
$MET_TEST_INPUT/obs_data/airnow/HourlyAQObs_2022031200.dat \
$MET_TEST_OUTPUT/airnow/HourlyAQObs_20220312.nc

python $MET_BIN/../scripts/utility/print_pointnc2ascii.py \
$MET_TEST_OUTPUT/ascii2nc/airnow/HourlyAQObs_20220312.nc > HourlyAQObs_20220312.txt

# Compare input HourlyAQObs_2022031200.dat to output HourlyAQObs_20220312.txt

$MET_BIN/ascii2nc \
$MET_TEST_INPUT/obs_data/airnow/HourlyData_2022031200.dat \
$MET_TEST_OUTPUT/ascii2nc/airnow/HourlyData_20220312.nc

python $MET_BIN/../scripts/utility/print_pointnc2ascii.py \
$MET_TEST_OUTPUT/ascii2nc/airnow/HourlyData_20220312.nc > HourlyData_20220312.txt

# Compare input HourlyData_2022031200.dat to output HourlyData_20220312.txt

Sure, I'll try running your tests from seneca, so please do build there.

Copy link
Contributor

@davidalbo davidalbo left a comment

Choose a reason for hiding this comment

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

I approve this pull request.

I reviewed the documentation and it did add meaningful and useful content.
I reviewed the code changes and they all made sense and were clear improvements, some cosmetic, and others adding functionality such as correctly handling units.
The testing done showed that the changes made did give the expected changes in results.

@JohnHalleyGotway
Copy link
Collaborator Author

Thanks @davidalbo for the review. Ho-Chun has no objection to us proceeding with these changes. So I'll merge this PR and proceed with the release.

@JohnHalleyGotway JohnHalleyGotway merged commit 8a910a6 into develop Dec 9, 2022
@JohnHalleyGotway JohnHalleyGotway deleted the feature_2142_airnow_take2 branch December 9, 2022 22:37
@Ho-ChunHuang-NOAA
Copy link

Ho-ChunHuang-NOAA commented Dec 11, 2022 via email

JohnHalleyGotway added a commit that referenced this pull request Dec 12, 2022
Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Dave Albo <dave@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Seth Linden <linden@seneca.rap.ucar.edu>
Co-authored-by: johnhg <johnhg@ucar.edu>
Co-authored-by: Lisa Goodrich <lisag@seneca.rap.ucar.edu>
Co-authored-by: jprestop <jpresto@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: Julie Prestopnik <jpresto@seneca.rap.ucar.edu>
Co-authored-by: Jonathan Vigh <jvigh@ucar.edu>
Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: bikegeek <3753118+bikegeek@users.noreply.github.com>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: Seth Linden <linden@ucar.edu>
Co-authored-by: lisagoodrich <33230218+lisagoodrich@users.noreply.github.com>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add support for EPA AirNow ASCII data in ASCII2NC
3 participants