Giter Club home page Giter Club logo

nrt-predict's People

Contributors

daleroberts avatar james-blitzm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

nrt-predict's Issues

Band reference interface

It would be great if this library also supported references to bands by names rather than their indices.

While a 3d array arr[y, x, band] interface works great for certain algorithms, a dict of 2d arrays interface {band_name: arr[y, x]} would make the code more readable and maintainable at the cost of little or no performance penalties for most algorithms.

Of course, this would also mean that standard ODC dask.array-backed xarray.Dataset interface would just work, without this library needing to depend on either of those libraries.

Under this scheme, for example,

def predict(self, pre, pst):
    pre_nbr = (pre[:, :, 6] - pre[:, :, 8]) / (pre[:, :, 6] + pre[:, :, 8])
    pst_nbr = (pst[:, :, 6] - pst[:, :, 8]) / (pst[:, :, 6] + pst[:, :, 8])
    return pre_nbr - pst_nbr

would look like

def predict(self, pre, pst):
    pre_nbr = (pre['nbar_B06'] - pre['nbar_B08']) / (pre['nbar_B06'] + pre['nbar_B08'])
    pst_nbr = (pst['nbar_B06'] - pst['nbar_B08']) / (pst['nbar_B06'] + pst['nbar_B08'])
    return pre_nbr - pst_nbr

note that these band names should work with ODC. Or maybe even better

def predict(self, pre, pst):
    pre_nbr = (pre['nbar_red_edge_2'] - pre['nbar_nir_1']) / (pre['nbar_red_edge_2'] + pre['nbar_nir_1'])
    pst_nbr = (pst['nbar_red_edge_2'] - pst['nbar_nir_1']) / (pst['nbar_red_edge_2'] + pst['nbar_nir_1'])
    return pre_nbr - pst_nbr

or something like that, if I recall the band names correctly. This of course needs a dictionary to translate 'nbar_B08' to 'nbar_nir_1' somewhere in this code base.

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.