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

ENH: Support for Product 176 (DPR) - Instantaneous Precipitation Rate #919

Merged
merged 13 commits into from
May 20, 2020

Conversation

dcedgren
Copy link
Contributor

Added support for reading Nexrad Level III files of Product 176 in accordance with discussion in Issue #551.

I relied heavily on the Metpy implementation to read the Generic Radial Product format. But as I got into it I decided I was close enough to understanding the Pyart implementation that I could probably modify it with only short sections of additional code (as opposed to, say, reading in the file using Metpy and assigning bits and pieces of dictionaries and lists to line up with a pyart.core.radar object). It will be more maintainable this way.

In general I left the existing code and made product 176 work alongside it. Nothing of substance has changed for the code to read other products in.

The key piece I used from the Metpy implementation I used was the Level3XDRParser class. I went back and forth about whether or not to add Metpy as a dependency and import the class or to copy the 100-150 lines of code into Pyart. In the end I decided to copy them since per Dopplershift In Issue #551 a final data structure has yet to be decided for Metpy and it seems possible something could break here in the future. I think it seems reasonable if the maintainers want to go the other way instead. Also check that I did the license thing right.

Added support for reading Nexrad Product 176 (DPR - Digital Instantaneous Precipitation Rate) files. These files share many headers in common with the other products already supported by Pyart, but are in generic radial product format.
Fixed a mistake I made with multiplication of a list.
@dcedgren
Copy link
Contributor Author

Is this something we'll want to add a new test for?

@zssherman
Copy link
Collaborator

@dcedgren Thanks for submitting this! I agree, that maybe once the data structure is decided, the dependency can be added. @scollis Would do you think on the dependency part? @dcedgren a test would be preferred to test a Product 176 for this, but I don't think anything crazy as a lot of the nexrad level III is already tested. License looks good to me.

Added testing for Product 176.
@dcedgren
Copy link
Contributor Author

dcedgren commented Apr 1, 2020

Ok, added a test to read in an example DPR file. I just kept the same format as the other tests, so there are more tests than are probably necessary. Fingers crossed I did this all right.

@zssherman
Copy link
Collaborator

zssherman commented Apr 1, 2020

@dcedgren Thanks for adding that! Seems to be failing due to a missing parenthesis syntax error line 202 of test nexrad level 3

Fixed syntax error and strengthened reference to Metpy for future.
@dcedgren
Copy link
Contributor Author

dcedgren commented Apr 1, 2020

Hmm. I don't think it was a parenthesis. I think it was a period at the end of the line. The prior tests have periods at the end of the function definitions, but I've never seen that before. I just echoed it but I think that's what it didn't like.

dcedgren added 2 commits April 1, 2020 14:33
Also added correction in testing for altitude in meters instead of feet.
@dcedgren
Copy link
Contributor Author

dcedgren commented Apr 1, 2020

This pull request will fail because instrument altitude in the testing has been changed to meters rather than feet.

Once the new feet vs. meter pull request is merged it should pass and as far as I'm concerned should be ready to be incorporated.

@dcedgren
Copy link
Contributor Author

Will close PR and reopen to retrigger checks, which should pass now that feet vs. meters discrepancy has been resolved.

@dcedgren dcedgren closed this May 19, 2020
@dcedgren dcedgren reopened this May 19, 2020
@dcedgren
Copy link
Contributor Author

Ok, that didn't work. I'll try adding a dummy commit instead.

@zssherman
Copy link
Collaborator

Ah so @dcedgren its a conflict issue. I think it was from the pr #926

@zssherman
Copy link
Collaborator

@dcedgren I'll do a PR to your branch shortly to fix it

@dcedgren
Copy link
Contributor Author

Yes, this was an issue where we were changing 2 things at the same time so I made the testing line up with the way it would eventually end up. It's actually PR #924. I think if we just rerun the test it should pass now that PR #924 has been merged.

dcedgren added 2 commits May 19, 2020 14:26
Adding a dummy comment to force checks.
Deleting the dummy comment
@zssherman
Copy link
Collaborator

Weird, it still shows conflicts, but they should have been resolved, is there maybe a marker still hidden somewhere? I don't see anything though which is weird

@dcedgren
Copy link
Contributor Author

Hmm. I may not have understood exactly what was going on here. I assumed the checks just had to be rerun, but I guess there is a conflict with another more recent pull request and Github can't figure out how to sort it. Sorry, still trying to learn the lingo.

@zssherman
Copy link
Collaborator

zssherman commented May 19, 2020

There we go, I expect appveyor to fail, but its unrelated to this PR, but once travis passes, we should be groovy

@dcedgren
Copy link
Contributor Author

pyart/io/tests/test_nexrad_level3.py:196: AssertionError
0.244 == 0.244

I don't understand why Travis failed.

@zssherman
Copy link
Collaborator

Weird... They match if i'm reading that correctly lol, im going to restart the build

@dcedgren
Copy link
Contributor Author

So it's the last line of the test, and of the module, that fails. That makes me suspicious, but I don't know what could cause that.

Also, how did you restart the build? That was what I was trying to do earlier.

@zssherman
Copy link
Collaborator

I'm not sure either, it looks like it shows the values matching, which is odd. To restart the test, you go into details for the testing such as travis on this page. And once your GitHub is linked to travis, after going to the details page in the top right, there is a retart build option

dcedgren added 2 commits May 20, 2020 11:54
Asserting data value for test_nexrad_level3_msg176() was failing because a float was being compared to a np.float32 value. It was working where there was no extra precision but for this new test case there were extra trailing digits so somehow the rounding wasn't working.
@dcedgren
Copy link
Contributor Author

Ok, Travis passed. It should be good to merge.

@zssherman
Copy link
Collaborator

Thanks again for doing this @dcedgren ! Merging.

@zssherman zssherman merged commit 7e137b1 into ARM-DOE:master May 20, 2020
@dcedgren
Copy link
Contributor Author

Absolutely! It's my first real open-source contribution and it's been fun. Thanks for your help.

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