Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions marblecutter/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ def apply(recipes, pixels, source=None):
if "imagery" in recipes:
LOG.info("Applying imagery recipe")

if "nd_bands" in recipes:
# nd_bands or rgb_bands should be in recipe, Otherwise an error will occur
LOG.info("nd_bands")
band1_tile = np.ma.array(data[recipes['nd_bands'][0]-1])
band2_tile = np.ma.array(data[recipes['nd_bands'][1]-1])

data = np.ma.array([(band2_tile.astype(float) - band1_tile.astype(float)) / (band2_tile.astype(float) + band1_tile.astype(float))])

if "rgb_bands" in recipes:
data = np.ma.array([data[i - 1] for i in recipes["rgb_bands"]])

Expand Down