/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var sstg = ee.ImageCollection("projects/sat-io/open-datasets/sstg");
/***** End of imports. If edited, may not auto-convert in the playground. *****/
print(sstg.size())
Map.setCenter(-28.54, 42.92,3)

var cmap = ["#000080", "#0000ff", "#0063ff", "#00d4ff", "#4effa9", "#a9ff4e", "#ffe600", "#ff7d00", "#ff1400", "#800000"]

var addyear = function(image){
  return image.set('year',image.date().get('year')).copyProperties(image)
}

print(sstg.map(addyear).aggregate_histogram('year'))
Map.addLayer(sstg.sort('system:index',false).first(),{min:-2,max:34,palette:cmap},'SSTG Sample')