protected void setBoundingBox() { LatLonRect largestBB = null; // look through all the coord systems for (Object o : csHash.values()) { RadialCoordSys sys = (RadialCoordSys) o; sys.setOrigin(origin); LatLonRect bb = sys.getBoundingBox(); if (largestBB == null) largestBB = bb; else if (bb != null) largestBB.extend(bb); } boundingBox = largestBB; }
/** * Get the maximum radial distance, in km. */ public double getMaximumRadial() { if (maxRadial == 0.0) { try { Array radialData = getRadialAxisDataCached(); maxRadial = MAMath.getMaximum( radialData); String units = getRadialAxis().getUnitsString(); SimpleUnit radialUnit = SimpleUnit.factory(units); maxRadial = radialUnit.convertTo(maxRadial, SimpleUnit.kmUnit); // convert to km } catch (IOException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } } return maxRadial; }
/** * Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v. * @param parseInfo put debug information into this StringBuffer; may be null. * @param cs CoordinateSystem to check. * @param v Variable to check. * @return the RadialCoordSys made from cs, else null. */ public static RadialCoordSys makeRadialCoordSys( Formatter parseInfo, CoordinateSystem cs, VariableEnhanced v) { if (parseInfo != null) { parseInfo.format(" "); v.getNameAndDimensions(parseInfo, true, false); parseInfo.format(" check CS " + cs.getName()); } if (isRadialCoordSys( parseInfo, cs)) { RadialCoordSys rcs = new RadialCoordSys( cs); if (cs.isComplete( v)) { if (parseInfo != null) parseInfo.format(" OK\n"); return rcs; } else { if (parseInfo != null) parseInfo.format(" NOT complete\n"); } } return null; }
public LatLonRect getBoundingBox() { if (bb != null) return bb; if (origin == null) return null; double dLat = Math.toDegrees( getMaximumRadial() / Earth.getRadius()); double latRadians = Math.toRadians( origin.getLatitude()); double dLon = dLat * Math.cos(latRadians); double lat1 = origin.getLatitude() - dLat/2; double lon1 = origin.getLongitude() - dLon/2; bb = new LatLonRect( new LatLonPointImpl( lat1, lon1), dLat, dLon); return bb; }
/** * Get the maximum radial distance, in km. */ public double getMaximumRadial() { if (maxRadial == 0.0) { try { Array radialData = getRadialAxisDataCached(); maxRadial = MAMath.getMaximum( radialData); String units = getRadialAxis().getUnitsString(); SimpleUnit radialUnit = SimpleUnit.factory(units); maxRadial = radialUnit.convertTo(maxRadial, SimpleUnit.kmUnit); // convert to km } catch (IOException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } } return maxRadial; }
/** * Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v. * @param parseInfo put debug information into this StringBuffer; may be null. * @param cs CoordinateSystem to check. * @param v Variable to check. * @return the RadialCoordSys made from cs, else null. */ public static RadialCoordSys makeRadialCoordSys( Formatter parseInfo, CoordinateSystem cs, VariableEnhanced v) { if (parseInfo != null) { parseInfo.format(" "); v.getNameAndDimensions(parseInfo, true, false); parseInfo.format(" check CS " + cs.getName()); } if (isRadialCoordSys( parseInfo, cs)) { RadialCoordSys rcs = new RadialCoordSys( cs); if (cs.isComplete( v)) { if (parseInfo != null) parseInfo.format(" OK%n"); return rcs; } else { if (parseInfo != null) parseInfo.format(" NOT complete%n"); } } return null; }
public LatLonRect getBoundingBox() { if (bb != null) return bb; if (origin == null) return null; double dLat = Math.toDegrees( getMaximumRadial() / Earth.getRadius()); double latRadians = Math.toRadians( origin.getLatitude()); double dLon = dLat * Math.cos(latRadians); double lat1 = origin.getLatitude() - dLat/2; double lon1 = origin.getLongitude() - dLon/2; bb = new LatLonRect( new LatLonPointImpl( lat1, lon1), dLat, dLon); return bb; }
protected void setBoundingBox() { LatLonRect largestBB = null; // look through all the coord systems for (Object o : csHash.values()) { RadialCoordSys sys = (RadialCoordSys) o; sys.setOrigin(origin); LatLonRect bb = sys.getBoundingBox(); if (largestBB == null) largestBB = bb; else largestBB.extend(bb); } boundingBox = largestBB; }
/** * Get the maximum radial distance, in km. */ public double getMaximumRadial() { if (maxRadial == 0.0) { try { Array radialData = getRadialAxisDataCached(); maxRadial = MAMath.getMaximum( radialData); String units = getRadialAxis().getUnitsString(); SimpleUnit radialUnit = SimpleUnit.factory(units); maxRadial = radialUnit.convertTo(maxRadial, SimpleUnit.kmUnit); // convert to km } catch (IOException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } } return maxRadial; }
/** * Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v. * @param parseInfo put debug information into this StringBuffer; may be null. * @param cs CoordinateSystem to check. * @param v Variable to check. * @return the RadialCoordSys made from cs, else null. */ public static RadialCoordSys makeRadialCoordSys( Formatter parseInfo, CoordinateSystem cs, VariableEnhanced v) { if (parseInfo != null) { parseInfo.format(" "); v.getNameAndDimensions(parseInfo, true, false); parseInfo.format(" check CS " + cs.getName()); } if (isRadialCoordSys( parseInfo, cs)) { RadialCoordSys rcs = new RadialCoordSys( cs); if (cs.isComplete( v)) { if (parseInfo != null) parseInfo.format(" OK%n"); return rcs; } else { if (parseInfo != null) parseInfo.format(" NOT complete%n"); } } return null; }
public LatLonRect getBoundingBox() { if (bb != null) return bb; if (origin == null) return null; double dLat = Math.toDegrees( getMaximumRadial() / Earth.getRadius()); double latRadians = Math.toRadians( origin.getLatitude()); double dLon = dLat * Math.cos(latRadians); double lat1 = origin.getLatitude() - dLat/2; double lon1 = origin.getLongitude() - dLon/2; bb = new LatLonRect( new LatLonPointImpl( lat1, lon1), dLat, dLon); return bb; }
protected void setBoundingBox() { LatLonRect largestBB = null; // look through all the coord systems for (Object o : csHash.values()) { RadialCoordSys sys = (RadialCoordSys) o; sys.setOrigin(origin); LatLonRect bb = sys.getBoundingBox(); if (largestBB == null) largestBB = bb; else if (bb != null) largestBB.extend(bb); } boundingBox = largestBB; }