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 @@ + + + + 7101Arctic + 1000Antarctica + 2000Antarctica + 3000Antarctica + 10GOES-Sounder + 11GOES-Sounder + 12GOES-Sounder + 13GOES-Sounder + 14GOES-Sounder + 15GOES-Sounder + 1174GOES-West + 1175GOES-West + 1176GOES-West + 1177GOES-West + 1178GOES-West + 1179GOES-West + 1214GOES-West + 1215GOES-West + 1216GOES-West + 1217GOES-West + 1218GOES-West + 1219GOES-West + 1244GOES-West + 1245GOES-West + 1246GOES-West + 1247GOES-West + 1248GOES-West + 1249GOES-West + 1274GOES-East + 1275GOES-East + 1276GOES-East + 1277GOES-East + 1278GOES-East + 1279GOES-East + 1344GOES-East + 1345GOES-East + 1346GOES-East + 1347GOES-East + 1348GOES-East + 1349GOES-East + 1444GOES-East + 1445GOES-East + 1446GOES-East + 1447GOES-East + 1448GOES-East + 1449GOES-East + 1474GOES-East + 1475GOES-East + 1476GOES-East + 1477GOES-East + 1478GOES-East + 1479GOES-East + 1514GOES-East + 1515GOES-East + 1516GOES-East + 1518GOES-East + 1519GOES-East + 1814GOES-West + 1815GOES-West + 1816GOES-West + 1817GOES-West + 1818GOES-West + 1819GOES-West + 1844GOES-West + 1845GOES-West + 1846GOES-West + 1847GOES-West + 1848GOES-West + 1849GOES-West + 3100Global + 3101Global + 601Mollweide + 701Mollweide + 9050GOES-East-West + 9053GOES-East-West + 9056GOES-East-West + 9059GOES-East-West + 9062GOES-East-West + + \ 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 @@ - 84MTSAT-1R - 85MTSAT-2 + 9Global + 10SOUNDER + 12GMS + 13GMS + 30GOES6 + 31GOES6 + 32GOES7 + 33GOES7 + 35FYC + 36FYC + 51METEOSAT8 + 52METEOSAT9 + 53METEOSAT10 + 54METEOSAT3 + 56METEOSAT5 + 57METEOSAT6 + 58METEOSAT7 + 70GOES8 + 71SOUNDER + 74GOES10 + 76GOES11 + 77DPD + 78GOES12 + 83GMS + 84MTS + 85MTSAT2 + 180GOES13 + 184GOES15 + 185SOUNDER + 401ARCTIC + 72ANTARCTICA 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 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /> + + + + + + + + + +