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

Time-height displays. #453

Merged
merged 5 commits into from
Jan 19, 2016
Merged

Time-height displays. #453

merged 5 commits into from
Jan 19, 2016

Conversation

nguy
Copy link
Contributor

@nguy nguy commented Jan 11, 2016

Updated datetime_utils to convert to Epoch time if desired.
Updated RadarDisplay.plot_vpt to accept a flag to use time along x-axis.
Added time formatting for x-axis for time-height plots.

This is a suggestion at implementing the time-height plots discussed in Issue #451 and also allows to conversion of Epoch time for future development (perhaps Issue #435 ?).

Updated datetime_utils to convert to Epoch time if desired.
Updated RadarDisplay.plot_vpt to accept a flag to use time along x-axis.
Added time formatting for x-axis for time-height plots.
@nguy
Copy link
Contributor Author

nguy commented Jan 11, 2016

Just FYI, I used a NEXRAD L2 file for test. Read in, converted using to_vpt and then set the time_axis_flag. Worked for me.

@jjhelmus jjhelmus mentioned this pull request Jan 15, 2016
@@ -1019,6 +1019,7 @@ def join_radar(radar1, radar2):

# to combine times we need to reference them to a standard
# for this we'll use epoch time
### NG THIS should use new updated datetime_utils if accepted
Copy link
Contributor

Choose a reason for hiding this comment

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

Typically XXX to TODO are used to mark areas of code where future improvements might be needed. This makes these areas easy to grep for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@jjhelmus
Copy link
Contributor

@nguy Thanks for this addition, having the ability to plot times in VPTs will be great. I left a few comments on some places where I think the code could be improved.

nguy added 2 commits January 18, 2016 15:32
Updated doc strings in radardisplay.py
Updated test script.
Moved epoch units to a variable in datetime_utils, but maintained a get method to pull the units out if needed.
Code in radar.join_radars is added, but still commented out for the time being.
@@ -35,6 +35,7 @@
from ..config import get_metadata
from ..lazydict import LazyLoadDict
from .transforms import antenna_vectors_to_cartesian, cartesian_to_geographic
from ..util import datetime_utils
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to cause a circular import problem if anything in the util sub-package imports from core, which the xsect module does. For the time being I would remove this import and the commented out line but keep the TODO line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh, that's not good. Removed.

@jjhelmus
Copy link
Contributor

@nguy, A few additional comments. I would keep any changes to core/radar.py independent of this PR as there are some special concerns that need to be considered when making changes to anything in the core sub-module. Sorry to be a bugger on some of the style issues, I really like this new feature, but want to keep Py-ART's style consistent.

@nguy
Copy link
Contributor Author

nguy commented Jan 19, 2016

@jjhelmus No worries. It's best practice to follow the same style. Sloppy on my part.

Removing those lines from radar.py should remove any changes to the core, excepting the not for potential future changes. Is there a reason that the join_radars is in pyart.core vs. pyart.util?

Removed commented out code from pyart.core.radar.
Bug fix in radardisplay having to do with unused keyword. Additionally, removed datetime calculation of time variable as an attribute of RadarDisplay.
@jjhelmus
Copy link
Contributor

I do not believe there is any good reason that join_radars is in pyart.core rather than pyart.util other than historical. Moving join_radars to pyart.util makes sense to me and would resolve the circular import issue.

@nguy
Copy link
Contributor Author

nguy commented Jan 19, 2016

Do you want me to do that as part of this PR or leave it for another?
I don't think it's widely used yet, so I doubt it would cause issues in moving. Would you alias or just move it straight out?

@jjhelmus
Copy link
Contributor

Do the move in another PR, makes it easier to find and revert if necessary. Since join_radar is not in the user docs I don't see an issue with renaming it without an alias. The alias can always be added in later if folks request it.

I think this PR is good to merge. I'll wait util the CI checks finish, just to be sure.

@nguy
Copy link
Contributor Author

nguy commented Jan 19, 2016

Sounds good. Do you want me to just do that as a mini-PR after we merge this?
Would another radar.py under pyart.util be confusing?

@nguy
Copy link
Contributor Author

nguy commented Jan 19, 2016

Shoot, I forgot to remove the get_epoch_units function. Should I do that before the merge?

@jjhelmus
Copy link
Contributor

Go for it, I can hold off.

@jjhelmus
Copy link
Contributor

A mini-PR to move join_radar to util sounds good, maybe call the the module radar_utils?

@nguy
Copy link
Contributor Author

nguy commented Jan 19, 2016

I just started the push. Should be done momentarily.
After this is merged, I'll do the mini-PR. That's a good name, analogous to datetime_utils and I could see radar_utils growing.

@jjhelmus
Copy link
Contributor

Sounds like a plan. Just waiting to CI to pass, then I'll merge this. Thanks for all you work on this!

@nguy
Copy link
Contributor Author

nguy commented Jan 19, 2016

No problem. Luckily this was an easy one since it only took porting the code.

jjhelmus added a commit that referenced this pull request Jan 19, 2016
@jjhelmus jjhelmus merged commit 0b6c72b into ARM-DOE:master Jan 19, 2016
@nguy nguy mentioned this pull request Jan 19, 2016
@nguy nguy deleted the time-height branch January 28, 2016 23:56
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