diff --git a/cave/com.raytheon.uf.viz.npp.crimss/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.npp.crimss/META-INF/MANIFEST.MF
index 5400bdff33..4499ecca02 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/META-INF/MANIFEST.MF
+++ b/cave/com.raytheon.uf.viz.npp.crimss/META-INF/MANIFEST.MF
@@ -5,50 +5,26 @@ Bundle-SymbolicName: com.raytheon.uf.viz.npp.crimss;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.npp.crimss.Activator
Bundle-Vendor: RAYTHEON
-Eclipse-BuddyPolicy: registered, ext, global
-Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
+Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui;bundle-version="3.6.1",
+ com.raytheon.uf.viz.core;bundle-version="1.12.1174",
+ com.raytheon.viz.ui;bundle-version="1.12.1174",
+ com.raytheon.uf.common.dataplugin.npp.crimss;bundle-version="1.0.0",
+ com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
+ com.raytheon.uf.common.time;bundle-version="1.12.1174",
+ com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
+ com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.npp;bundle-version="1.0.0",
+ com.raytheon.uf.viz.npp.sounding;bundle-version="1.0.0",
com.raytheon.uf.viz.points;bundle-version="1.0.0",
- gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0"
+ com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
+ com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
+ gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
+ com.raytheon.uf.viz.productbrowser;bundle-version="1.12.1174",
+ javax.measure;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Import-Package: com.raytheon.uf.common.dataplugin,
- com.raytheon.uf.common.dataplugin.npp.crimss,
- com.raytheon.uf.common.dataquery.requests,
- com.raytheon.uf.common.dataquery.responses,
- com.raytheon.uf.common.geospatial,
- com.raytheon.uf.common.pointdata,
- com.raytheon.uf.common.serialization,
- com.raytheon.uf.common.serialization.comm,
- com.raytheon.uf.common.status,
- com.raytheon.uf.common.time,
- com.raytheon.uf.viz.core,
- com.raytheon.uf.viz.core.drawables,
- com.raytheon.uf.viz.core.exception,
- com.raytheon.uf.viz.core.map,
- com.raytheon.uf.viz.core.maps.display,
- com.raytheon.uf.viz.core.procedures,
- com.raytheon.uf.viz.core.requests,
- com.raytheon.uf.viz.core.rsc,
- com.raytheon.uf.viz.core.rsc.capabilities,
- com.raytheon.uf.viz.d2d.core,
- com.raytheon.uf.viz.d2d.core.map,
- com.raytheon.uf.viz.d2d.nsharp.display,
- com.raytheon.uf.viz.d2d.nsharp.rsc,
- com.raytheon.uf.viz.productbrowser,
- com.raytheon.viz.core.graphing,
- com.raytheon.viz.pointdata,
- com.raytheon.viz.ui,
- com.raytheon.viz.ui.editor,
- com.raytheon.viz.ui.input,
- com.vividsolutions.jts.geom,
- gov.noaa.nws.ncep.edex.common.sounding,
- gov.noaa.nws.ncep.ui.nsharp,
- gov.noaa.nws.ncep.ui.nsharp.natives,
- javax.measure.converter,
- javax.measure.unit,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets
-Export-Package: com.raytheon.uf.viz.npp.crimss,
- com.raytheon.uf.viz.npp.crimss.map
+Export-Package: com.raytheon.uf.viz.npp.crimss
+Import-Package: gov.noaa.nws.ncep.edex.common.sounding
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/cave/com.raytheon.uf.viz.npp.crimss/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
index 5a3ce6aeeb..72dc694404 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
+++ b/cave/com.raytheon.uf.viz.npp.crimss/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
@@ -1,2 +1 @@
-com.raytheon.uf.viz.npp.crimss.CrimssNSharpResourceData
-com.raytheon.uf.viz.npp.crimss.map.CrimssMapResourceData
\ No newline at end of file
+com.raytheon.uf.viz.npp.crimss.CrimssNSharpResourceData
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/crimssMenuItems.xml b/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/crimssMenuItems.xml
index 2479336090..fbe2cabf5e 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/crimssMenuItems.xml
+++ b/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/crimssMenuItems.xml
@@ -19,10 +19,10 @@
further_licensing_information.
-->
-
-
-
+
+
+
+
-
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/index.xml b/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/index.xml
new file mode 100644
index 0000000000..bda557fff1
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.crimss/localization/menus/npp/crimss/index.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java
index 3613914da5..4ff2dfb379 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java
+++ b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java
@@ -44,7 +44,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.d2d.nsharp.display.D2DNSharpDescriptor;
import com.raytheon.uf.viz.d2d.nsharp.display.D2DNSharpDisplay;
-import com.raytheon.uf.viz.npp.crimss.map.CrimssMapResourceData;
+import com.raytheon.uf.viz.npp.sounding.rsc.NPPSoundingMapResourceData;
import com.raytheon.uf.viz.points.PointsDataManager;
import com.raytheon.uf.viz.productbrowser.AbstractRequestableProductBrowserDataDefinition;
import com.raytheon.uf.viz.productbrowser.ProductBrowserLabel;
@@ -229,7 +229,10 @@ public class CrimssDataDefinition
for (int i = 0; i < selection.length; i++) {
if (order[i].equals(POINT)) {
if (selection[i].equals(MAP_RESOURCE)) {
- resourceData = new CrimssMapResourceData();
+ NPPSoundingMapResourceData nsmrd = new NPPSoundingMapResourceData();
+ nsmrd.setNsharpResourceData(CrimssNSharpResourceData.class);
+ nsmrd.setResourceName("CrIMSS");
+ resourceData = nsmrd;
}
}
}
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssNSharpResourceData.java b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssNSharpResourceData.java
index 8993b83f32..8a0c52dc5c 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssNSharpResourceData.java
+++ b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssNSharpResourceData.java
@@ -19,15 +19,10 @@
**/
package com.raytheon.uf.viz.npp.crimss;
-import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube;
-import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube.QueryStatus;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer;
-import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile;
-import gov.noaa.nws.ncep.ui.nsharp.NsharpStationInfo;
import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpDataHandling;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -39,19 +34,12 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import com.raytheon.uf.common.dataplugin.npp.crimss.CrimssRecord;
-import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataView;
-import com.raytheon.uf.common.status.IUFStatusHandler;
-import com.raytheon.uf.common.status.UFStatus;
-import com.raytheon.uf.common.status.UFStatus.Priority;
-import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.exception.VizException;
-import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
-import com.raytheon.viz.pointdata.PointDataRequest;
-import com.vividsolutions.jts.geom.Coordinate;
+import com.raytheon.uf.viz.npp.sounding.rsc.AbstractNPPNSharpResourceData;
/**
- * TODO Add Description
+ * NSharp resource data capable of loading CrIMSS data
*
*
*
@@ -68,9 +56,7 @@ import com.vividsolutions.jts.geom.Coordinate;
*/
@XmlAccessorType(XmlAccessType.NONE)
-public class CrimssNSharpResourceData extends D2DNSharpResourceData {
- private static final transient IUFStatusHandler statusHandler = UFStatus
- .getHandler(CrimssNSharpResourceData.class);
+public class CrimssNSharpResourceData extends AbstractNPPNSharpResourceData {
private static final String PLUGIN = "crimss";
@@ -80,95 +66,28 @@ public class CrimssNSharpResourceData extends D2DNSharpResourceData {
CrimssRecord.PDV_H2O, CrimssRecord.PDV_P_H2O,
CrimssRecord.PDV_TEMPERATURE, CrimssRecord.PDV_P_TEMPERATURE };
- private static final Unit> PRESSURE_UNIT = SI.HECTO(SI.PASCAL);
-
- private static final Unit> HEIGHT_UNIT = SI.METER;
-
- private static final Unit> TEMPERATURE_UNIT = SI.CELSIUS;
-
- private static final Unit> H2O_UNIT = SI.GRAM.divide(SI.KILOGRAM);
-
- private static final Unit> DEWPOINT_UNIT = SI.CELSIUS;
-
public CrimssNSharpResourceData() {
- super("CRiMSS");
- }
-
- @Override
- protected void preparePointInfo() throws VizException {
- // everything should already be set
- return;
+ super("CrIMSS", PLUGIN, PARAMETERS);
}
/*
* (non-Javadoc)
*
- * @see
- * com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData#getSoundingCube
- * (gov.noaa.nws.ncep.ui.nsharp.NsharpStationInfo)
+ * @see com.raytheon.uf.viz.npp.sounding.rsc.AbstractNPPNSharpResourceData#
+ * getSoundingLayers(com.raytheon.uf.common.pointdata.PointDataView)
*/
@Override
- protected NcSoundingCube getSoundingCube(NsharpStationInfo stnInfo) {
- DataTime time = new DataTime(stnInfo.getReftime());
- try {
- PointDataContainer pdc = PointDataRequest
- .requestPointDataAllLevels(time, PLUGIN, PARAMETERS, null,
- getMetadataMap());
- PointDataView pdv = null;
- Coordinate closest = null;
- for (int i = 0; i < pdc.getCurrentSz(); i++) {
- PointDataView testPdv = pdc.readRandom(i);
- Coordinate p = new Coordinate(
- testPdv.getFloat(CrimssRecord.LONGITUDE),
- testPdv.getFloat(CrimssRecord.LATITUDE));
- if (closest == null
- || coordinate.distance(p) < coordinate
- .distance(closest)) {
- pdv = testPdv;
- closest = p;
- }
- }
- if (pdv == null) {
- return null;
- }
- List layers = new ArrayList();
- layers.add(getSurfacePressureLayer(pdv));
- layers.addAll(getHeightLayers(pdv));
- layers.addAll(getTemperatureLayers(pdv));
- layers.addAll(getDewpointLayers(pdv));
- Collections.sort(layers,
- NsharpDataHandling.reversePressureHeightWindComparator());
- mergeDuplicates(layers);
- // We have to interpolate everything so that height,temperature, and
- // dewpoint are available on all levels.
- interpolateHeight(layers);
- interpolateTemperature(layers);
- interpolateDewpoint(layers);
- Iterator iter = layers.iterator();
- while (iter.hasNext()) {
- NcSoundingLayer layer = iter.next();
- if (layer.getPressure() < 0) {
- iter.remove();
- } else if (layer.getGeoHeight() < 0) {
- iter.remove();
-
- } else if (layer.getTemperature() < -300) {
- iter.remove();
-
- } else if (layer.getDewpoint() < -300) {
- iter.remove();
- }
- }
- NcSoundingProfile profile = new NcSoundingProfile();
- profile.setSoundingLyLst(layers);
- // TODO populate other fields in profile
- NcSoundingCube cube = new NcSoundingCube(Arrays.asList(profile));
- cube.setRtnStatus(QueryStatus.OK);
- return cube;
- } catch (VizException e) {
- statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
- }
- return null;
+ protected List getSoundingLayers(PointDataView pdv)
+ throws VizException {
+ List layers = new ArrayList();
+ layers.add(getSurfacePressureLayer(pdv));
+ layers.addAll(getHeightLayers(pdv));
+ layers.addAll(getTemperatureLayers(pdv));
+ layers.addAll(getDewpointLayers(pdv));
+ Collections.sort(layers,
+ NsharpDataHandling.reversePressureHeightWindComparator());
+ mergeDuplicates(layers);
+ return layers;
}
private static NcSoundingLayer getSurfacePressureLayer(PointDataView pdv) {
@@ -278,7 +197,6 @@ public class CrimssNSharpResourceData extends D2DNSharpResourceData {
float pressure = pressureArray[j].floatValue();
pressure = (float) pressureConverter.convert(pressure);
float h2o = h2oArray[j].floatValue();
- h2o = (float) h2oConverter.convert(h2o);
float dpt = convertH2OtoDewpoint(h2o, pressure);
dpt = (float) dewpointConverter.convert(dpt);
NcSoundingLayer layer = new NcSoundingLayer(pressure,
@@ -292,13 +210,6 @@ public class CrimssNSharpResourceData extends D2DNSharpResourceData {
return layers;
}
- // convert h2o in g/kg and pressure in hPa to dewpoint in kelvin.
- private static float convertH2OtoDewpoint(float h2o, float pressure) {
- double eee = pressure * h2o / (622.0 + 0.378 * h2o);
- double b = 26.66082 - Math.log(eee);
- return (float) ((b - Math.sqrt(b * b - 223.1986)) / 0.0182758048);
- }
-
private static void mergeDuplicates(List layers) {
// Merge any soundings at same pressure.
Iterator iter = layers.iterator();
@@ -322,80 +233,4 @@ public class CrimssNSharpResourceData extends D2DNSharpResourceData {
}
}
- private static void interpolateHeight(List layers) {
- int belowIndex = -1;
- for (int i = 0; i < layers.size(); i++) {
- NcSoundingLayer layerAbove = layers.get(i);
- if (layerAbove.getGeoHeight() < 0) {
- continue;
- }
- if (belowIndex == -1) {
- belowIndex = i;
- continue;
- }
- NcSoundingLayer layerBelow = layers.get(belowIndex);
- double diff = layerAbove.getGeoHeight() - layerBelow.getGeoHeight();
- double pchg1 = Math.log(layerBelow.getPressure()
- / layerAbove.getPressure());
- for (int j = belowIndex + 1; j < i; j += 1) {
- NcSoundingLayer layer = layers.get(j);
- double pchg2 = Math.log(layerBelow.getPressure()
- / layer.getPressure());
- layer.setGeoHeight((float) (layerBelow.getGeoHeight() + ((pchg2 / pchg1) * diff)));
- }
- belowIndex = i;
- }
- }
-
- private static void interpolateTemperature(List layers) {
- int belowIndex = -1;
- for (int i = 0; i < layers.size(); i++) {
- NcSoundingLayer layerAbove = layers.get(i);
- if (layerAbove.getTemperature() < -300) {
- continue;
- }
- if (belowIndex == -1) {
- belowIndex = i;
- continue;
- }
- NcSoundingLayer layerBelow = layers.get(belowIndex);
- double diff = layerAbove.getTemperature()
- - layerBelow.getTemperature();
- double pchg1 = Math.log(layerBelow.getPressure()
- / layerAbove.getPressure());
- for (int j = belowIndex + 1; j < i; j += 1) {
- NcSoundingLayer layer = layers.get(j);
- double pchg2 = Math.log(layerBelow.getPressure()
- / layer.getPressure());
- layer.setTemperature((float) (layerBelow.getTemperature() + ((pchg2 / pchg1) * diff)));
- }
- belowIndex = i;
- }
- }
-
- private static void interpolateDewpoint(List layers) {
- int belowIndex = -1;
- for (int i = 0; i < layers.size(); i++) {
- NcSoundingLayer layerAbove = layers.get(i);
- if (layerAbove.getDewpoint() < -300) {
- continue;
- }
- if (belowIndex == -1) {
- belowIndex = i;
- continue;
- }
- NcSoundingLayer layerBelow = layers.get(belowIndex);
- double diff = layerAbove.getDewpoint() - layerBelow.getDewpoint();
- double pchg1 = Math.log(layerBelow.getPressure()
- / layerAbove.getPressure());
- for (int j = belowIndex + 1; j < i; j += 1) {
- NcSoundingLayer layer = layers.get(j);
- double pchg2 = Math.log(layerBelow.getPressure()
- / layer.getPressure());
- layer.setDewpoint((float) (layerBelow.getDewpoint() + ((pchg2 / pchg1) * diff)));
- }
- belowIndex = i;
- }
- }
-
}
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapResourceData.java b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapResourceData.java
deleted file mode 100644
index 450f48facb..0000000000
--- a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapResourceData.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.viz.npp.crimss.map;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-
-import com.raytheon.uf.common.dataplugin.PluginDataObject;
-import com.raytheon.uf.common.dataplugin.npp.crimss.CrimssRecord;
-import com.raytheon.uf.viz.core.exception.VizException;
-import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
-import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
-import com.raytheon.uf.viz.core.rsc.LoadProperties;
-
-/**
- * TODO Add Description
- *
- *
- *
- * SOFTWARE HISTORY
- *
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Dec 7, 2011 bsteffen Initial creation
- *
- *
- *
- * @author bsteffen
- * @version 1.0
- */
-
-@XmlAccessorType(XmlAccessType.NONE)
-public class CrimssMapResourceData extends AbstractRequestableResourceData {
-
- @Override
- protected AbstractVizResource, ?> constructResource(
- LoadProperties loadProperties, PluginDataObject[] objects)
- throws VizException {
- CrimssMapResource resource = new CrimssMapResource(this, loadProperties);
- for (PluginDataObject pdo : objects) {
- if (pdo instanceof CrimssRecord) {
- resource.addRecord((CrimssRecord) pdo);
- }
- }
- return resource;
- }
-
-}
diff --git a/cave/com.raytheon.uf.viz.npp.feature/feature.xml b/cave/com.raytheon.uf.viz.npp.feature/feature.xml
index ce92ce2d62..7fe4263141 100644
--- a/cave/com.raytheon.uf.viz.npp.feature/feature.xml
+++ b/cave/com.raytheon.uf.viz.npp.feature/feature.xml
@@ -38,14 +38,33 @@
version="0.0.0"/>
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/.classpath b/cave/com.raytheon.uf.viz.npp.nucaps/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/.project b/cave/com.raytheon.uf.viz.npp.nucaps/.project
new file mode 100644
index 0000000000..28b94b9d0b
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/.project
@@ -0,0 +1,28 @@
+
+
+ com.raytheon.uf.viz.npp.nucaps
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/.settings/org.eclipse.jdt.core.prefs b/cave/com.raytheon.uf.viz.npp.nucaps/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..d2ea87f4d7
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Jan 17 15:46:54 CST 2013
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.npp.nucaps/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..0e9809ab38
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: NUCAPS Viz Plugin
+Bundle-SymbolicName: com.raytheon.uf.viz.npp.nucaps
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.raytheon.uf.viz.npp.nucaps.Activator
+Bundle-Vendor: RAYTHEON
+Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
+Require-Bundle: org.eclipse.core.runtime,
+ com.raytheon.uf.viz.core;bundle-version="1.12.1174",
+ com.raytheon.uf.common.dataplugin.npp.nucaps;bundle-version="1.0.0",
+ com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
+ com.raytheon.uf.common.time;bundle-version="1.12.1174",
+ com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
+ com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.npp;bundle-version="1.0.0",
+ com.raytheon.uf.viz.npp.sounding;bundle-version="1.0.0",
+ com.raytheon.viz.pointdata;bundle-version="1.12.1174",
+ com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
+ gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
+ javax.measure;bundle-version="1.0.0",
+ meteolib.jni;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Import-Package: gov.noaa.nws.ncep.edex.common.sounding
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/cave/com.raytheon.uf.viz.npp.nucaps/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
new file mode 100644
index 0000000000..e637b8b243
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
@@ -0,0 +1 @@
+com.raytheon.uf.viz.npp.nucaps.NucapsNSharpResourceData
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/build.properties b/cave/com.raytheon.uf.viz.npp.nucaps/build.properties
new file mode 100644
index 0000000000..3459198753
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ localization/
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/localization/menus/npp/nucaps/index.xml b/cave/com.raytheon.uf.viz.npp.nucaps/localization/menus/npp/nucaps/index.xml
new file mode 100644
index 0000000000..4de0e544ae
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/localization/menus/npp/nucaps/index.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/localization/menus/npp/nucaps/nucapsMenuItems.xml b/cave/com.raytheon.uf.viz.npp.nucaps/localization/menus/npp/nucaps/nucapsMenuItems.xml
new file mode 100644
index 0000000000..ccba47f49f
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/localization/menus/npp/nucaps/nucapsMenuItems.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/Activator.java b/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/Activator.java
new file mode 100644
index 0000000000..20e95d22c1
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/Activator.java
@@ -0,0 +1,30 @@
+package com.raytheon.uf.viz.npp.nucaps;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/NucapsNSharpResourceData.java b/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/NucapsNSharpResourceData.java
new file mode 100644
index 0000000000..49d732e03f
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/NucapsNSharpResourceData.java
@@ -0,0 +1,141 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.npp.nucaps;
+
+import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.measure.converter.UnitConverter;
+import javax.measure.unit.SI;
+import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+import com.raytheon.edex.meteolibrary.Meteolibrary;
+import com.raytheon.uf.common.dataplugin.npp.nucaps.NucapsRecord;
+import com.raytheon.uf.common.pointdata.PointDataView;
+import com.raytheon.uf.viz.core.exception.VizException;
+import com.raytheon.uf.viz.npp.sounding.rsc.AbstractNPPNSharpResourceData;
+
+/**
+ * NSharp resource data capable of loading NUCAPS data
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 15, 2013 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class NucapsNSharpResourceData extends AbstractNPPNSharpResourceData {
+
+ private static final String PLUGIN = "nucaps";
+
+ private static final String[] PARAMETERS = { NucapsRecord.LONGITUDE,
+ NucapsRecord.LATITUDE, NucapsRecord.PDV_SURFACE_PRESSURE,
+ NucapsRecord.PDV_PRESSURE, NucapsRecord.PDV_TEMPERATURE,
+ NucapsRecord.PDV_WATER_VAPOR_MIXING_RATIO };
+
+ public NucapsNSharpResourceData() {
+ super("NUCAPS", PLUGIN, PARAMETERS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.npp.sounding.rsc.AbstractNPPNSharpResourceData#
+ * getSoundingLayers(com.raytheon.uf.common.pointdata.PointDataView)
+ */
+ @Override
+ protected List getSoundingLayers(PointDataView pdv)
+ throws VizException {
+ Number[] pressures = pdv.getNumberAllLevels(NucapsRecord.PDV_PRESSURE);
+ UnitConverter pressureConverter = getConverter(
+ pdv.getUnit(NucapsRecord.PDV_PRESSURE), PRESSURE_UNIT);
+ Number[] temperatures = pdv
+ .getNumberAllLevels(NucapsRecord.PDV_TEMPERATURE);
+ UnitConverter temperatureConverter = getConverter(
+ pdv.getUnit(NucapsRecord.PDV_TEMPERATURE), TEMPERATURE_UNIT);
+ UnitConverter temperatureCalcConverter = getConverter(
+ pdv.getUnit(NucapsRecord.PDV_TEMPERATURE),
+ TEMPERATURE_CALC_UNIT);
+ Number[] wvMixingRatios = pdv
+ .getNumberAllLevels(NucapsRecord.PDV_WATER_VAPOR_MIXING_RATIO);
+ UnitConverter wvMixingRatioConverter = getConverter(
+ pdv.getUnit(NucapsRecord.PDV_WATER_VAPOR_MIXING_RATIO),
+ H2O_UNIT);
+ UnitConverter dewPointConverter = getConverter(SI.KELVIN, SI.CELSIUS);
+
+ if (pressures.length != temperatures.length
+ || pressures.length != wvMixingRatios.length) {
+ throw new VizException("NUCAPS PointData sizes incorrect");
+ }
+ int length = pressures.length;
+
+ List soundingLayers = new ArrayList(
+ length);
+ float surfacePressure = pdv.getFloat(NucapsRecord.PDV_SURFACE_PRESSURE);
+ for (int i = 0; i < length; ++i) {
+ int idx = i;
+ float pressure = (float) pressureConverter.convert(pressures[idx]
+ .doubleValue());
+ if (pressure <= surfacePressure) {
+ // Don't add entries where pressure indicates below ground
+ float gh = Meteolibrary.ptozsa(new float[] { pressure }, 0);
+ Number temperature = temperatures[idx];
+ float h20 = (float) wvMixingRatioConverter
+ .convert(wvMixingRatios[idx].doubleValue());
+ float dewpoint = convertH2OtoDewpoint(h20, pressure);
+ float rh = convertH20ToRelativeHumidity(h20,
+ (float) temperatureCalcConverter.convert(temperature
+ .doubleValue()), pressure);
+ soundingLayers.add(new NcSoundingLayer(pressure, gh,
+ (float) temperatureConverter.convert(temperature
+ .doubleValue()), (float) dewPointConverter
+ .convert(dewpoint), NcSoundingLayer.MISSING,
+ NcSoundingLayer.MISSING, NcSoundingLayer.MISSING,
+ NcSoundingLayer.MISSING, NcSoundingLayer.MISSING, h20,
+ rh));
+ }
+ }
+
+ return soundingLayers;
+ }
+
+ private UnitConverter getConverter(Unit> fromUnit, Unit> toUnit)
+ throws VizException {
+ if (fromUnit.isCompatible(toUnit)) {
+ return fromUnit.getConverterTo(toUnit);
+ }
+ throw new VizException("Unable to convert " + fromUnit + " to "
+ + toUnit);
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/.classpath b/cave/com.raytheon.uf.viz.npp.sounding/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/.project b/cave/com.raytheon.uf.viz.npp.sounding/.project
new file mode 100644
index 0000000000..4de0b6c0d5
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/.project
@@ -0,0 +1,28 @@
+
+
+ com.raytheon.uf.viz.npp.sounding
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/.settings/org.eclipse.jdt.core.prefs b/cave/com.raytheon.uf.viz.npp.sounding/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..e51e55865e
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Jan 14 13:20:29 CST 2013
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.npp.sounding/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..95b5e702e9
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/META-INF/MANIFEST.MF
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: NPP Viz Sounding
+Bundle-SymbolicName: com.raytheon.uf.viz.npp.sounding;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.raytheon.uf.viz.npp.sounding.Activator
+Bundle-Vendor: RAYTHEON
+Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui;bundle-version="3.6.1",
+ com.raytheon.uf.common.dataplugin.npp.sounding;bundle-version="1.0.0",
+ com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
+ com.raytheon.uf.common.time;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.npp;bundle-version="1.0.0",
+ com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.core;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
+ gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
+ com.raytheon.viz.ui;bundle-version="1.12.1174",
+ com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
+ com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
+ com.raytheon.viz.pointdata;bundle-version="1.12.1174",
+ com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
+ javax.measure;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Import-Package: gov.noaa.nws.ncep.edex.common.sounding
+Export-Package: com.raytheon.uf.viz.npp.sounding.rsc
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/cave/com.raytheon.uf.viz.npp.sounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
new file mode 100644
index 0000000000..d0edc075a2
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
@@ -0,0 +1 @@
+com.raytheon.uf.viz.npp.sounding.rsc.NPPSoundingMapResourceData
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/build.properties b/cave/com.raytheon.uf.viz.npp.sounding/build.properties
new file mode 100644
index 0000000000..3459198753
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ localization/
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/localization/bundles/crimssAvailability.xml b/cave/com.raytheon.uf.viz.npp.sounding/localization/bundles/npp/soundingAvailability.xml
similarity index 80%
rename from cave/com.raytheon.uf.viz.npp.crimss/localization/bundles/crimssAvailability.xml
rename to cave/com.raytheon.uf.viz.npp.sounding/localization/bundles/npp/soundingAvailability.xml
index c45a461ad3..4b9c06d659 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/localization/bundles/crimssAvailability.xml
+++ b/cave/com.raytheon.uf.viz.npp.sounding/localization/bundles/npp/soundingAvailability.xml
@@ -24,11 +24,12 @@
-
-
+
+ ${soundingResourceData}
+ ${name;Unknown}
-
+
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/Activator.java b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/Activator.java
new file mode 100644
index 0000000000..1c8576d190
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/Activator.java
@@ -0,0 +1,41 @@
+package com.raytheon.uf.viz.npp.sounding;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.raytheon.uf.common.status.IUFStatusHandler;
+import com.raytheon.uf.common.status.UFStatus;
+
+public class Activator implements BundleActivator {
+
+ public static final IUFStatusHandler statusHandler = UFStatus
+ .getHandler(Activator.class);
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/AbstractNPPNSharpResourceData.java b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/AbstractNPPNSharpResourceData.java
new file mode 100644
index 0000000000..27ceba81ce
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/AbstractNPPNSharpResourceData.java
@@ -0,0 +1,339 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.npp.sounding.rsc;
+
+import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube;
+import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingCube.QueryStatus;
+import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer;
+import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile;
+import gov.noaa.nws.ncep.ui.nsharp.NsharpStationInfo;
+import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpDataHandling;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.measure.unit.SI;
+import javax.measure.unit.Unit;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+import com.raytheon.uf.common.dataplugin.npp.sounding.NPPSoundingRecord;
+import com.raytheon.uf.common.pointdata.PointDataContainer;
+import com.raytheon.uf.common.pointdata.PointDataView;
+import com.raytheon.uf.common.status.UFStatus.Priority;
+import com.raytheon.uf.common.time.DataTime;
+import com.raytheon.uf.common.time.DataTime.FLAG;
+import com.raytheon.uf.common.time.TimeRange;
+import com.raytheon.uf.viz.core.exception.VizException;
+import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
+import com.raytheon.uf.viz.npp.sounding.Activator;
+import com.raytheon.viz.pointdata.PointDataRequest;
+import com.vividsolutions.jts.geom.Coordinate;
+
+/**
+ * Abstract NPP Sounding resource data
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 14, 2013 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+public abstract class AbstractNPPNSharpResourceData extends
+ D2DNSharpResourceData {
+
+ public static class NPPNsharpStationInfo extends NsharpStationInfo {
+
+ private TimeRange timeRange;
+
+ public NPPNsharpStationInfo(NsharpStationInfo info, DataTime time) {
+ this.latitude = info.getLatitude();
+ this.longitude = info.getLongitude();
+ this.reftime = new Timestamp(info.getReftime().getTime());
+ if (info.getRangestarttime() != null) {
+ this.rangestarttime = new Timestamp(info.getRangestarttime()
+ .getTime());
+ }
+ this.sndType = info.getSndType();
+ this.stnDisplayInfo = info.getStnDisplayInfo();
+ this.timeLineSpList = new ArrayList(
+ info.getTimeLineSpList());
+ setDataTime(time);
+ }
+
+ public void setDataTime(DataTime time) {
+ this.reftime = new Timestamp(time.getMatchRef());
+ if (time.getUtilityFlags().contains(FLAG.PERIOD_USED)) {
+ this.timeRange = time.getValidPeriod();
+ }
+ }
+
+ public DataTime getDataTime() {
+ if (timeRange != null) {
+ return new DataTime(getReftime().getTime(), timeRange);
+ } else {
+ return new DataTime(new Date(getReftime().getTime()));
+ }
+ }
+ }
+
+ protected static final Unit> PRESSURE_UNIT = SI.HECTO(SI.PASCAL);
+
+ protected static final Unit> HEIGHT_UNIT = SI.METER;
+
+ protected static final Unit> TEMPERATURE_UNIT = SI.CELSIUS;
+
+ protected static final Unit> TEMPERATURE_CALC_UNIT = SI.KELVIN;
+
+ protected static final Unit> H2O_UNIT = SI.GRAM.divide(SI.KILOGRAM);
+
+ protected static final Unit> DEWPOINT_UNIT = SI.CELSIUS;
+
+ private final String plugin;
+
+ private final String[] parameters;
+
+ public AbstractNPPNSharpResourceData() {
+ // This constructor only exists so JAXB won't complain
+ throw new UnsupportedOperationException();
+ }
+
+ protected AbstractNPPNSharpResourceData(String name, String plugin,
+ String[] parameters) {
+ super(name);
+ this.plugin = plugin;
+ this.parameters = parameters;
+ }
+
+ @Override
+ protected void preparePointInfo() throws VizException {
+ // everything should already be set
+ return;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData#createStationInfo
+ * (com.raytheon.uf.common.time.DataTime)
+ */
+ @Override
+ protected NsharpStationInfo createStationInfo(DataTime time) {
+ return new NPPNsharpStationInfo(super.createStationInfo(time), time);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData#getSoundingCube
+ * (gov.noaa.nws.ncep.ui.nsharp.NsharpStationInfo)
+ */
+ @Override
+ protected NcSoundingCube getSoundingCube(NsharpStationInfo stnInfo) {
+ DataTime time = new DataTime(stnInfo.getReftime());
+ if (stnInfo instanceof NPPNsharpStationInfo) {
+ time = ((NPPNsharpStationInfo) stnInfo).getDataTime();
+ }
+ try {
+ PointDataContainer pdc = PointDataRequest
+ .requestPointDataAllLevels(time, plugin, parameters, null,
+ getMetadataMap());
+ PointDataView pdv = null;
+ Coordinate closest = null;
+ for (int i = 0; i < pdc.getCurrentSz(); i++) {
+ PointDataView testPdv = pdc.readRandom(i);
+ Coordinate p = new Coordinate(
+ testPdv.getFloat(NPPSoundingRecord.LONGITUDE),
+ testPdv.getFloat(NPPSoundingRecord.LATITUDE));
+ if (closest == null
+ || coordinate.distance(p) < coordinate
+ .distance(closest)) {
+ pdv = testPdv;
+ closest = p;
+ }
+ }
+ if (pdv == null) {
+ return null;
+ }
+
+ List layers = getSoundingLayers(pdv);
+ Collections.sort(layers,
+ NsharpDataHandling.reversePressureHeightWindComparator());
+
+ // We have to interpolate everything so that height,temperature, and
+ // dewpoint are available on all levels.
+ interpolateHeight(layers);
+ interpolateTemperature(layers);
+ interpolateDewpoint(layers);
+ Iterator iter = layers.iterator();
+ while (iter.hasNext()) {
+ NcSoundingLayer layer = iter.next();
+ if (layer.getPressure() < 0) {
+ iter.remove();
+ } else if (layer.getGeoHeight() < 0) {
+ // TODO: Needed?
+ // iter.remove();
+ } else if (layer.getTemperature() < -300) {
+ iter.remove();
+
+ } else if (layer.getDewpoint() < -300) {
+ iter.remove();
+ }
+ }
+ NcSoundingProfile profile = new NcSoundingProfile();
+ profile.setSoundingLyLst(layers);
+ // TODO populate other fields in profile
+ NcSoundingCube cube = new NcSoundingCube(Arrays.asList(profile));
+ cube.setRtnStatus(QueryStatus.OK);
+ return cube;
+ } catch (VizException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ return null;
+ }
+
+ /**
+ * @param pdv
+ * @return
+ */
+ protected abstract List getSoundingLayers(PointDataView pdv)
+ throws VizException;
+
+ private static void interpolateHeight(List layers) {
+ int belowIndex = -1;
+ for (int i = 0; i < layers.size(); i++) {
+ NcSoundingLayer layerAbove = layers.get(i);
+ if (layerAbove.getGeoHeight() < 0) {
+ continue;
+ }
+ if (belowIndex == -1) {
+ belowIndex = i;
+ continue;
+ }
+ NcSoundingLayer layerBelow = layers.get(belowIndex);
+ double diff = layerAbove.getGeoHeight() - layerBelow.getGeoHeight();
+ double pchg1 = Math.log(layerBelow.getPressure()
+ / layerAbove.getPressure());
+ for (int j = belowIndex + 1; j < i; j += 1) {
+ NcSoundingLayer layer = layers.get(j);
+ double pchg2 = Math.log(layerBelow.getPressure()
+ / layer.getPressure());
+ layer.setGeoHeight((float) (layerBelow.getGeoHeight() + ((pchg2 / pchg1) * diff)));
+ }
+ belowIndex = i;
+ }
+ }
+
+ private static void interpolateTemperature(List layers) {
+ int belowIndex = -1;
+ for (int i = 0; i < layers.size(); i++) {
+ NcSoundingLayer layerAbove = layers.get(i);
+ if (layerAbove.getTemperature() < -300) {
+ continue;
+ }
+ if (belowIndex == -1) {
+ belowIndex = i;
+ continue;
+ }
+ NcSoundingLayer layerBelow = layers.get(belowIndex);
+ double diff = layerAbove.getTemperature()
+ - layerBelow.getTemperature();
+ double pchg1 = Math.log(layerBelow.getPressure()
+ / layerAbove.getPressure());
+ for (int j = belowIndex + 1; j < i; j += 1) {
+ NcSoundingLayer layer = layers.get(j);
+ double pchg2 = Math.log(layerBelow.getPressure()
+ / layer.getPressure());
+ layer.setTemperature((float) (layerBelow.getTemperature() + ((pchg2 / pchg1) * diff)));
+ }
+ belowIndex = i;
+ }
+ }
+
+ private static void interpolateDewpoint(List layers) {
+ int belowIndex = -1;
+ for (int i = 0; i < layers.size(); i++) {
+ NcSoundingLayer layerAbove = layers.get(i);
+ if (layerAbove.getDewpoint() < -300) {
+ continue;
+ }
+ if (belowIndex == -1) {
+ belowIndex = i;
+ continue;
+ }
+ NcSoundingLayer layerBelow = layers.get(belowIndex);
+ double diff = layerAbove.getDewpoint() - layerBelow.getDewpoint();
+ double pchg1 = Math.log(layerBelow.getPressure()
+ / layerAbove.getPressure());
+ for (int j = belowIndex + 1; j < i; j += 1) {
+ NcSoundingLayer layer = layers.get(j);
+ double pchg2 = Math.log(layerBelow.getPressure()
+ / layer.getPressure());
+ layer.setDewpoint((float) (layerBelow.getDewpoint() + ((pchg2 / pchg1) * diff)));
+ }
+ belowIndex = i;
+ }
+ }
+
+ // convert h2o in g/kg and pressure in hPa to dewpoint in kelvin.
+ protected static float convertH2OtoDewpoint(float h2o, float pressure) {
+ double eee = pressure * h2o / (622.0 + 0.378 * h2o);
+ double b = 26.66082 - Math.log(eee);
+ return (float) ((b - Math.sqrt(b * b - 223.1986)) / 0.0182758048);
+ }
+
+ // convert h2o in g/kg and pressure in hPa to relative humidity.
+ protected static float convertH20ToRelativeHumidity(float h20,
+ float temperature, float pressure) {
+ double a = 22.05565;
+ double b = 0.0091379024;
+ double c = 6106.396;
+ double epsilonx1k = 622.0;
+
+ double shxDenom = h20 * 0.378;
+ shxDenom += epsilonx1k;
+
+ double tDenom = -b * temperature;
+ tDenom += a;
+ tDenom -= c / temperature;
+
+ double RH = pressure * h20;
+ RH /= shxDenom;
+ RH /= Math.exp(tDenom);
+
+ return (float) RH;
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapInputManager.java b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapInputHandler.java
similarity index 86%
rename from cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapInputManager.java
rename to cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapInputHandler.java
index a568b1b75c..73943bfe20 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapInputManager.java
+++ b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapInputHandler.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.viz.npp.crimss.map;
+package com.raytheon.uf.viz.npp.sounding.rsc;
import java.util.Collection;
@@ -28,14 +28,14 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPart;
-import com.raytheon.uf.common.dataplugin.npp.crimss.CrimssRecord;
+import com.raytheon.uf.common.dataplugin.npp.sounding.NPPSoundingRecord;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.viz.ui.VizWorkbenchManager;
import com.raytheon.viz.ui.input.InputAdapter;
import com.vividsolutions.jts.geom.Coordinate;
/**
- * Input manager for the CrimssMapResource
+ * Input handler for npp sounding availability resource
*
*
*
@@ -43,7 +43,7 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Jan 9, 2012 mschenke Initial creation
+ * Jan 14, 2013 mschenke Initial creation
*
*
*
@@ -51,28 +51,24 @@ import com.vividsolutions.jts.geom.Coordinate;
* @version 1.0
*/
-public class CrimssMapInputManager extends InputAdapter {
+public class NPPSoundingMapInputHandler extends InputAdapter {
+
+ private NPPSoundingMapResource resource;
private Cursor handCursor;
- private Cursor arrowCursor;
-
- private CrimssMapResource resource;
-
- private CrimssRecord closestRecord;
+ private NPPSoundingRecord closestRecord;
private int downX, downY;
- public CrimssMapInputManager(CrimssMapResource resource) {
+ public NPPSoundingMapInputHandler(NPPSoundingMapResource resource) {
this.resource = resource;
Display display = Display.getCurrent();
handCursor = new Cursor(display, SWT.CURSOR_HAND);
- arrowCursor = new Cursor(display, SWT.CURSOR_ARROW);
}
public void dispose() {
handCursor.dispose();
- arrowCursor.dispose();
}
/*
@@ -86,12 +82,13 @@ public class CrimssMapInputManager extends InputAdapter {
closestRecord = null;
if (resource.isEditable()) {
- Collection records = resource.getCurrentRecords();
+ Collection records = resource
+ .getCurrentRecords();
if (records != null) {
double radius = resource.getRadius();
Coordinate c = new Coordinate(x, y);
double bestDist = Double.MAX_VALUE;
- for (CrimssRecord record : records) {
+ for (NPPSoundingRecord record : records) {
double lat = record.getLatitude();
double lon = record.getLongitude();
double[] pixel = resource.getResourceContainer()
@@ -107,7 +104,7 @@ public class CrimssMapInputManager extends InputAdapter {
}
if (wasClosest && closestRecord == null) {
- getShell().setCursor(arrowCursor);
+ getShell().setCursor(null);
} else if (!wasClosest && closestRecord != null) {
getShell().setCursor(handCursor);
}
@@ -159,7 +156,7 @@ public class CrimssMapInputManager extends InputAdapter {
@Override
public boolean handleMouseExit(Event event) {
closestRecord = null;
- getShell().setCursor(arrowCursor);
+ getShell().setCursor(null);
return super.handleMouseExit(event);
}
diff --git a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapResource.java b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapResource.java
similarity index 66%
rename from cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapResource.java
rename to cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapResource.java
index ee7def0588..5ee95acf88 100644
--- a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/map/CrimssMapResource.java
+++ b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapResource.java
@@ -17,26 +17,25 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.viz.npp.crimss.map;
+package com.raytheon.uf.viz.npp.sounding.rsc;
+import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDescriptor;
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDisplay;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
-import com.raytheon.uf.common.dataplugin.npp.crimss.CrimssRecord;
+import com.raytheon.uf.common.dataplugin.npp.sounding.NPPSoundingRecord;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
-import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.DrawableCircle;
@@ -53,7 +52,6 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
-import com.raytheon.uf.viz.npp.crimss.CrimssNSharpResourceData;
import com.raytheon.viz.ui.BundleProductLoader;
import com.raytheon.viz.ui.UiUtil;
import com.raytheon.viz.ui.editor.AbstractEditor;
@@ -61,7 +59,7 @@ import com.raytheon.viz.ui.input.EditableManager;
import com.vividsolutions.jts.geom.Coordinate;
/**
- * TODO Add Description
+ * Sounding available resource. Draws points on map where data is available
*
*
*
@@ -69,66 +67,72 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Dec 7, 2011 bsteffen Initial creation
+ * Jan 14, 2013 mschenke Initial creation
*
*
*
- * @author bsteffen
+ * @author mschenke
* @version 1.0
*/
-public class CrimssMapResource extends
- AbstractVizResource {
+public class NPPSoundingMapResource extends
+ AbstractVizResource {
- private CrimssMapInputManager inputManager;
+ private NPPSoundingMapInputHandler inputManager;
- private Map> records = new HashMap>();
+ private Collection allRecords = new ArrayList();
- protected CrimssMapResource(CrimssMapResourceData resourceData,
+ private Map> groupedRecords = new HashMap>();
+
+ /**
+ * @param resourceData
+ * @param loadProperties
+ */
+ protected NPPSoundingMapResource(NPPSoundingMapResourceData resourceData,
LoadProperties loadProperties) {
super(resourceData, loadProperties);
- this.inputManager = new CrimssMapInputManager(this);
+ this.inputManager = new NPPSoundingMapInputHandler(this);
this.dataTimes = new ArrayList();
getCapability(EditableCapability.class).setEditable(true);
resourceData.addChangeListener(new IResourceDataChanged() {
-
@Override
public void resourceChanged(ChangeType type, Object object) {
if (type == ChangeType.DATA_UPDATE) {
if (object instanceof PluginDataObject[]) {
- for (PluginDataObject pdo : (PluginDataObject[]) object) {
- addRecord((CrimssRecord) pdo);
- }
+ addRecords((PluginDataObject[]) object);
}
}
}
});
}
- Collection getCurrentRecords() {
- return records.get(descriptor.getTimeForResource(this));
+ Collection getCurrentRecords() {
+ return groupedRecords.get(descriptor.getTimeForResource(this));
}
- public void addRecord(CrimssRecord record) {
- DataTime time = record.getDataTime();
- BinOffset binOffset = resourceData.getBinOffset();
- if (binOffset != null) {
- time = binOffset.getNormalizedTime(time);
+ public synchronized void addRecords(PluginDataObject... records) {
+ for (PluginDataObject record : records) {
+ if (record instanceof NPPSoundingRecord) {
+ if (allRecords.contains(record) == false) {
+ allRecords.add((NPPSoundingRecord) record);
+ }
+ }
}
- Set pdos = this.records.get(time);
- if (pdos == null) {
- pdos = new HashSet();
- this.records.put(time, pdos);
- }
- if (!this.dataTimes.contains(time)) {
- this.dataTimes.add(time);
- }
- pdos.add(record);
+ Map> groupedRecords = resourceData
+ .groupRecordTimes(allRecords);
+ List dataTimes = new ArrayList(
+ groupedRecords.keySet());
+ Collections.sort(dataTimes);
+ this.dataTimes = dataTimes;
+ this.groupedRecords = groupedRecords;
}
@Override
- public void remove(DataTime dataTime) {
- records.remove(dataTime);
+ public synchronized void remove(DataTime dataTime) {
+ Collection records = groupedRecords.remove(dataTime);
+ if (records != null) {
+ allRecords.removeAll(records);
+ }
super.remove(dataTime);
}
@@ -145,20 +149,21 @@ public class CrimssMapResource extends
if (time == null) {
return;
}
- Set records = this.records.get(time);
+ Collection records = this.groupedRecords.get(time);
if (records == null) {
return;
}
RGB color = getCapability(ColorableCapability.class).getColor();
List circles = new ArrayList(
records.size());
- for (CrimssRecord record : records) {
+ for (NPPSoundingRecord record : records) {
double lat = record.getLatitude();
double lon = record.getLongitude();
double[] pixel = descriptor.worldToPixel(new double[] { lon, lat });
DrawableCircle circle = new DrawableCircle();
circle.setCoordinates(pixel[0], pixel[1]);
- circle.screenRadius = getRadius() - 1;
+ circle.screenRadius = getRadius();
+ circle.numberOfPoints = (int) (circle.screenRadius * 4);
circle.basics.color = color;
circle.filled = true;
circles.add(circle);
@@ -183,11 +188,20 @@ public class CrimssMapResource extends
}
double getRadius() {
- return 8 * getCapability(MagnificationCapability.class)
+ return 5 * getCapability(MagnificationCapability.class)
.getMagnification();
}
- void loadSoundingResource(CrimssRecord record) {
+ @Override
+ public String getName() {
+ return resourceData.getResourceName() + " Availability";
+ }
+
+ /**
+ * @param closestRecord
+ */
+ void loadSoundingResource(NPPSoundingRecord record) {
+ // Build metadata map for sounding resource
HashMap metadataMap = new HashMap(
resourceData.getMetadataMap());
RequestConstraint rc = new RequestConstraint(null,
@@ -195,22 +209,24 @@ public class CrimssMapResource extends
rc.setBetweenValueList(new String[] {
String.valueOf(record.getLongitude() - 0.01),
String.valueOf(record.getLongitude() + 0.01) });
- metadataMap.put(CrimssRecord.LONGITUDE, rc);
+ metadataMap.put(NPPSoundingRecord.LONGITUDE, rc);
rc = new RequestConstraint(null, ConstraintType.BETWEEN);
rc.setBetweenValueList(new String[] {
String.valueOf(record.getLatitude() - 0.01),
String.valueOf(record.getLatitude() + 0.01) });
- metadataMap.put(CrimssRecord.LATITUDE, rc);
- CrimssNSharpResourceData resourceData = new CrimssNSharpResourceData();
- resourceData.setCoordinate(new Coordinate(record.getLongitude(), record
- .getLatitude()));
- resourceData.setPointName(String.format("CrIMSS-%.2f,%.2f",
- record.getLongitude(), record.getLatitude()));
- resourceData.setMetadataMap(metadataMap);
+ metadataMap.put(NPPSoundingRecord.LATITUDE, rc);
+
+ // Construct nsharp resource data for loading
+ AbstractNPPNSharpResourceData nsResourceData = resourceData
+ .newNsharpResourceData();
+ nsResourceData.setCoordinate(new Coordinate(record.getLongitude(),
+ record.getLatitude()));
+ nsResourceData.setMetadataMap(metadataMap);
ResourcePair pair = new ResourcePair();
- pair.setResourceData(resourceData);
+ pair.setResourceData(nsResourceData);
pair.setLoadProperties(new LoadProperties());
NsharpSkewTPaneDisplay display = new NsharpSkewTPaneDisplay();
+ display.setDescriptor(new NsharpSkewTPaneDescriptor());
display.getDescriptor().getResourceList().add(pair);
String editorId = DescriptorMap.getEditorId(display.getDescriptor()
.getClass().getName());
@@ -221,10 +237,4 @@ public class CrimssMapResource extends
Job j = new BundleProductLoader(editor, b);
j.schedule();
}
-
- @Override
- public String getName() {
- return "CrIMSS Availability";
- }
-
}
diff --git a/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapResourceData.java b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapResourceData.java
new file mode 100644
index 0000000000..64052aba8e
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.sounding/src/com/raytheon/uf/viz/npp/sounding/rsc/NPPSoundingMapResourceData.java
@@ -0,0 +1,161 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.npp.sounding.rsc;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.raytheon.uf.common.dataplugin.PluginDataObject;
+import com.raytheon.uf.viz.core.exception.VizException;
+import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.LoadProperties;
+import com.raytheon.uf.viz.npp.AbstractNppResourceData;
+
+/**
+ * Resource data for availability map of npp soundings
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 14, 2013 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+public class NPPSoundingMapResourceData extends AbstractNppResourceData {
+
+ @XmlElement
+ private Class extends AbstractNPPNSharpResourceData> nsharpResourceData;
+
+ @XmlElement
+ private String resourceName;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData#
+ * constructResource(com.raytheon.uf.viz.core.rsc.LoadProperties,
+ * com.raytheon.uf.viz.core.rsc.PluginDataObject[])
+ */
+ @Override
+ protected AbstractVizResource, ?> constructResource(
+ LoadProperties loadProperties, PluginDataObject[] objects)
+ throws VizException {
+ NPPSoundingMapResource resource = new NPPSoundingMapResource(this,
+ loadProperties);
+ if (objects instanceof PluginDataObject[]) {
+ resource.addRecords((PluginDataObject[]) objects);
+ }
+ return resource;
+ }
+
+ /**
+ * @return the nsharpResourceData
+ */
+ public Class extends AbstractNPPNSharpResourceData> getNsharpResourceData() {
+ return nsharpResourceData;
+ }
+
+ /**
+ * @param nsharpResourceData
+ * the nsharpResourceData to set
+ */
+ public void setNsharpResourceData(
+ Class extends AbstractNPPNSharpResourceData> nsharpResourceData) {
+ this.nsharpResourceData = nsharpResourceData;
+ }
+
+ /**
+ * @return the resourceName
+ */
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ /**
+ * @param resourceName
+ * the resourceName to set
+ */
+ public void setResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ }
+
+ public AbstractNPPNSharpResourceData newNsharpResourceData() {
+ try {
+ return getNsharpResourceData().newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException("Unable to create new instance of: "
+ + getNsharpResourceData());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime
+ * result
+ + ((nsharpResourceData == null) ? 0 : nsharpResourceData
+ .hashCode());
+ result = prime * result
+ + ((resourceName == null) ? 0 : resourceName.hashCode());
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ NPPSoundingMapResourceData other = (NPPSoundingMapResourceData) obj;
+ if (nsharpResourceData == null) {
+ if (other.nsharpResourceData != null)
+ return false;
+ } else if (!nsharpResourceData.equals(other.nsharpResourceData))
+ return false;
+ if (resourceName == null) {
+ if (other.resourceName != null)
+ return false;
+ } else if (!resourceName.equals(other.resourceName))
+ return false;
+ return true;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF
index 133bab7321..c1559813f8 100644
--- a/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF
+++ b/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF
@@ -24,6 +24,7 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.derivparam;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
- com.raytheon.viz.alerts;bundle-version="1.12.1174"
+ com.raytheon.viz.alerts;bundle-version="1.12.1174",
+ com.raytheon.uf.viz.npp;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/index.xml b/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/index.xml
new file mode 100644
index 0000000000..6435ca8625
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/index.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsMenuItems.xml b/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsMenuItems.xml
index a8363df496..46f9eb1fbf 100644
--- a/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsMenuItems.xml
+++ b/cave/com.raytheon.uf.viz.npp.viirs/localization/menus/npp/viirs/viirsMenuItems.xml
@@ -19,7 +19,6 @@
further_licensing_information.
-->
-
@@ -36,5 +35,4 @@
-
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSDataCallback.java b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSDataCallback.java
index 7d07cd90ae..cdc19ba769 100644
--- a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSDataCallback.java
+++ b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSDataCallback.java
@@ -25,6 +25,7 @@ import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
import com.raytheon.uf.common.colormap.image.ColorMapData;
+import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
import com.raytheon.uf.common.dataplugin.npp.viirs.VIIRSDataRecord;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
@@ -88,13 +89,13 @@ public class VIIRSDataCallback implements IColorMapDataRetrievalCallback {
return new ColorMapData(shortData, new int[] {
(int) rawData.getSizes()[0],
(int) rawData.getSizes()[1] },
- ColorMapData.ColorMapDataType.UNSIGNED_SHORT);
+ ColorMapDataType.UNSIGNED_SHORT);
} else if (rawData instanceof FloatDataRecord) {
Buffer floatData = FloatBuffer.wrap(((FloatDataRecord) rawData)
.getFloatData());
return new ColorMapData(floatData, new int[] {
(int) rawData.getSizes()[0],
- (int) rawData.getSizes()[1] }, ColorMapData.ColorMapDataType.FLOAT);
+ (int) rawData.getSizes()[1] }, ColorMapDataType.FLOAT);
} else {
throw new VizException("Could not handle IDataRecord: "
+ rawData);
diff --git a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResourceData.java b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResourceData.java
index 6ab2837909..ffec943e58 100644
--- a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResourceData.java
+++ b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResourceData.java
@@ -19,33 +19,18 @@
**/
package com.raytheon.uf.viz.npp.viirs.rsc;
-import java.util.ArrayDeque;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
-import java.util.Queue;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.npp.viirs.VIIRSDataRecord;
-import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
-import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
-import com.raytheon.uf.common.time.DataTime;
-import com.raytheon.uf.common.time.TimeRange;
-import com.raytheon.uf.viz.core.catalog.LayerProperty;
-import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
import com.raytheon.uf.viz.core.exception.VizException;
-import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
+import com.raytheon.uf.viz.npp.AbstractNppResourceData;
/**
* VIIRS Resource data
@@ -66,38 +51,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
-public class VIIRSResourceData extends AbstractRequestableResourceData {
-
- private static class DataTimeIterator
- implements Iterator {
-
- private Iterator pdoIter;
-
- private T lastAccesed;
-
- private DataTimeIterator(Iterator pdoIter) {
- this.pdoIter = pdoIter;
- }
-
- @Override
- public boolean hasNext() {
- return pdoIter.hasNext();
- }
-
- @Override
- public DataTime next() {
- lastAccesed = pdoIter.next();
- return lastAccesed.getDataTime();
- }
-
- @Override
- public void remove() {
- pdoIter.remove();
- }
- }
-
- @XmlElement
- private int groupTimeRangeMinutes = 3;
+public class VIIRSResourceData extends AbstractNppResourceData {
/*
* (non-Javadoc)
@@ -119,176 +73,4 @@ public class VIIRSResourceData extends AbstractRequestableResourceData {
return new VIIRSResource(this, loadProperties, viirsRecords);
}
- /*
- * (non-Javadoc)
- *
- * @see com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData#
- * requestPluginDataObjects(java.util.Collection)
- */
- @Override
- protected PluginDataObject[] requestPluginDataObjects(
- Collection loadSet) throws VizException {
- List timesToLoad = new ArrayList(loadSet);
- Collections.sort(timesToLoad);
- DataTime first = timesToLoad.get(0);
- DataTime last = timesToLoad.get(timesToLoad.size() - 1);
- Map requestMap = new HashMap(
- getMetadataMap());
- RequestConstraint timeConst = new RequestConstraint();
- timeConst.setConstraintType(ConstraintType.BETWEEN);
- timeConst.setBetweenValueList(new String[] {
- new DataTime(first.getValidPeriod().getStart()).toString(),
- new DataTime(last.getValidPeriod().getEnd()).toString() });
- requestMap.put("dataTime.refTime", timeConst);
-
- LayerProperty property = new LayerProperty();
- property.setEntryQueryParameters(requestMap, false);
- property.setNumberOfImages(9999);
-
- List