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

Calculating dry air density #5

Open
tomchor opened this issue Feb 12, 2018 · 5 comments
Open

Calculating dry air density #5

tomchor opened this issue Feb 12, 2018 · 5 comments

Comments

@tomchor
Copy link

tomchor commented Feb 12, 2018

Let me start by saying this is a great piece of code. I am considering using it for most of the pre-processing calculations that I currently do in my package (Pymicra). Right now the pre-processing is coded in a very ugly way (https://github.com/tomchor/pymicra/blob/master/pymicra/micro/util.py) and this would be an elegant solution.

I'd like to ask a couple of things:
1 - is there a way to calculate density of dry air? I couldn't find one.
2 - if not, how hard would it be to implement it?
3 - Is this package still being maintained? Although I would very much like to implement this in my code, this is something I have to take into consideration.

Cheers

@mcgibbon
Copy link
Contributor

  1. Yes, you would use something like atmos.calculate('rho', Tv=273., p=1e5).
  2. If a quantity isn't handled, it's just a matter of adding it to the quantities dictionary and putting in some equations which calculate it in equations.py,
  3. Yes, sort of. As far as I know, this package never had a user base (other than myself using it to convert between measures of humidity), so it fell by the wayside. I haven't thought much about it in a while. But if you need help with the package (like this issue), have a bug that needs fixing, or want to submit a PR, I'm here to handle that. I wouldn't implement new features, but I can clean up and fix any existing ones that need it, and I would consider PRs for new features.

@mcgibbon
Copy link
Contributor

You can find a complete list of handled quantities and assumptions in the docstring for atmos.calculate.

@tomchor
Copy link
Author

tomchor commented Feb 12, 2018

I see. Indeed using your suggestion I can calculate it via the ideal gas law. Apparently rho stands for just for density, while I thought it stood for moist air density specifically.

How would you feel about separating rho and rho_dry (or rhod), the first one being reserved only for moist air and the second one being reserved only for dry air? I could try to do that myself.

It's nice that you're still somewhat maintaining atmos. I'll definitely try to incorporate your package in the future, then.

@mcgibbon
Copy link
Contributor

rho is the air density including moisture (I suppose that's what you mean by moist air density). If you'd like a dry density, you can do that by saying the air is dry :) Just set any moisture measure you want to zero (e.g. atmos.calculate('rho', T=273., p=1e5, rv=0.)), or you can give the air temperature as the virtual temperature Tv instead of as T (when these are equal, there is no moisture). I don't think it makes sense to add a new quantity for this purpose. I think there's also an assumption like "Tv_equals_T" which can be used for this purpose.

@nitesh1403
Copy link

How to do vertical integration, I found someone did
uq_int = atm.int_pres(uq, pmin=300e2)

But module 'atmos' has no attribute 'int_pres'

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

No branches or pull requests

3 participants