Skip to content

Commit

Permalink
Remove unit scaling code from geostationary transform as this will be…
Browse files Browse the repository at this point in the history
… handled elsewhere
  • Loading branch information
Tara Drwenski committed Sep 15, 2023
1 parent 7456c51 commit ecda190
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,6 @@ public TransformType getTransformType() {
return TransformType.Projection;
}

private double getScaleFactor(String geoCoordinateUnits) {
// default value of -1.0 interpreted as no scaling in the class
// ucar.unidata.geoloc.projection.sat.Geostationary
double scaleFactor = defaultScaleFactor;
String neededMapCoordinateUnit = "radian";

if (SimpleUnit.isCompatible(geoCoordinateUnits, neededMapCoordinateUnit)) {
scaleFactor = SimpleUnit.getConversionFactor(geoCoordinateUnits, neededMapCoordinateUnit);
}

logger.debug("geoCoordinateUnits {}, scaleFactor {}", geoCoordinateUnits, scaleFactor);

return scaleFactor;
}

public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) {
readStandardParams(ctv, geoCoordinateUnits);

Expand Down Expand Up @@ -145,13 +130,8 @@ public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCo
isSweepX = fixed_angle.equals("y");
}

// scales less than zero indicate no scaling of axis (i.e. map coords have units of radians)
double geoCoordinateScaleFactor;

geoCoordinateScaleFactor = getScaleFactor(geoCoordinateUnits);

ProjectionImpl proj = new ucar.unidata.geoloc.projection.sat.Geostationary(subLonDegrees, perspective_point_height,
semi_minor_axis, semi_major_axis, inv_flattening, isSweepX, geoCoordinateScaleFactor);
semi_minor_axis, semi_major_axis, inv_flattening, isSweepX);

return new ProjectionCT(ctv.getName(), "FGDC", proj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class LambertConformal extends ProjectionImpl {
private static final String NAME = "LambertConformal";
private static String DEFAULT_UNITS = "km";
private static final String DEFAULT_UNITS = "km";

private final double earth_radius;
private double lat0, lon0; // lat/lon in radians
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class Geostationary extends ProjectionImpl {
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Geostationary.class);

private static final String NAME = CF.GEOSTATIONARY;
private static String DEFAULT_UNITS = "radians";
private static final String DEFAULT_UNITS = "radians";

private boolean scaleGeoCoordinate;
private double geoCoordinateScaleFactor = Double.MIN_VALUE;
Expand Down

0 comments on commit ecda190

Please sign in to comment.