daleroberts / nrt-predict Goto Github PK
View Code? Open in Web Editor NEWPredict from NRT data
License: Apache License 2.0
Predict from NRT data
License: Apache License 2.0
Refactor to be able to operate off L1C or L2A scenes from Sinergise or Element 84 as well.
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.
Need to decide whether to use flake8 or pylint for linting the source code.
This is required in order to import the NRT library into other applications.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.