/** * copy constructor - avoid clone !! */ @Override public ProjectionImpl constructCopy() { return new MSGnavigation(lat0, lon0, 1000 * major_axis, 1000 * minor_axis, 1000 * sat_height, scale_x, scale_y); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new MSGnavigation( lat0, Math.toDegrees(lon0), 1000 * major_axis, 1000 * minor_axis, 1000 * sat_height, scale_x, scale_y); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new MSGnavigation( lat0, Math.toDegrees(lon0), 1000 * major_axis, 1000 * minor_axis, 1000 * sat_height, scale_x, scale_y); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new MSGnavigation(lat0, lon0, 1000 * major_axis, 1000 * minor_axis, 1000 * sat_height, scale_x, scale_y); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Test public void testMSG() { doOne(new MSGnavigation(), 60, 60, true); testProjection(new MSGnavigation()); MSGnavigation m = new MSGnavigation(); showProjVal(m, 0, 0); showProjVal(m, 60, 0); showProjVal(m, -60, 0); showProjVal(m, 0, 60); showProjVal(m, 0, -60); }
attributes.add(new Attribute("scale_y", new Double(scale_y))); proj = new MSGnavigation(Lat0, Lon0, major_axis, minor_axis, nr * major_axis, scale_x, scale_y);
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double minor_axis = readAttributeDouble( ctv, CF.SEMI_MINOR_AXIS, Double.NaN); double major_axis = readAttributeDouble( ctv, CF.SEMI_MAJOR_AXIS, Double.NaN); double height = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.HEIGHT_FROM_EARTH_CENTER, Double.NaN); double scale_x = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.SCALE_X, Double.NaN); double scale_y = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.SCALE_Y, Double.NaN); //ProjectionImpl proj = new ucar.unidata.geoloc.projection.sat.MSGnavigation(lat0, lon0, major_axis, minor_axis, height, scale_x, scale_y); ProjectionImpl proj = new ucar.unidata.geoloc.projection.sat.MSGnavigation(lat0, lon0, minor_axis, major_axis, height, scale_x, scale_y); // LOOK WTF? return new ProjectionCT(ctv.getShortName(), "FGDC", proj); }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double minor_axis = readAttributeDouble( ctv, CF.SEMI_MINOR_AXIS, Double.NaN); double major_axis = readAttributeDouble( ctv, CF.SEMI_MAJOR_AXIS, Double.NaN); double height = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.HEIGHT_FROM_EARTH_CENTER, Double.NaN); double scale_x = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.SCALE_X, Double.NaN); double scale_y = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.SCALE_Y, Double.NaN); ProjectionImpl proj = new ucar.unidata.geoloc.projection.sat.MSGnavigation(lat0, lon0, major_axis, minor_axis, height, scale_x, scale_y); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); }
public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double minor_axis = readAttributeDouble( ctv, CF.SEMI_MINOR_AXIS, Double.NaN); double major_axis = readAttributeDouble( ctv, CF.SEMI_MAJOR_AXIS, Double.NaN); double height = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.HEIGHT_FROM_EARTH_CENTER, Double.NaN); double scale_x = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.SCALE_X, Double.NaN); double scale_y = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.sat.MSGnavigation.SCALE_Y, Double.NaN); ProjectionImpl proj = new ucar.unidata.geoloc.projection.sat.MSGnavigation(lat0, lon0, major_axis, minor_axis, height, scale_x, scale_y); return new ProjectionCT(ctv.getName(), "FGDC", proj); }
MSGnavigation proj = new MSGnavigation(LaP, LoP, majorAxis, minorAxis, Nr * majorAxis, scale_x, scale_y); return new GdsHorizCoordSys(getNameShort(), template, getOctet4(7), scanMode, proj, startx, incrx, starty, incry, getNxRaw(), getNyRaw(), getNptsInLine());
@Test public void testConstructCopy() throws Exception { // These are the same as the values used in MSGnavigation() except for the 2nd, lon0. For the purposes of // this test, that's the only argument I care about. MSGnavigation msgNav = new MSGnavigation(0.0, 180, R_EQ, R_POL, SAT_HEIGHT, SAT_HEIGHT - R_EQ, SAT_HEIGHT - R_EQ); Assert.assertEquals(Math.PI, msgNav.getLon0(), 1e-6); // 180° = π radians. // The 2 tests below failed prior to TDS-575 being fixed. MSGnavigation msgNavCopy1 = (MSGnavigation) msgNav.constructCopy(); Assert.assertEquals(Math.PI, msgNavCopy1.getLon0(), 1e-6); // 180° = π radians. MSGnavigation msgNavCopy2 = (MSGnavigation) msgNavCopy1.constructCopy(); Assert.assertEquals(Math.PI, msgNavCopy2.getLon0(), 1e-6); // 180° = π radians. } }