throw new IllegalArgumentException("no grids");
// collect the grids into Gridsets, based on what time axis they use
HashMap<CoordinateAxis, Gridset> timeAxisHash = new HashMap<CoordinateAxis, Gridset>(); // key = timeAxis, value = Gridset
for (GridDatatype grid : grids) {
GridCoordSystem gcs = grid.getCoordinateSystem();
CoordinateAxis timeAxis = gcs.getTimeAxis();
if (timeAxis != null) {
Gridset gset = timeAxisHash.get(timeAxis); // group by timeAxis
if (gset == null) {
gset = new Gridset(timeAxis, gcs);
timeAxisHash.put(timeAxis, gset);
coordSet.add(timeAxis.getFullName());
}
gset.gridList.add(grid);
gridHash.put(grid.getFullName(), gset);
}
// assume runtimes are always the same
if ((runtimes == null) && (gcs.getRunTimeAxis() != null)) {
CoordinateAxis1DTime runtimeCoord = gcs.getRunTimeAxis();
Date[] runDates = runtimeCoord.getTimeDates();
baseDate = runDates[0];
runtimes = Arrays.asList(runDates);
runtimeDimName = runtimeCoord.getDimension(0).getName();
coordSet.add(runtimeCoord.getFullName());