GithubHelp home page GithubHelp logo

Comments (3)

mathause avatar mathause commented on June 12, 2024

I think you may not need groupby for this. And you may also be able to avoid the stacking/ unstacking which can be slow. Can you write a numpy function which does it for one grid point (e.g. using np.interp)? If so you can use xr.apply_ufunc to generalize it to the whole grid. (xr.apply_ufunc can be difficult to grasp sometimes, check out the examples and tutorials, e.g.: https://docs.xarray.dev/en/latest/examples/apply_ufunc_vectorize_1d.html)

from flox.

mgorfer avatar mgorfer commented on June 12, 2024

Thank you for your answer @mathause (and nice to hear from you again!)

I have explained my problem in more detail in the Xarray discussions
pydata/xarray#8149 (comment)

Because I every grid point has different altitudes at the pressure levels (which I calculate from the geopotential in the original data), my initial thought was that it needs to be done for every grid point separately.

I am doing this with the ERA5 hourly data on pressure levels from 1940 to present. Maybe there is even a dataset in altitude resolution out there, but I wanted to try the pressure to altitude mapping anyway.

from flox.

mathause avatar mathause commented on June 12, 2024

nice to hear from you again!

Likewise! I added an xr.apply_ufunc example in pydata/xarray#8149.

from flox.

Related Issues (20)

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.