diff --git a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/util/satellite/SatSpatialFactory.java b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/util/satellite/SatSpatialFactory.java
index 8fae4a1b19..c87dd39ab0 100644
--- a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/util/satellite/SatSpatialFactory.java
+++ b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/util/satellite/SatSpatialFactory.java
@@ -62,6 +62,8 @@ public class SatSpatialFactory {
public static final int PROJ_LAMBERT = 3;
public static final int PROJ_POLAR = 5;
+
+ public static final int PROJ_POLAR_SOUTH = 6;
public static final int PROJ_CYLIN_EQUIDISTANT = 7;
@@ -336,12 +338,17 @@ public class SatSpatialFactory {
switch (crsType) {
case PROJ_MERCATOR:
return createMercatorCrs(latin, cm);
+ case PROJ_POLAR:
+ if (latin >= 0.)
+ return createNorthPolarStereoCrs(latin, lov);
+ else
+ return createSouthPolarStereoCrs(latin, lov);
case PROJ_LAMBERT:
return createLambertCrs(latin, latin2, lov);
case PROJ_CYLIN_EQUIDISTANT:
return createEqCylCrs(latin, lov);
default:
- return createNorthPolarStereoCrs(lov);
+ return createNorthPolarStereoCrs(latin, lov);
}
}
@@ -361,9 +368,14 @@ public class SatSpatialFactory {
latin);
}
- private static ProjectedCRS createNorthPolarStereoCrs(double lov) {
+ private static ProjectedCRS createNorthPolarStereoCrs(double latin, double lov) {
return MapUtil.constructNorthPolarStereo(MapUtil.AWIPS_EARTH_RADIUS,
- MapUtil.AWIPS_EARTH_RADIUS, 60, lov);
+ MapUtil.AWIPS_EARTH_RADIUS, latin, lov);
+ }
+
+ private static ProjectedCRS createSouthPolarStereoCrs(double latin, double lov) {
+ return MapUtil.constructSouthPolarStereo(MapUtil.AWIPS_EARTH_RADIUS,
+ MapUtil.AWIPS_EARTH_RADIUS, latin, lov);
}
}
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/colormaps/Sat/Ozone/Ozone.cmap b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/colormaps/Sat/Ozone/Ozone.cmap
new file mode 100644
index 0000000000..b36ab535b3
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/colormaps/Sat/Ozone/Ozone.cmap
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/styleRules/satelliteImageryStyleRules.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/styleRules/satelliteImageryStyleRules.xml
index 8f71c3ac74..539fdcc1e5 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/styleRules/satelliteImageryStyleRules.xml
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/utility/common_static/base/styleRules/satelliteImageryStyleRules.xml
@@ -144,6 +144,21 @@
+
+
+ OZONE
+
+
+
+ 100
+ 500
+
+ Sat/Ozone/Ozone
+
+ 100 150 200 250 300 350 400 450 500
+
+
+
Sounder Based Derived Lifted Index (LI)
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java
index 5402051e08..869a1bcd3d 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java
@@ -86,6 +86,8 @@ public class McidasSatelliteDecoder {
private static final int EXPECTED_IMAGE_TYPE_LE = 4;
private static final int EXPECTED_IMAGE_TYPE_BE = 0x04000000;
+
+ private static final int RADIUS = 6371200;
private static final double HALFPI = Math.PI / 2.;
@@ -189,7 +191,8 @@ public class McidasSatelliteDecoder {
buf.getInt(); // comment cards
long bandBits = ((long) bandMap33to64 << 32) | bandMap1to32;
- if (nBands != Long.bitCount(bandBits)) {
+ long bandBitsCount = Long.bitCount(bandBits);
+ if (nBands != bandBitsCount) {
formatError("Specified number of bands does not match number of bits in band map");
}
@@ -279,34 +282,40 @@ public class McidasSatelliteDecoder {
int ulY, int nx, int ny, ByteBuffer buf) throws Exception {
SatMapCoverage result = new SatMapCoverage();
String navType = get4cc(buf);
+ int lineOfEquator = buf.getInt();
+ int elementOfEquator = buf.getInt();
+ int stdLatDDMMSS = buf.getInt();
+ int spacingAtStdLatInMeters = buf.getInt();
+ int nrmlLonDDMMSS = buf.getInt();
+
+ // NOTE: We do not check the following for compatibility with WGS84.
+ int radiusInMeters = buf.getInt();
+ /* int eccentricity = */buf.getInt();
+ /* boolean geodetic = */buf.getInt()/* >= 0 */;
+
+ boolean westPositive = buf.getInt() >= 0;
+ float la1, lo1, la2, lo2;
+ double dy;
+
+ /*
+ * The following is based on
+ * gov.noaa.nws.ncep.edex.plugin.mcidas/src
+ * /gov/noaa/nws/ncep/edex/plugin/mcidas/decoder/McidasDecoder.java
+ */
+
+ double clon = flipLon(unpackDdmmss(nrmlLonDDMMSS), westPositive);
+ double clat = unpackDdmmss(stdLatDDMMSS);
+ double dx = spacingAtStdLatInMeters * xImgRes;
+
+ double phi0r = clat * DTR;
+ double sign = 1.;
+ if (phi0r < 0.) {
+ sign = -1.;
+ }
+ double rxp = (((double) (elementOfEquator - ulX) / xImgRes) + 1.);
+ double ryp = (ny - ((double) (lineOfEquator - ulY) / yImgRes));
+
if (navType.equals("MERC")) {
- int lineOfEquator = buf.getInt();
- int elementOfEquator = buf.getInt();
- int stdLatDDMMSS = buf.getInt();
- int spacingAtStdLatInMeters = buf.getInt();
- int nrmlLonDDMMSS = buf.getInt();
-
- // NOTE: We do not check the following for compatibility with WGS84.
- int radiusInMeters = buf.getInt();
- /* int eccentricity = */buf.getInt();
- /* boolean geodetic = */buf.getInt()/* >= 0 */;
-
- boolean westPositive = buf.getInt() >= 0;
- float la1, lo1, la2, lo2;
-
- /*
- * The following is based on
- * gov.noaa.nws.ncep.edex.plugin.mcidas/src
- * /gov/noaa/nws/ncep/edex/plugin/mcidas/decoder/McidasDecoder.java
- */
-
- double clon = flipLon(unpackDdmmss(nrmlLonDDMMSS), westPositive);
- double clat = unpackDdmmss(stdLatDDMMSS);
- double dx = spacingAtStdLatInMeters * xImgRes;
-
- double phi0r = clat * DTR;
- double rxp = (((double) (elementOfEquator - ulX) / xImgRes) + 1.);
- double ryp = (ny - ((double) (lineOfEquator - ulY) / yImgRes));
double dxp = 1. - rxp;
double dyp = 1. - ryp;
@@ -326,6 +335,44 @@ public class McidasSatelliteDecoder {
result = SatSpatialFactory.getInstance().getCoverageTwoCorners(
SatSpatialFactory.PROJ_MERCATOR, nx, ny, (float) clon,
(float) clat, la1, lo1, la2, lo2);
+
+ } else if (navType.trim().equals("PS")) {
+
+ dy = (float) spacingAtStdLatInMeters * yImgRes;
+ double dxp = (1. - rxp) * dx;
+ double dyp = (1. - ryp) * dy;
+ double alpha = 1. + Math.sin(Math.abs(phi0r));
+ double rm = Math.sqrt(((dxp * dxp) + (dyp * dyp))) / alpha;
+ la1 = (float) (sign * ((HALFPI - (2. * Math.atan(rm / RADIUS)))) * RTD);
+ double thta;
+ if (dyp != 0) {
+ dyp = (-dyp) * sign;
+ thta = (Math.atan2(dxp, dyp)) * RTD;
+ lo1 = (float) prnlon((clon + thta));
+ } else {
+ lo1 = (float) clon;
+ }
+
+ /*
+ * Compute lat/lon of the upper-right corner
+ */
+ dxp = (nx - rxp) * dx;
+ dyp = (ny - ryp) * dy;
+ rm = Math.sqrt(((dxp * dxp) + (dyp * dyp))) / alpha;
+ la2 = (float) (sign * ((HALFPI - (2. * Math.atan(rm / RADIUS)))) * RTD);
+
+ if (dyp != 0) {
+ dyp = (-dyp) * sign;
+ thta = (Math.atan2(dxp, dyp)) * RTD;
+ lo2 = (float) prnlon((clon + thta));
+ } else {
+ lo2 = (float) clon;
+ }
+
+ result = SatSpatialFactory.getInstance().getCoverageTwoCorners(
+ SatSpatialFactory.PROJ_POLAR, nx, ny, (float) clon,
+ (float) clat, la1, lo1, la2, lo2);
+
} else {
unimplemented(String.format("navigation type \"%s\"", navType));
}
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/distribution/satellite.mcidas.xml b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/distribution/satellite.mcidas.xml
index 05dbabd917..0025144027 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/distribution/satellite.mcidas.xml
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/distribution/satellite.mcidas.xml
@@ -20,4 +20,5 @@
-->
AREA[0-9]{4}.*
+ .*uniwisc.*
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/areaNames.xml b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/areaNames.xml
new file mode 100644
index 0000000000..524218b46b
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/areaNames.xml
@@ -0,0 +1,83 @@
+
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/creatingEntities.xml b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/creatingEntities.xml
index ab8280d772..779512ad90 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/creatingEntities.xml
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/creatingEntities.xml
@@ -21,7 +21,36 @@
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/physicalElements.xml b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/physicalElements.xml
index 534f955dd4..69f6229194 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/physicalElements.xml
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/utility/edex_static/base/satellite/mcidas/physicalElements.xml
@@ -31,7 +31,6 @@
-
@@ -40,7 +39,50 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ />
+
+
+
+
+
+
+
+
+
+