public Geostationary(double subLonDegrees, boolean isSweepX) { super(NAME, false); String sweepAngleAxis = "y"; if (isSweepX) { sweepAngleAxis = "x"; } String scanGeometry = GEOSTransform.sweepAngleAxisToScanGeom(sweepAngleAxis); navigation = new GEOSTransform(subLonDegrees, scanGeometry); makePP(); }
/** * Transform integer FGF coordinates to (longitude, latitude) of pixel center * The (i,j) pixel, zero-based, refers to the pixel center. * * @param scale_x scaleFactor from the x coordinate variable * @param offset_x addOffset from the x coordinate variable * @param scale_y scaleFactor from the y coordinate variable * @param offset_y addOffset from the y coordinate variable * @return (Longitude, Latitude), units: degrees, of FGF (i,j) pixel center */ public double[] elemLineToEarth(int elem, int line, double scale_x, double offset_x, double scale_y, double offset_y) { return FGFtoEarth((double) elem, (double) line, scale_x, offset_x, scale_y, offset_y); }
/** * Transform fractional FGF coordinates to (longitude, latitude). * * @param fgf_x fractional FGF coordinate, zero-based * @param fgf_y fractional FGF coordinate, zero-based * @param scale_x scaleFactor from the x coordinate variable * @param offset_x addOffset from the x coordinate variable * @param scale_y scaleFactor from the y coordinate variable * @param offset_y addOffset from the y coordinate variable * @return (Longitude, Latitude), units: degrees */ public double[] FGFtoEarth(double fgf_x, double fgf_y, double scale_x, double offset_x, double scale_y, double offset_y) { double[] xy = FGFtoSat(fgf_x, fgf_y, scale_x, offset_x, scale_y, offset_y); return satToEarth(xy[0], xy[1]); }
/** * Transform Earth coordinates (lon,lat) to fractional FGF coordinates. * * @param geographic_lon Longitude, units: degrees * @param geographic_lat Latitude, units: degrees * @param scale_x scaleFactor from the x coordinate variable * @param offset_x addOffset from the x coordinate variable * @param scale_y scaleFactor from the y coordinate variable * @param offset_y addOffset from the y coordinate variable * @return fractional fgf coordinates */ public double[] earthToFGF(double geographic_lon, double geographic_lat, double scale_x, double offset_x, double scale_y, double offset_y) { double[] xy = earthToSat(geographic_lon, geographic_lat); return SatToFGF(xy[0], xy[1], scale_x, offset_x, scale_y, offset_y); }
public GEOSTransform(double subLonDegrees, double perspective_point_height, double semi_minor_axis, double semi_major_axis, String sweep_angle_axis) { Geoid geoid = new Geoid(semi_minor_axis, semi_major_axis); scan_geom = sweepAngleAxisToScanGeom(sweep_angle_axis); init(subLonDegrees, scan_geom, geoid, perspective_point_height); }
public Geostationary() { super(NAME, false); navigation = new GEOSTransform(); makePP(); }
public GEOSTransform(double subLonDegrees, double perspective_point_height, double semi_minor_axis, double semi_major_axis, String sweep_angle_axis) { Geoid geoid = new Geoid(semi_minor_axis, semi_major_axis); init(subLonDegrees, scan_geom, geoid, perspective_point_height); }
@Override public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint) { double[] satCoords = navigation.earthToSat(latlon.getLongitude(), latlon.getLatitude()); double x = satCoords[0]; double y = satCoords[1]; // scale back to required units of x, y (we need them in radians) if (isGeoCoordinateScaled) x = x * geoCoordinateScaleFactor; destPoint.setLocation(satCoords[0], satCoords[1]); return destPoint; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Geostationary that = (Geostationary) o; if (!navigation.equals(that.navigation)) return false; return true; }
@Override public int hashCode() { return navigation.hashCode(); }
/** * Transform pixel center Earth coordinates (lon,lat) to integer FGF coordinates. * * @param scale_x scaleFactor from the x coordinate variable * @param offset_x addOffset from the x coordinate variable * @param scale_y scaleFactor from the y coordinate variable * @param offset_y addOffset from the y coordinate variable */ public int[] earthToElemLine(double geographic_lon, double geographic_lat, double scale_x, double offset_x, double scale_y, double offset_y) { double[] fgf = earthToFGF(geographic_lon, geographic_lat, scale_x, offset_x, scale_y, offset_y); int elem = (int) Math.floor(fgf[0] + 0.5); int line = (int) Math.floor(fgf[1] + 0.5); return new int[]{elem, line}; }
double[] lambda_theta_geos = GOES_to_GEOS(x, y); x = lambda_theta_geos[0]; y = lambda_theta_geos[1];
public Geostationary() { super(NAME, false); navigation = new GEOSTransform(); makePP(); }
/** * Transform Earth coordinates (lon,lat) to fractional FGF coordinates. * * @param geographic_lon Longitude, units: degrees * @param geographic_lat Latitude, units: degrees * @param scale_x scaleFactor from the x coordinate variable * @param offset_x addOffset from the x coordinate variable * @param scale_y scaleFactor from the y coordinate variable * @param offset_y addOffset from the y coordinate variable * @return fractional fgf coordinates */ public double[] earthToFGF(double geographic_lon, double geographic_lat, double scale_x, double offset_x, double scale_y, double offset_y) { double[] xy = earthToSat(geographic_lon, geographic_lat); return SatToFGF(xy[0], xy[1], scale_x, offset_x, scale_y, offset_y); }
public GEOSTransform(double subLonDegrees, double perspective_point_height, double semi_minor_axis, double semi_major_axis, double inverse_flattening, String sweep_angle_axis) { Geoid geoid; if (Double.isNaN(inverse_flattening)) { geoid = new Geoid(semi_minor_axis, semi_major_axis); } else { geoid = new Geoid(semi_minor_axis, semi_major_axis, inverse_flattening); } scan_geom = sweepAngleAxisToScanGeom(sweep_angle_axis); init(subLonDegrees, scan_geom, geoid, perspective_point_height); }
public GEOSTransform(double subLonDegrees, String scan_geom, String geoidID) { Geoid geoid = null; if (geoidID == null) { if (scan_geom.equals(GEOS)) { geoid = wgs84; } else if (scan_geom.equals(GOES)) { geoid = grs80; } } else if (geoidID.equals(WGS84)) { geoid = wgs84; } else if (geoidID.equals(GRS80)) { geoid = grs80; } if (geoid == null) { throw new IllegalArgumentException("GEOSTransform unrecognized scan_geom="+scan_geom+" geoidID="+geoidID); } init(subLonDegrees, scan_geom, geoid); }
@Override public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint) { double[] satCoords = navigation.earthToSat(latlon.getLongitude(), latlon.getLatitude()); destPoint.setLocation(satCoords[0], satCoords[1]); return destPoint; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Geostationary that = (Geostationary) o; if (!navigation.equals(that.navigation)) return false; if (!(geoCoordinateScaleFactor == that.geoCoordinateScaleFactor)) return false; return true; }
@Override public int hashCode() { return navigation.hashCode(); }
/** * Transform pixel center Earth coordinates (lon,lat) to integer FGF coordinates. * * @param scale_x scaleFactor from the x coordinate variable * @param offset_x addOffset from the x coordinate variable * @param scale_y scaleFactor from the y coordinate variable * @param offset_y addOffset from the y coordinate variable */ public int[] earthToElemLine(double geographic_lon, double geographic_lat, double scale_x, double offset_x, double scale_y, double offset_y) { double[] fgf = earthToFGF(geographic_lon, geographic_lat, scale_x, offset_x, scale_y, offset_y); int elem = (int) Math.floor(fgf[0] + 0.5); int line = (int) Math.floor(fgf[1] + 0.5); return new int[]{elem, line}; }