Coder Social home page Coder Social logo

Comments (1)

giovaniceotto avatar giovaniceotto commented on May 14, 2024

Solving this was much harder than I thought it would be. But I have done it in the latest commit.

Turns out that some weather files present latitude values in in descending sorted order, such as ERA-Interim files for South America. This is the reason that the last approach was to check if the input coordinates are in between two consecutive coordinates of the weather file by using a sign multiplication method, fail-safe in terms of ascending or descending order.

However, it is true that it was slow. To make it faster, bisect was used and descending grids were dealt with by reversing them, than applying bisect and than reversing them again.

Furthermore, instead of operation on the masked arrays of latitudes and longitudes given by netCDF4, the arrays were first converted into simple lists. This may present problems if the grid has empty values, but this is not generally the case with the common weather models. Since it improves significantly the speed of the code, I decided that it is definitely worth it.

In the end, we achieved a speed increase varying from 10 times to 1000 times, depending on size of the latitudes and longitudes list, dropping from ms to micro seconds.

from rocketpy.

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.