Coder Social home page Coder Social logo

Comments (3)

giovaniceotto avatar giovaniceotto commented on May 14, 2024

For latitude and longitude, currently a TypeError is thrown if the input values are outside the grid given by netCDF and OPeNDAP files.

The current idea is to keep throwing errors for such cases since bi-linear interpolation is no longer possible outside the grid given. However, the type of the exception should be different, perhaps ValueError.

In case of the date input, the current implementation does not interpolate between dates in the file, but simply chooses the closest one, i.e. nearest neighbor. Therefore, an exception is not necessary and just a warning would be fine.

from rocketpy.

giovaniceotto avatar giovaniceotto commented on May 14, 2024

I believe raising a ValueError for wrong date inputs would be better than using warning, specially in terms of consistency. Besides consistency, I do not believe there is a big different for the end user.

from rocketpy.

giovaniceotto avatar giovaniceotto commented on May 14, 2024

Just fixed this in the last two commits: a97620f and e99389e.

When the input longitude, latitude and date are outside the range supplied by the file, a ValueError exception is thrown, explaining the reason and showing the relevant range of the file.

An alternative for the date would be simply to ask netCDF4 to select only exact dates, raising and error whenever a date supplied not contained in the file was given. This wasn't the chosen implementation since it offered little explanation to the user.

Furthermore, when the input date does not match exactly any of the file dates, a warning is now given, and the nearest date available is used. This was decided since no date interpolation is done. Of course, this does not apply to dates outside the file range.

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.