I would like to reduce an image where the inputs are two images and the output is a table. One image will have zones (integer values) and the other data to summarize. For each zone in an image, I would like to calculate the mean of values in the other image that overlap that zone. In ArcGIS one could use the tool Zonal Statistics as Table.
https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/zonal-statistics-as-table.htm
//1- zone image (DEM binned 100m intervals)
//2- data to summarize (mean minimum temperature)
//3- figure out how to summarize mean tmin per dem zone and export as a csv
//zones (dem binned x 100m)
var DEM_binned = image.divide(100).ceil().clip(geometry);
Map.addLayer(DEM_binned, {min:0, max:40, palette:['blue', 'purple', 'green', 'yellow', 'orange', 'red', 'white']}, 'dem');
//data to summarize (mean long-term annual tmin)
var tmin = imageCollection.select('tmin');
var tmin = tmin.mean().clip(geometry);
Map.addLayer(tmin, {min: -5, max: 20, palette:['white', 'blue', 'green', 'yellow', 'red']}, 'tmin')
//get mean tmin per zone as a table
GEE working example script: https://code.earthengine.google.com/0f50cbfbbb8ee8eabad07d9569b9a58a