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

Add specific_humidity_from_dewpoint #1027

Merged
merged 5 commits into from
Mar 4, 2022
Merged

Add specific_humidity_from_dewpoint #1027

merged 5 commits into from
Mar 4, 2022

Conversation

huard
Copy link
Collaborator

@huard huard commented Feb 23, 2022

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • HISTORY.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.
  • bumpversion patch has been called on this branch
  • The relevant author information has been added to .zenodo.json

What kind of change does this PR introduce?

  • Adds new indice and indicator for specific_humidity_from_dewpoint.

Does this PR introduce a breaking change?

No

Other information:

  • long_name is capitalized for humidity indicators (long_name="Specific Humidity"). Is that a typo ?
  • Didn't implement the invalid_values stuff cause I wasn't sure if it applied here.

Copy link
Collaborator

@aulemahal aulemahal left a comment

Choose a reason for hiding this comment

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

Seems good! Need for ps instead of tas does indeed lower the usefulness of this method, but we never know.

HISTORY.rst Outdated Show resolved Hide resolved
xclim/indicators/atmos/_conversion.py Outdated Show resolved Hide resolved
xclim/indices/_conversion.py Show resolved Hide resolved
"""

ε = 0.6219569 # weight of water vs dry air []
e = saturation_vapor_pressure(tas=tdps, method=method) # vapor pressure [Pa]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason the ice_thresh arg of e_sat is not implemented?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From what I read, this is only useful below -40C, so it seemed overkill here. But I may have misunderstood.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh! I didn't know that. I added it in the others for completeness and thought it could be here too for symmetry...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm sympathetic to the symmetry argument, but I didn't want to add a parameter I was not sure would ever be used. I don't have a strong opinion, and we don't even have a real use case now that "ps" is required...

@coveralls
Copy link

coveralls commented Feb 23, 2022

Coverage Status

Coverage increased (+0.01%) to 91.58% when pulling 6ad8b19 on fix-864 into 9653f1d on master.

Copy link
Contributor

@RondeauG RondeauG left a comment

Choose a reason for hiding this comment

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

I can't comment on the calculation method itself but other than that, looks good!

@huard huard merged commit 58f4ae4 into master Mar 4, 2022
@huard huard deleted the fix-864 branch March 4, 2022 18:54
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.

Equivalent of relative_humidity_from_dewpoint for specific_humidity
5 participants