From ecda1908ae02e92eec07becdaf01ea0fe4abc2b0 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Fri, 15 Sep 2023 12:31:09 -0600 Subject: [PATCH] Remove unit scaling code from geostationary transform as this will be handled elsewhere --- .../nc2/dataset/transform/Geostationary.java | 22 +------------------ .../geoloc/projection/LambertConformal.java | 2 +- .../geoloc/projection/sat/Geostationary.java | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/cdm/core/src/main/java/ucar/nc2/dataset/transform/Geostationary.java b/cdm/core/src/main/java/ucar/nc2/dataset/transform/Geostationary.java index ec2046ef5e..0053ef4462 100644 --- a/cdm/core/src/main/java/ucar/nc2/dataset/transform/Geostationary.java +++ b/cdm/core/src/main/java/ucar/nc2/dataset/transform/Geostationary.java @@ -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); @@ -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); } diff --git a/cdm/core/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java b/cdm/core/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java index ceec1b2cc0..916942d1ab 100644 --- a/cdm/core/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java +++ b/cdm/core/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java @@ -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 diff --git a/cdm/core/src/main/java/ucar/unidata/geoloc/projection/sat/Geostationary.java b/cdm/core/src/main/java/ucar/unidata/geoloc/projection/sat/Geostationary.java index b77b911d6d..7afef10307 100644 --- a/cdm/core/src/main/java/ucar/unidata/geoloc/projection/sat/Geostationary.java +++ b/cdm/core/src/main/java/ucar/unidata/geoloc/projection/sat/Geostationary.java @@ -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;