Comments (2)
These are the current steps I am taking to refactor the current worker script in the refactor_api branch and PR #13
- Renaming current
pansharpen
function tocalculate_landsat_pansharpen
. This function handles: - reading, updating input meta data
- writing the result of pansharpening (derived by
_pansharpen_worker
) into each window respectively via riomucho. _pansharpen_worker
function is the riomucho worker for pansharpening. It is responsible for:- Reading panchromatic band data, determines the datatype for the panchromatic band from meta data
- Determining RGB window sizes (includes padding)
- Determining affines for pan, RGB windows
- Reading RGB data
- Passing necessary arguments to the new
pansharpen
function to perform pansharpening - rescaling pansharpened array to destination datatype
- new
pansharpen
is the pansharpening python API (data-in, data-out, no IO) that performs pansharpening operations:- Takes ndarrays (RGB bands, pan band), and arguments (Affine transforms) etc
- Creates a mask of pixels where any channel is 0 (nodata)
- Apply the mask to each of the RGB bands
- Perform pansharpening using the specified algorithm. Default is Brovey.
- Returns ndarray, 3D with shape == (3, panband_height, panband_width)
The biggest advantage for refactoring the current pansharpening script into a pure function, separating IO from array operations is so that we can easily write unit tests that specifically test for array operations:
def test_create_apply_mask(arr):
.
.
def test_upsample(masked_arr, pan.shape, pan.shape, rgb_affine, r_crs, pan_affine, dst_crs)
.
.
def test_Brovey(arr1, arr2, weight, dtype):
.
.
def test_rescale(arr):
.
.
cc @dnomadb @perrygeo @celoyd @mapbox/satellite
from rio-pansharpen.
🚢 in PR #13
from rio-pansharpen.
Related Issues (19)
- We should pansharpen with padded windows HOT 3
- Pan path to release [Master Ticket] HOT 2
- Add tests for uint16 bit output HOT 1
- Update Readme HOT 1
- pip install failed with release [0.1.0] HOT 2
- CLI as a plugin in rio namespace
- Dealing with products other than Level1 L8 - dtype and nodata issues HOT 3
- pansharpen method - string or function?
- rio pansharpen command fails with AttributeError: bilinear HOT 2
- ValueError: blockxsize exceeds raster width with HOT 4
- Alpha band optional
- Option to output 16bit tifs HOT 2
- Window TypeError HOT 1
- TIR pan?
- make public, rio pansharpen HOT 1
- Test coverage HOT 4
- Docstrings HOT 1
- Rename to "pansharpen" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rio-pansharpen.