Merge branch 'master_13.1.2' into master

'theirs merge' - took all of master_13.1.2

Conflicts:
	cave/com.raytheon.uf.viz.collaboration.pointdata/com.raytheon.uf.viz.collaboration.pointdata.ecl
	cave/com.raytheon.uf.viz.collaboration.product.feature/com.raytheon.uf.viz.collaboration.product.feature.ecl
	cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/ui/dialogs/FogZoneTableDlg.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/ProductScriptsDialog.java
	edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/GribSpatialCache.java
	edexOsgi/com.raytheon.uf.common.parameter/build.properties
	edexOsgi/com.raytheon.uf.common.spatial/build.properties
	edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/FreezingLevel.java
	ncep/gov.noaa.nws.ncep.edex.plugin.convsigmet/utility/edex_static/base/purge/convsigmetPurgeRules.xml

Former-commit-id: 20349e11b0 [formerly b656a1ed430a571fbda029479ff457bb4405efc0]
Former-commit-id: 4ff8c8967a
This commit is contained in:
Steve Harris 2013-04-03 17:17:32 -04:00
commit 6282e0fd39
9 changed files with 47 additions and 159 deletions

View file

@ -46,7 +46,6 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
*
* Jan 25, 2010 #4281 zhao Modified the notify method
* Jun 16, 2012 14386 zhao Modified the notify method
* Dec 03, 2012 15216/15639 zhao fixed a bug related to Link-to-Frame
*
* @author
*
@ -79,6 +78,7 @@ public class FogZoneTableDlg extends ZoneTableDlg {
if (zoneTable.isDisposed()) {
return;
}
// TODO: Silver Springs Guys. We now have competing ways of adding the
// data to the table.
// You need to merge the two. The way we had setup originally was to use
@ -86,6 +86,7 @@ public class FogZoneTableDlg extends ZoneTableDlg {
// You guys have this ObMultiHrsReports. Find a way that will
// incorporate both for the obs and
// The algorithm output.
if (me.getSource() instanceof FogMonitor) {
FogMonitor fog = (FogMonitor) me.getSource();
@ -93,11 +94,12 @@ public class FogZoneTableDlg extends ZoneTableDlg {
if (date != null) {
Date nominalTime = date;
ObMultiHrsReports obData = fog.getObData();
if (!isLinkedToFrame()) {
nominalTime = obData.getLatestNominalTime();
}
// if (!isLinkedToFrame()) {
// nominalTime = obData.getLatestNominalTime();
// }
FogDataGenerator fdg = new FogDataGenerator();
HashMap<String, CellType> fogAlgCellType = fdg.getAlgCellTypes(fog.getAlgorithmData(nominalTime));
HashMap<String, CellType> fogAlgCellType = fdg
.getAlgCellTypes(fog.getAlgorithmData(nominalTime));
obData.setFogAlgCellType(fogAlgCellType);
this.updateTableDlg(obData.getObHourReports(nominalTime));
}

View file

@ -45,7 +45,6 @@ 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.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.core.DataManager;
@ -66,8 +65,6 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* Mar 7, 2008 Eric Babin Initial Creation
* Oct 27, 2012 1287 rferrel Code cleanup for non-blocking dialog.
* Oct 25, 2012 1287 rferrel Code changes for non-blocking PublishDialog.
* Nov 30, 2012 15575 ryu Added variable replacement for SelectedStart,
* SelectedEnd, and home
*
* </pre>
*
@ -87,8 +84,6 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
private Map<String, String> scriptDict;
private String gfeHome;
private String prddir;
private ToggleSelectList scriptsList;
@ -108,8 +103,6 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
this.dataManager = dataManager;
gfeHome = Activator.getDefault().getPreferenceStore()
.getString("GFESUITE_HOME");
prddir = Activator.getDefault().getPreferenceStore()
.getString("GFESUITE_PRDDIR");
scripts = Activator.getDefault().getPreferenceStore()
@ -177,15 +170,6 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
.getSpatialEditorTime();
Date seEnd = new Date(seStart.getTime() + 60 * 1000);
Date selStart = new Date(0);
Date selEnd = new Date(0);
TimeRange selectedTR = dataManager.getParmOp()
.getSelectionTimeRange();
if (selectedTR != null) {
selStart = selectedTR.getStart();
selEnd = selectedTR.getEnd();
}
// The following variables are replaced by known values:
cmd = cmd.replace("{host}", hostParts[0]);
cmd = cmd.replace("{port}", hostParts[1]);
@ -193,13 +177,8 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
cmd = cmd.replace("{productDB}", productDB.toString());
cmd = cmd.replace("{SEstart}", gmtTime.format(seStart));
cmd = cmd.replace("{SEend}", gmtTime.format(seEnd));
cmd = cmd.replace("{SelectedStart}",
gmtTime.format(selStart));
cmd = cmd.replace("{SelectedEnd}",
gmtTime.format(selEnd));
cmd = cmd.replace("{time}", curLocalTime);
cmd = cmd.replace("{ztime}", curGMTTime);
cmd = cmd.replace("{home}", gfeHome);
cmd = cmd.replace("{prddir}", prddir);
// The user is prompted to enter the value with which to replace

View file

@ -76,7 +76,6 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation
* Jul 25, 2012 977 rjpeter Add ability for sub grids to have a defined center point.
* 12/04/2012 DR 15382 D. Friedman Restrict subgrid coordinates to reference grid bounds.
* </pre>
*
* @author bphillip
@ -543,10 +542,6 @@ public class GribSpatialCache {
Coordinate upperRightPosition = new Coordinate(
xCenterPoint + xDistance, yCenterPoint
- yDistance);
lowerLeftPosition.x = Math.min(Math.max(0, lowerLeftPosition.x), gridCoverage.getNx() - 1);
lowerLeftPosition.y = Math.min(Math.max(0, lowerLeftPosition.y), gridCoverage.getNy() - 1);
upperRightPosition.x = Math.min(Math.max(0, upperRightPosition.x), gridCoverage.getNx() - 1);
upperRightPosition.y = Math.min(Math.max(0, upperRightPosition.y), gridCoverage.getNy() - 1);
lowerLeftPosition = MapUtil.gridCoordinateToLatLon(
lowerLeftPosition, PixelOrientation.CENTER,

View file

@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -24,22 +24,10 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import java.util.TreeSet;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.DirectPosition2D;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.dataplugin.grib.GribRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.geospatial.ISpatialObject;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.geospatial.PointUtil;
import com.raytheon.uf.common.monitor.xml.SCANModelParameterXML;
import com.vividsolutions.jts.geom.Coordinate;
@ -84,9 +72,9 @@ public class FreezingLevel {
// reference time
Calendar refTime = null;
private transient final Log logger = LogFactory.getLog(getClass());
public FreezingLevel(String modelName) {
this.modelName = modelName;
times = new HashMap<Integer, Date>();
zeroCount = 0;
@ -108,79 +96,6 @@ public class FreezingLevel {
}
}
/**
* find (x,y) coordinate for lat,lon(coor)
* @param coors
*/
public DirectPosition2D findXYloc(Coordinate coor, String type){
ScanDataCache cache = ScanDataCache.getInstance();
ISpatialObject iso = cache.getModelData().getGribRecord(modelName, type).getSpatialObject();
CoordinateReferenceSystem crs=iso.getCrs();
GridGeometry2D mapGeometry = MapUtil.getGridGeometry(iso);
DirectPosition2D resultPoint;
try {
resultPoint = PointUtil.determineExactIndex(
coor, crs, mapGeometry);
System.out.println("Freezing level -- lat,lon:"+coor+" = "+resultPoint);
return resultPoint;
} catch (Exception e) {
System.out.println("Error: Freezing level -- unable to find x,y coordinate for lat,lon:"+coor);
e.printStackTrace();
}
return null;
}
/**
* get the bi-linear interpolation value amount the nearest 4 points
*
* @param modelName, prodType, coor
* @return bi-linear interpolation amount the nearest 4 points
* @throws VizException
*/
public double getValue(String modelName, String prodType, Coordinate coor) {
double value = -99999.0;
try {
//xyLoc is the location in x,y
DirectPosition2D xyLoc = findXYloc(coor, prodType);
//data from hdf5
ScanDataCache cache = ScanDataCache.getInstance();
GribRecord gribRec = cache.getModelData().getGribRecord(modelName, prodType);
FloatDataRecord rec = (FloatDataRecord) gribRec.getMessageData();
//dimension of the record from hdf5, recNx =151 and recNy=113 during development
int recNx = gribRec.getSpatialObject().getNx();
int recNy = gribRec.getSpatialObject().getNy();
//get four nearest points/values form the record around xyLoc
int x0=(int)(xyLoc.x);
int x1=x0+1;
int y0=(int)(xyLoc.y);
int y1=y0+1;
double p1=xyLoc.x-x0;
double p2=1-p1;
double p3=xyLoc.y-y0;
double p4=1-p3;
double value2 = rec.getFloatData()[(recNx * y0) + x0];
double value3 = rec.getFloatData()[(recNx * y0) + x1];
double value0 = rec.getFloatData()[(recNx * y1) + x0];
double value1 = rec.getFloatData()[(recNx * y1) + x1];
//do a bi-linear interpolation amount the nearest 4 points
value = (p1*p4*value1)+(p2*p4*value0)+(p1*p3*value3)+(p2*p3*value2);
logger.info("bi-linear interpolation value: "+value+" "+value0+" "+value1+
" "+value2+" "+value3+" for coor:"+coor+" "+recNx+","+recNy);
} catch (Exception e) {
logger.error("No Grib value available....." + modelName + " "
+ prodType+" lat,lon:"+coor);
e.printStackTrace();
}
return value;
}
/**
* Give me the freezing level for an array of points
*
@ -192,7 +107,6 @@ public class FreezingLevel {
HashMap<Coordinate, Float> freezingMap = new HashMap<Coordinate, Float>();
ScanDataCache cache = ScanDataCache.getInstance();
//get data from hdf5 files
for (Coordinate coor : coors) {
HashMap<Integer, Double> ghValues = new HashMap<Integer, Double>();
@ -200,46 +114,34 @@ public class FreezingLevel {
for (Entry<String, Integer> entry : getGHLevelMap().entrySet()) {
if (cache.getModelData().isType(modelName, entry.getKey())) {
ghValues.put(entry.getValue(), getValue(modelName, entry.getKey(), coor));
} else {
ghValues.put(entry.getValue(),null);
ghValues.put(entry.getValue(), cache.getModelData()
.getValue(modelName, entry.getKey(), coor));
}
}
for (Entry<String, Integer> entry : getTLevelMap().entrySet()) {
if (cache.getModelData().isType(modelName, entry.getKey())) {
tValues.put(entry.getValue(), getValue(modelName, entry.getKey(), coor));
tValues.put(entry.getValue(), cache.getModelData()
.getValue(modelName, entry.getKey(), coor));
}
}
//here's the calculation
Double fLevel = 0.0;
Double fLevel = -99999.0;
Integer jtopLevel = null;
Integer ktopLevel = null;
int foundValFlag=-1;//-1=all ghValue and tValue are null,
//0=all ghValue<=-9000 and tValue<=273.16, 1=found a fLevel
System.out
.println("********** Starting Freezing Level Calculations *****************");
TreeSet<Integer> ts= new TreeSet<Integer>(ghValues.keySet());//want an asc sorted list
Iterator<Integer> it = ts.iterator();
//for (Integer level : ghValues.keySet()) {
while (it.hasNext()) {
Integer level = (Integer) it.next();
for (Integer level : ghValues.keySet()) {
Double tValue = tValues.get(level);
Double ghValue = ghValues.get(level);
System.out.println("GH Value: " + ghValue + " TValue: "
+ tValue);
if (ghValue != null && tValue != null && foundValFlag ==-1){
foundValFlag=0;
}
if (ghValue != null && ghValue.doubleValue() > -9000) {
if (tValue != null && tValue.doubleValue() > 273.16) {
if (ghValue != null && ghValue > -9000) {
if (tValue != null && tValue > 273.16) {
fLevel = (ghValues.get(ktopLevel) - ((ghValues
.get(ktopLevel) - ghValue) * ((273.16 - tValues
@ -253,7 +155,6 @@ public class FreezingLevel {
+ " - " + tValues.get(jtopLevel)
+ ")))) * .00328");
System.out.println("*** FreezingLevel = " + fLevel);
foundValFlag=1;
freezingMap.put(coor, fLevel.floatValue());
break;
} else {
@ -262,12 +163,6 @@ public class FreezingLevel {
}
}
}
if (foundValFlag==0) {//this means all tValue are <= 273.16
freezingMap.put(coor, 0.0f);
System.out.println("*** FreezingLevel = 0.0");
}
System.out
.println("********** Finished Freezing Level Calculations *****************");
}
@ -357,7 +252,6 @@ public class FreezingLevel {
paramXML.setModelName(model);
paramXML.setParameterName(param);
String sql = getSQL(interval, model, param, refTime);
System.out.println("Freezing level sql="+sql);
GribRecord modelRec = DATUtils.getMostRecentGribRecord(interval, sql,
paramXML);
@ -467,8 +361,8 @@ public class FreezingLevel {
+ level
+ "\'"
+ " limit 1)) and reftime='"
+ refTimeStr + "' and forecasttime=0"
+ " order by reftime desc, forecasttime desc limit 1";
+ refTimeStr
+ "' order by reftime desc, forecasttime desc limit 1";
return sql;
}
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<purgeRuleSet xmlns:ns2="group">
<rule>
<id>
<pluginName>convsigmet</pluginName>
<key>default</key>
</id>
<period>02-00:00:00</period>
</rule>
</purgeRuleSet>