hypso.window#
Pixel windows: a product’s pixels in a size x size box around a site and their per-band statistics (Product.window).
This is the product side of a matchup only. Ground truth, time matching, other sensors, QC thresholds and the matchup protocol itself belong to the processing pipeline (hypso-processing-pipeline), which calls this.
The statistics are those of the pipeline’s extraction.py for HYPSO: find the nearest pixel, take the box clipped at the image edges, NaN-aware mean/median/std per band, CV = std / median, cv_median over a band range (default 405-570 nm, the pipeline’s convention), a pixel counted valid when any band in that range is finite. No outlier rejection: per the usual matchup protocol (Bailey & Werdell 2006) heterogeneity shows in the CV instead. Differences: flagged pixels can be excluded (exclude_flags, pixel_flags names), and the mean angles are the window’s, not the whole scene’s. The nearest pixel is found geodesically (Product.pixel), not by Euclidean distance in degrees as the pipeline does.
Functions#
|
Window statistics around a given pixel. |
Module Contents#
- hypso.window.window_statistics(tree, center, latitude, longitude, size=3, exclude_flags=None, cv_band_range=CV_BAND_RANGE)[source]#
Window statistics around a given pixel.
- Parameters:
tree (xarray.DataTree) – Product tree.
center (tuple of int) –
(line, sample)of the centre pixel ((y, x)when gridded).latitude (float) – The site, for the reported centre distance.
longitude (float) – The site, for the reported centre distance.
size (int) – As in
hypso.Product.window().exclude_flags – As in
hypso.Product.window().cv_band_range – As in
hypso.Product.window().
- Returns:
- Return type: