private boolean compareCoordinateSystem(CoordinateSystem cs1, CoordinateSystem cs2, ObjFilter filter) { if (showCompare) f.format("compare CoordinateSystem '%s' to '%s' %n", cs1.getName(), cs2.getName()); List matchAxes = new ArrayList(); boolean ok = checkAll(cs1.getName(), cs1.getCoordinateAxes(), cs2.getCoordinateAxes(), matchAxes); for (int i = 0; i < matchAxes.size(); i += 2) { CoordinateAxis orgCs = (CoordinateAxis) matchAxes.get(i); CoordinateAxis copyCs = (CoordinateAxis) matchAxes.get(i + 1); ok &= compareCoordinateAxis(orgCs, copyCs, filter); } List matchTransforms = new ArrayList(); ok &= checkAll(cs1.getName(), cs1.getCoordinateTransforms(), cs2.getCoordinateTransforms(), matchTransforms); return ok; }
private boolean compareCoordinateSystem(CoordinateSystem cs1, CoordinateSystem cs2, ObjFilter filter) { if (showCompare) f.format("compare CoordinateSystem '%s' to '%s' %n", cs1.getName(), cs2.getName()); List matchAxes = new ArrayList(); boolean ok = checkAll(cs1.getName(), cs1.getCoordinateAxes(), cs2.getCoordinateAxes(), matchAxes); for (int i = 0; i < matchAxes.size(); i += 2) { CoordinateAxis orgCs = (CoordinateAxis) matchAxes.get(i); CoordinateAxis copyCs = (CoordinateAxis) matchAxes.get(i + 1); ok &= compareCoordinateAxis(orgCs, copyCs, filter); } List matchTransforms = new ArrayList(); ok &= checkAll(cs1.getName(), cs1.getCoordinateTransforms(), cs2.getCoordinateTransforms(), matchTransforms); return ok; }
public boolean compare(NetcdfFile org, NetcdfFile copy, ObjFilter filter, boolean showCompare, boolean showEach, boolean compareData) { this.compareData = compareData; this.showCompare = showCompare; this.showEach = showEach; f.format(" First file = %s%n", org.getLocation()); f.format(" Second file= %s%n", copy.getLocation()); long start = System.currentTimeMillis(); boolean ok = compareGroups(org.getRootGroup(), copy.getRootGroup(), filter); f.format(" Files are the same = %s%n", ok); long took = System.currentTimeMillis() - start; f.format(" Time to compare = %d msecs%n", took); // coordinate systems if (org instanceof NetcdfDataset && copy instanceof NetcdfDataset) { NetcdfDataset orgds = (NetcdfDataset) org; NetcdfDataset copyds = (NetcdfDataset) copy; List matches = new ArrayList(); ok &= checkAll("Dataset CS:", orgds.getCoordinateSystems(), copyds.getCoordinateSystems(), matches); for (int i = 0; i < matches.size(); i += 2) { CoordinateSystem orgCs = (CoordinateSystem) matches.get(i); CoordinateSystem copyCs = (CoordinateSystem) matches.get(i + 1); ok &= compareCoordinateSystem(orgCs, copyCs, filter); } } return ok; }
public boolean compare(NetcdfFile org, NetcdfFile copy, ObjFilter filter, boolean showCompare, boolean showEach, boolean compareData) { this.compareData = compareData; this.showCompare = showCompare; this.showEach = showEach; f.format(" First file = %s%n", org.getLocation()); f.format(" Second file= %s%n", copy.getLocation()); long start = System.currentTimeMillis(); boolean ok = compareGroups(org.getRootGroup(), copy.getRootGroup(), filter); f.format(" Files are the same = %s%n", ok); long took = System.currentTimeMillis() - start; f.format(" Time to compare = %d msecs%n", took); // coordinate systems if (org instanceof NetcdfDataset && copy instanceof NetcdfDataset) { NetcdfDataset orgds = (NetcdfDataset) org; NetcdfDataset copyds = (NetcdfDataset) copy; List matches = new ArrayList(); ok &= checkAll("Dataset CS:", orgds.getCoordinateSystems(), copyds.getCoordinateSystems(), matches); for (int i = 0; i < matches.size(); i += 2) { CoordinateSystem orgCs = (CoordinateSystem) matches.get(i); CoordinateSystem copyCs = (CoordinateSystem) matches.get(i + 1); ok &= compareCoordinateSystem(orgCs, copyCs, filter); } } return ok; }
ok &= checkAll("struct " + orgS.getNameAndDimensions(), orgS.getVariables(), ncmlS.getVariables(), vars); for (int i = 0; i < vars.size(); i += 2) { Variable orgV = (Variable) vars.get(i); ok &= checkAll(orgds.getFullName(), orgds.getCoordinateSystems(), copyds.getCoordinateSystems(), matches); for (int i = 0; i < matches.size(); i += 2) { CoordinateSystem orgCs = (CoordinateSystem) matches.get(i);
VariableEnhanced orge = (VariableEnhanced) org; VariableEnhanced copye = (VariableEnhanced) copy; ok &= checkAll(orge.getCoordinateSystems(), copye.getCoordinateSystems(), null); ok &= checkAll(orgS.getVariables(), ncmlS.getVariables(), vars); for (int i = 0; i < vars.size(); i += 2) { Variable orgV = (Variable) vars.get(i);
ok &= checkAll("struct "+orgS.getNameAndDimensions(), orgS.getVariables(), ncmlS.getVariables(), vars); for (int i = 0; i < vars.size(); i += 2) { Variable orgV = (Variable) vars.get(i); ok &= checkAll(orgds.getFullName(), orgds.getCoordinateSystems(), copyds.getCoordinateSystems(), matches); for (int i = 0; i < matches.size(); i += 2) { CoordinateSystem orgCs = (CoordinateSystem) matches.get(i);
ok &= checkAll(org.getGroups(), copy.getGroups(), groups); for (int i = 0; i < groups.size(); i += 2) { Group orgGroup = (Group) groups.get(i);
ok &= checkAll(name, org.getGroups(), copy.getGroups(), groups); for (int i = 0; i < groups.size(); i += 2) { Group orgGroup = (Group) groups.get(i);
ok &= checkAll(name, org.getGroups(), copy.getGroups(), groups); for (int i = 0; i < groups.size(); i += 2) { Group orgGroup = (Group) groups.get(i);