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

Most unstable parcel #473

Merged
merged 2 commits into from
Jul 3, 2017
Merged

Conversation

jrleeman
Copy link
Contributor

Calculates the most unstable parcel (pressure, temperature, dew point) by maximizing theta-e.

@jrleeman jrleeman force-pushed the Most_Unstable_Parcel branch 2 times, most recently from 9b8411c to 8cba6bd Compare June 28, 2017 14:22
@dopplershift dopplershift added Area: Calc Pertains to calculations Type: Feature New functionality labels Jun 28, 2017
@dopplershift dopplershift added this to the Summer 2017 milestone Jun 28, 2017
Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

Code looks good--I love how simple the implementation is.

  1. You have conflicts against master
  2. Should this return height as well? Or even just the index of the most unstable parcel?

@jrleeman
Copy link
Contributor Author

  1. No problem - will rebase
  2. Good question. Since heights are not required, return a standard atmosphere. I like it. Returning an index seems like it might confuse some. I see it being useful for grabbing winds, etc. though. How about returning in this order p, T, Td, h, idx... most to least used roughly?

@jrleeman
Copy link
Contributor Author

Ok - on second thought I don't know about the index. It's really the index of the LAYER which could be an interpolated thing. Therefore I think just returning the height will be the most straight forward.

@dopplershift
Copy link
Member

Could we return the index only? Then the user can decide what they want to do with that information. Or I suppose returning the index could be its own function....

@dopplershift
Copy link
Member

Could also only return the height if the height was given....

theta_e = equivalent_potential_temperature(p_layer, T_layer)
max_idx = np.argmax(theta_e)
if heights is not None:
mu_height = heights[max_idx]
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually correct if the layer doesn't start at the bottom?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope.... hmm. Then it's back to the infamous get_layer

@dopplershift
Copy link
Member

I see what you mean about the index being confusing given the layer specification--fine, no returning index.

@dopplershift dopplershift merged commit 10e33fb into Unidata:master Jul 3, 2017
@jrleeman jrleeman deleted the Most_Unstable_Parcel branch July 3, 2017 22:28
@jrleeman jrleeman mentioned this pull request Jul 7, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants