verde icon indicating copy to clipboard operation
verde copied to clipboard

Add a function to fill NaNs in a grid

Open leouieda opened this issue 1 year ago • 4 comments

Description of the desired feature:

This is a surprisingly hard thing to do so it would be nice to have an easy function that does this. Here's what I propose:

def fill_nans(grid, neighbors=1):
    # Make the grid into a table
    # Make KNeighbors interpolator with the given neighbors
    # Fit the interpolator.
    # Predict on the NaN values
    # Make a new grid
    return filled_grid

Are you willing to help implement and maintain this feature?

Yes

Related to https://github.com/fatiando/harmonica/issues/396

leouieda avatar Mar 14 '24 17:03 leouieda

Hello,

I Would like to contribute to thie feature. I'm geology student and work as a programmer, and i'm starting to contribute to open-source code in geosciences.

Regarding this feature, would the function go inside io.py?

Phssilva avatar Mar 18 '24 02:03 Phssilva

Hi @Phssilva thank you for volunteering! It could go into verde/utils.py for now. We can move it and some other functions into a separate file later.

Do you need any help getting started? Make sure you've looked at our Contributing Guide and let us know if anything in there isn't clear.

leouieda avatar Mar 18 '24 19:03 leouieda

Hi @leouieda , I've read about contributions, and here we go, starting my first contribution to an open-source code. Thanks for your attention. If I have any questions regarding the implementation, I'll put them there.

Phssilva avatar Mar 18 '24 19:03 Phssilva

Awesome! Thank you for taking this on.

Please open the pull request as soon as you have a commit. It doesn't have to be done before you open the PR. Having the PR open gives us a place to discuss and ask questions. Plus, it lets us know how you're progressing.

leouieda avatar Mar 19 '24 17:03 leouieda