@Test
public void testL3UCell5Aggregation() throws Exception {

    final GridDef sourceGridDef = FILE_TYPE.getGridDef();
    final AggregationContext context = new AggregationContext();
    context.setSstGrid(new ScalarGrid(sourceGridDef, 292.0));
    context.setRandomUncertaintyGrid(new ScalarGrid(sourceGridDef, 1.0));
    context.setSeaIceFractionGrid(new ScalarGrid(sourceGridDef, 0.5));
    context.setClimatologySstGrid(new ScalarGrid(sourceGridDef, 291.5));
    context.setSeaCoverageGrid(new ScalarGrid(sourceGridDef, 0.8));
    context.setCoverageUncertaintyProvider(new MockCoverageUncertaintyProvider(1.1, 1.2, 0.5));
    final CellFactory<SpatialAggregationCell> cell5Factory = FILE_TYPE.getCellFactory5(context);
    final SpatialAggregationCell cell5 = cell5Factory.createCell(0, 0);
    //execution
    cell5.accumulate(context, new Rectangle(0, 0, 100, 100));
    final int expectedN = 100 * 100;
    assertEquals(expectedN, cell5.getSampleCount());
    Number[] results = cell5.getResults();
    assertNotNull(results);
    assertEquals(8, results.length);
    assertEquals(292.0, results[Aggregation.SST].doubleValue(), 1.0e-6);
    assertEquals(0.5, results[Aggregation.SST_ANOMALY].doubleValue(), 1.0e-6);
    assertEquals((0.5 * 10000) / 10000, results[Aggregation.SEA_ICE_FRACTION].doubleValue(), 1e-6);
    assertEquals(1.2 * (1.0 - pow(expectedN / 77500.0, 0.5)), results[Aggregation.COVERAGE_UNCERTAINTY].doubleValue(), 1e-6);
    assertEquals(sqrt((0.8 * 0.8 * 10000) / ((0.8 * 10000) * (0.8 * 10000))), results[Aggregation.RANDOM_UNCERTAINTY].doubleValue(), 1e-6);
}