Giter Site home page Giter Site logo

mjucker / aostools Goto Github PK

View Code? Open in Web Editor NEW
30.0 8.0 15.0 862 KB

Helper functions for postprocessing and analysis of netCDF data. Also includes I/O routines to seamlessly work with pv_atmos.

License: GNU General Public License v3.0

Python 100.00%

aostools's Introduction

aostools

DOI pypi

Helper functions for scientific postprocessing and analysis of netCDF data. Also includes I/O routines to seamlessly work with pv_atmos. This readme will be extended in the near future. Until then, each function has documentation, just try help(myfunction) for information.

Installation

aostools is on PyPi. Thus, simply install the package running

pip install aostools

If you want to use map projections (with the Projection() function), you'd also want to install Cartopy. The best way to do this is via conda

conda install cartopy

xarray integration

While my goal is to make all functions work with xarray, this is still work in progress. For now, some of the functions exist for both numpy and xarray data, and if you have xarray Datasets or DataArrays, look for functions named SomeFunctionNameXr(), whereas the numpy equivalend would be SomeFunctionName(). For instance, the Eliassen-Palm flux calculations are done in ComputeEPfluxDiv() for numpy arrays and ComputeEPfluxDivXr() for xarray.DataArrays.

How to cite

If you use any of the aostools functionality for your published work, please include a citation using either the generic DOI for all versions, 10.5281/zenodo.597598, or the DOI linking to the specific release, which you can find by visiting the same link.

If you use the Eliassen-Palm flux calculations or plotting abilities, please also cite Jucker ASL (2021), DOI 10.1002/asl.1020. If you use the wave activity flux calculations, please cite Takaya & Nakamura GRL (1997), DOI 10.1029/97GL03094.

Finally, if you use any of the xarray capability, you might want to thank those developers by citing Hoyer & Hamman JORS (2017), DOI 10.5334/jors.148.

aostools's People

Contributors

mjucker avatar rjaiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aostools's Issues

eof() should accept multi-dimensional arrays

As is, eof() only accepts arrays of shape [time x space]. If we want a 2d EOF (for instance), the array would have shape [time x space1 x space2], and the function won't work. There is a simple solution with numpy.reshape, but this should be included in the function rather than up to the user before calling the function.

constant p0

Hi Martin, I have been playing around with the "ComputeMeridionalPVGrad" function and I think the call to the .constants module may be slightly off. The call says "import p0_Pa as p0" but I think it should just be "p0". Thanks!

Time mean of d(theta_bar)/dp?

Is there any reason for the following time mean of d(theta_bar)/dp?

dthdp = np.nanmean(dthdp,axis=0)[np.newaxis,:]

I did not find any justification for the time mean in the literature [1,2].

[1] Andrews, D. G., J. R. Holton, and C. B. Leovy, 1987: Middle Atmosphere Dynamics. Academic Press.
[2] Edmon, H. J., B. J. Hoskins, and M. E. McIntyre, 1980: Eliassen-Palm Cross Sections for the Troposphere. J. Atmos. Sci., 37, 2600โ€“2616.

Difference between uref and u

Hi,
Thanks for developing this awesome tool.

I would like to ask,
Please, what is the difference between uref and u when using the ComputeWaveActivityFlux function?
Since there are no tutorials on it yet, please, could you clarify this?
I have monthly u and v wind datasets. Please, see my code below.

data = xr.open_dataset(data1)
lon=data['lon']
lat=data['lat']
u = data['uwnd']
v = data['vwnd']
pres = data['level']
tref = data['air'] + 273.15 ##must be in Kelvin
hgt = data['hgt']

WAF = cli.ComputeWaveActivityFlux(phi_or_u = u,phiref_or_v = v,uref=u,vref=v,lat='infer',lon='infer',pres='infer',tref=tref,is_anomaly=False,qg=False,use_windspharm=False)

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.