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

NCL stdatmus_z2tdp[💡]: #631

Open
ABF-EC opened this issue Jul 9, 2024 · 5 comments
Open

NCL stdatmus_z2tdp[💡]: #631

ABF-EC opened this issue Jul 9, 2024 · 5 comments
Labels
feature a new feature that is going to be developed support Support request opened by outside user/collaborator triage Needs triage

Comments

@ABF-EC
Copy link

ABF-EC commented Jul 9, 2024

Describe the functionality you are requesting, linking any relevant usage or previous implementations in the python ecosystem or otherwise.

Hi,
I am wondering how to acces the stdatmus_z2tdp function from NCL in python.
Is this fonction available in your package? Do you know other package that could be loaded in pythin via conda that include NCL functions stdatmus_z2tdp?
Thanks and have nice day!

Is this a request for functionality that was previously in NCL?

Yes

Additional context

https://www.ncl.ucar.edu/Document/Functions/Built-in/stdatmus_z2tdp.shtml

@ABF-EC ABF-EC added feature a new feature that is going to be developed support Support request opened by outside user/collaborator triage Needs triage labels Jul 9, 2024
@kafitzgerald
Copy link
Contributor

Thanks for the question!

We don't have this implemented here in geocat-comp, but metpy has several functions for standard atmosphere calculations. I've also seen some smaller packages out there with the functionality implemented (e.g. ussa1976). We can certainly take a look at what metpy has and what might be missing on our end, but if there's anything in particular that would be useful that'd be great to hear.

Also, we're currently working on a new resource (with an NCL index and Python content) that would be great to house this type of information. I'll see if we can prioritize getting an entry for this added and share that here once we have one. Any feedback would be greatly appreciated.

@ABF-EC
Copy link
Author

ABF-EC commented Jul 9, 2024

That would be great!

I will have a look at what is available in MetPy and will let you know if I find what I need.

Thank a lot and have a nice day!

@ABF-EC
Copy link
Author

ABF-EC commented Jul 9, 2024

Hi Katelyn,

I have looked into the MetPy library https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.height_to_pressure_std.html#metpy.calc.height_to_pressure_std
There are a few major issues with the height_to_pressure_std function from MetPy. They are using the ICAO standard atmosphere from 1976 and not the current one from 1993. The constants used in the formula equation are not the same as the ICAO standard atmosphere definition from 1993, The last issue is that the equation that they are using is valid only for the troposphere. They are not consider other atmospheric layer (tropopause, etc.).

Do you know if the NCL equations for the stdatmus_z2tdp would contain the same faults?

What are the constant and equations used in stdatmus_z2tdp? Are they the same as the one I mentioned here
Unidata/MetPy#3561 ?

Thanks a lot!
Anna-Belle

@kafitzgerald
Copy link
Contributor

kafitzgerald commented Jul 10, 2024

I believe NCL uses the 1976 U.S. Standard Atmosphere as a reference, but has a more robust implementation than MetPy. You can see the code here: https://github.com/NCAR/ncl/blob/develop/ni/src/lib/nfpfort/stndAtmUS76_dp.f

I also noticed this Python package https://github.com/airinnova/ambiance which seems to implement the newer standard, but haven't had a chance to look it over too deeply.

@ABF-EC
Copy link
Author

ABF-EC commented Jul 11, 2024

Hi Katelyn,

Thanks a lot for sharing the code.

I have look into the NCL code and even though the equation's names say US std atm 1976, when I look at the constant definition I see that they are the same as the std atm definition from 1993. So, I believe that it was adjusted to fit the most recent standard atmosphere version.

I was able to use the Python package ambiance. It is working well to transfer the height to pressure for a standard atmosphere.

Thanks again for your support I truly appreciate it!
Anna-Belle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a new feature that is going to be developed support Support request opened by outside user/collaborator triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants