Private Preview This notebook demonstrates how to generate a harvest season Sentinel-2 median mosaic using Wherobots RasterFlow. You will learn how to define an Area of Interest, build a seasonal composite mosaic, and visualize the results as RGB imagery.Documentation Index
Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
Use this file to discover all available pages before exploring further.
Sentinel-2 Mosaics for Harvest and Growing Seasons or Custom Time Ranges
RasterFlow provides pre-built seasonal mosaic datasets that use latitude-based heuristics to determine the optimal imaging window for agricultural analysis. S2_MED_PLANTING: Sentinel-2 median composite dataset for planting season. S2_MED_HARVEST: Sentinel-2 median composite dataset for harvest season. S2_MED_WINDOWED_PIXEL_ALL_BANDS: Sentinel-2 median composite over a user-specified date window, returning all 12 L2A spectral bands at 10m. No season heuristic is applied. In this example, we will generate a mosaic for the harvest season. The mosaic contains 5 bands:s2med_harvest:B02- Blue (10m)s2med_harvest:B03- Green (10m)s2med_harvest:B04- Red (10m)s2med_harvest:B08- NIR (10m)s2med_harvest:N_VALID_PIXELS- Count of valid pixels used in the median calculation
S2_MED_WINDOWED_PIXEL_ALL_BANDS to show how to get all 12 spectral bands over a custom date window.
Setup and Imports
Initializing the RasterFlow client
Selecting an Area of Interest (AOI)
We will use Haskell County, Kansas as our AOI. This is an agricultural region in the US Great Plains, ideal for demonstrating harvest-season imagery.Building the harvest season mosaic
This step builds a Sentinel-2 median composite mosaic for the harvest season only. The workflow will:- Query Sentinel-2 imagery for the AOI and date range
- Filter to harvest season dates based on latitude
- Apply cloud and quality filtering — excluding scenes with >= 75% cloud cover and masking pixels flagged as cloud, cloud shadow, cirrus, saturated/defective, or unclassified in the SCL band
- Compute a pixel-wise median composite across remaining valid observations
- Output the result as a Zarr store
Note: This step will take approximately 10-15 minutes to complete. If you want to skip this build_mosaic step, you can uncomment the next cell and start with a pre-generated mosaic.
Visualizing outputs
If RasterFlow is enabled for your organization, you can visualize the Zarr outputs using cloud.wherobots.com/map.Building an ALL_BANDS mosaic over a custom window
Pick theS2_MED_WINDOWED_PIXEL_ALL_BANDS dataset when:
- You need a specific date window (e.g., a single month, or pre/post a known event) —
startandendare used directly, with no latitude-based seasonal filtering. - You need bands beyond RGB+NIR — for example red-edge (B05, B06, B07, B8A), water vapor (B09), or SWIR (B11, B12) bands for indices like NDMI, NBR, or NDWI.
Summary
This notebook demonstrated how to:- Use RasterFlow to build a harvest-season Sentinel-2 median mosaic
- Build a custom-window all-bands Sentinel-2 mosaic with
S2_MED_WINDOWED_PIXEL_ALL_BANDS
Next steps
- Compare with a planting season mosaic using
DatasetEnum.S2_MED_PLANTING - Run the FTW model for field boundary detection (see
RasterFlow_FTW.ipynb) - Use the mosaic as input for model inference using predict_mosaic

