collapse_window: Get single value from pixel window

View source: R/filter_funcs.R

collapse_windowR Documentation

Get single value from pixel window

Description

Given a square matrix of pixel values, return a single value representing the whole box.

Usage

collapse_window(
  var,
  input_ws,
  output_ws,
  min_pix,
  useCVfilter = TRUE,
  max_CV = 0.15,
  stat_to_use = "median"
)

Arguments

var

Numeric vector or square matrix, length input_ws^2

input_ws

Integer, length of one side of the input square pixel box

output_ws

Integer, length of one side of the output square pixel box (<= input_ws)

min_pix

Integer, minimum number of valid pixels required

useCVfilter

TRUE/FALSE - if median CV (coefficient of variation, filteredSD/filteredMean) is > max_CV, return NA?

max_CV

Maximum allowed CV

stat_to_use

String, either median, mean, or geomean - the statistic used on the final filtered set of var

Details

This is used when reading L2 satellite points matched to in situ data in order to get a single pixel value representing the box (e.g. 5x5 pixels) around the center pixel closest to the in situ sampling location.

Value

Single numeric value representing the input window


BIO-RSG/oceancolouR documentation built on April 25, 2024, 12:28 p.m.