12.8.1-10 baseline

Former-commit-id: 7c799ab7b99993c77b6568529b46aaf13d01300b
This commit is contained in:
Steve Harris 2012-08-06 09:34:26 -05:00
parent fd2abfb6f1
commit b5e8fee24d
10 changed files with 225 additions and 136 deletions

View file

@ -126,7 +126,7 @@ fields.</i>
</p>
<hr width="100%">
<h2><a name="Testing"></a>Testing Your Own localWxConfig.py File</h2>
The recommended way to test your localConfigWx.py file is to start EDEX
The recommended way to test your localWxConfig.py file is to start EDEX
while running a tail command on the /awips2/edex/logs/edex-request-<i>date</i>.log.
If no exceptions result from the changes, you should be fine to proceed into GFE for
further testing.

View file

@ -271,7 +271,7 @@ public class GageTableDlg extends JFrame {
setLocation(xCoord - (bounds.width / 2), yCoord - (bounds.height / 2));
setVisible(true);
tableModel.refreshTable();
// tableModel.refreshTable();
displayManager.setGageTableDlgReference(this);
}
@ -766,7 +766,8 @@ public class GageTableDlg extends JFrame {
GageTableSettings settings = null;
if (f.exists()) {
settings = JAXB.unmarshal(path, GageTableSettings.class);
// settings = JAXB.unmarshal(path, GageTableSettings.class);
settings = JAXB.unmarshal(f, GageTableSettings.class);
} else {
settings = getDefaultSettings();
}
@ -816,7 +817,7 @@ public class GageTableDlg extends JFrame {
dataManager.setColumnDataList(columnDataList);
dataManager.setColumnWidthMap(columnWidthMap);
} catch (Exception e) {
// e.printStackTrace();
e.printStackTrace();
System.out.println("MPE Settings file not found");
}
}

View file

@ -118,6 +118,8 @@ import com.vividsolutions.jts.geom.Polygon;
* Apr 16, 2012 #14515 Qinglu Lin Added return at the beginning of changeTemplate()
* if the newly selected product is same as current one.
* Jul 10, 2012 #15099 Qinglu Lin Add updatePolygon() and apply it in xxxSelected methods.
* Jul 26, 2012 #15227 Qinglu Lin Added removeDuplicateVertices(), removeOverlaidSegments(),
* adjustLatLon(), etc.
*
* </pre>
*
@ -150,6 +152,9 @@ public class WarngenDialog extends CaveSWTDialog implements
/** "Cancel" button text */
private static final String CLOSE_BUTTON_LABEL = "Close";
private static final double MIN_LATLON_DIFF = 1.0E-5;
private static final double MIN_DIFF = 1.0E-8;
private ArrayList<String> mainProducts;
private Map<String, String> otherProducts;
@ -2093,13 +2098,42 @@ public class WarngenDialog extends CaveSWTDialog implements
*/
private boolean updatePolygon(AbstractWarningRecord oldWarning) {
Geometry geo = oldWarning.getGeometry();
Coordinate[] coords = geo.getCoordinates();
java.util.List<Coordinate> points = new ArrayList<Coordinate>(Arrays.asList(coords));
Coordinate[] coords0 = geo.getCoordinates();
GeometryFactory gf = new GeometryFactory();
PolygonUtil.truncate(points, 2);
// Duplicate vertices (BOX.SV.W.0049, July 2012) makes removeOverlaidSegments
// not working. So, remove the duplicate vertex first.
Coordinate[] coords = removeDuplicateVertices(coords0);
if (coords.length != coords0.length) {
java.util.List<Coordinate> points = new ArrayList<Coordinate>(Arrays.asList(coords));
Polygon rval = gf.createPolygon(gf.createLinearRing(points
.toArray(new Coordinate[points.size()])), null);
oldWarning.setGeometry(rval);
}
int size = coords.length;
boolean adjusted = false;
if (size > 3) {
Coordinate[] coords2 = new Coordinate[size+3];
for (int i=0; i<size; i++) {
coords2[i] = coords[i];
}
coords2[size] = coords[1];
coords2[size+1] = coords[2];
coords2[size+2] = coords[3];
adjusted = removeOverlaidSegments(coords2);
coords = Arrays.copyOf(coords2,size);
coords[0] = coords2[size-1];
}
java.util.List<Coordinate> points = new ArrayList<Coordinate>(Arrays.asList(coords));
Polygon rval = gf.createPolygon(gf.createLinearRing(points
.toArray(new Coordinate[points.size()])), null);
if (adjusted)
oldWarning.setGeometry(rval);
boolean invalidPolyFlag = false;
if (rval.isValid() == false) {
@ -2116,4 +2150,148 @@ public class WarngenDialog extends CaveSWTDialog implements
}
return false;
}
/**
* Remove duplicate vertices
*/
private Coordinate[] removeDuplicateVertices(Coordinate[] coords) {
int size = coords.length;
java.util.List<Coordinate> coords2 = new ArrayList<Coordinate>();
coords2.add(coords[0]);
for (int i=1; i<size; i++)
if (Math.abs(coords[i].x-coords[i-1].x) > MIN_LATLON_DIFF ||
Math.abs(coords[i].y-coords[i-1].y) > MIN_LATLON_DIFF)
coords2.add(coords[i]);
size = coords2.size();
Coordinate[] coords3 = coords2.toArray(new Coordinate[size]);
return coords3;
}
/**
* Remove overlaid segments
*/
private boolean removeOverlaidSegments(Coordinate[] coords) {
double diffx1, diffx2, diffy1, diffy2;
double ratio1, ratio2;
boolean adjusted = false;
for (int i=2; i<coords.length-2; i++) {
diffx1 = coords[i-1].x - coords[i].x;
if (Math.abs(diffx1) > MIN_LATLON_DIFF) {
ratio1 = (coords[i-1].y-coords[i].y)/diffx1;
diffx2 = coords[i].x - coords[i+1].x;
if (Math.abs(diffx2) > MIN_LATLON_DIFF) {
ratio2 = (coords[i].y-coords[i+1].y)/diffx2;
if (Math.abs(ratio1-ratio2) < MIN_DIFF) {
if (diffx1 > 0.0 && diffx2 > 0.0 ||
diffx1 < 0.0 && diffx2 < 0.0) {
// three vertices on a straight line. Not overlaid.
} else {
// two segments overlaid
adjustLatLon('y',coords,i);
adjusted = true;
}
}
} else {
continue;
}
} else {
diffy1 = coords[i-1].y - coords[i].y;
ratio1 = (coords[i-1].x-coords[i].x)/diffy1;
diffy2 = coords[i].y - coords[i+1].y;
if (Math.abs(diffy2) > MIN_LATLON_DIFF) {
ratio2 = (coords[i].x-coords[i+1].x)/diffy2;
if (Math.abs(ratio1-ratio2) < MIN_DIFF) {
if (diffy1 > 0.0 && diffy2 > 0.0 ||
diffy1 < 0.0 && diffy2 < 0.0) {
// three vertices on a straight line. Not overlaid.
} else {
// two segments overlaid
adjustLatLon('x',coords,i);
adjusted = true;
}
}
} else {
continue;
}
}
}
return adjusted;
}
/**
* Increase or decrease latitude or longitude slightly
*/
private void adjustLatLon(char direction, Coordinate[] coords, int i) {
// Empirical value.
// 1.0E3 not working for horizontal rectangle cases
double adjustedValue = 5.0E-3;
int n = coords.length;
int factor;
if (direction == 'x') {
// adjust longitude
double diffx = coords[i-2].x - coords[i-1].x;
if (Math.abs(diffx) > MIN_LATLON_DIFF) {
if (coords[i-1].y > coords[i].y) {
factor = 1;
} else
factor = -1;
if (diffx < 0.0) {
coords[i+1].x -= factor*adjustedValue;
} else {
coords[i-1].x += factor*adjustedValue;
}
if (i == n-3)
coords[0].x = coords[i-1].x;
} else {
diffx = coords[i+2].x - coords[i+1].x;
if (Math.abs(diffx) > MIN_LATLON_DIFF) {
if (coords[i+1].y > coords[i].y) {
factor = -1;
} else
factor = 1;
if (diffx < 0.0) {
coords[i-1].x -= factor*adjustedValue;
} else {
coords[i+1].x += factor*adjustedValue;
}
if (i == n-3)
coords[0].x = coords[i-1].x;
}
}
} else {
// adjust latitude
double diffy = coords[i-2].y - coords[i-1].y;
if (Math.abs(diffy) > MIN_LATLON_DIFF) {
if (coords[i-1].x > coords[i].x) {
factor = -1;
} else
factor = 1;
if (diffy > 0.0) {
coords[i+1].y -= factor*adjustedValue;
} else {
coords[i-1].y += factor*adjustedValue;
}
if (i == n-3)
coords[0].y = coords[i-1].y;
}
else {
diffy = coords[i+2].y - coords[i+1].y;
if (Math.abs(diffy) > MIN_LATLON_DIFF) {
if (coords[i+1].x > coords[i].x) {
factor = -1;
} else
factor = 1;
if (diffy < 0.0) {
coords[i-1].y -= factor*adjustedValue;
} else {
coords[i+1].y += factor*adjustedValue;
}
if (i == n-3)
coords[0].y = coords[i-1].y;
}
}
}
}
}

View file

@ -802,6 +802,17 @@ public class GFEDao extends DefaultPluginDao {
3600 * 1000));
}
if ((!uTimeList.isEmpty()) && (!vTimeList.isEmpty())
& (uTimeList.size() == vTimeList.size())) {
for (TimeRange tr : uTimeList) {
if (vTimeList.contains(tr)) {
timeList.add(new TimeRange(tr.getStart(), tr.getStart()));
}
}
return timeList;
}
ParmID sWindId = new ParmID(id.toString().replace("wind", "ws"));
List<TimeRange> sTimeList = new ArrayList<TimeRange>();
results = executeD2DParmQuery(sWindId);
@ -818,30 +829,16 @@ public class GFEDao extends DefaultPluginDao {
3600 * 1000));
}
for (TimeRange tr : uTimeList) {
if (vTimeList.contains(tr)) {
timeList.add(new TimeRange(tr.getStart(), tr.getStart()));
if ((!sTimeList.isEmpty()) && (!dTimeList.isEmpty())
& (sTimeList.size() == dTimeList.size())) {
for (TimeRange tr : sTimeList) {
if (dTimeList.contains(tr)) {
timeList.add(new TimeRange(tr.getStart(), tr.getStart()));
}
}
}
if (uTimeList.size() != vTimeList.size()) {
if (logger.isDebugEnabled()) {
logger.debug("Wind data is incomplete for " + id.toString());
}
return timeList;
}
for (TimeRange tr : sTimeList) {
if (!timeList.contains(tr) && dTimeList.contains(tr)) {
timeList.add(new TimeRange(tr.getStart(), tr.getStart()));
}
}
if (sTimeList.size() != dTimeList.size()) {
if (logger.isDebugEnabled()) {
logger.debug("Wind data is incomplete for " + id.toString());
}
}
} else {
List<DataTime> results = executeD2DParmQuery(id);
for (DataTime o : results) {

View file

@ -438,7 +438,7 @@ class IscMosaic:
# rename weather element
if self.__renameWE:
siteID = getattr(vars[0], "siteID")
siteID = str(getattr(vars[0], "siteID"))
incomingOfficeType = IFPServerConfigManager.getServerConfig(self.__mysite).getOfficeType(siteID)
if incomingOfficeType != self.__myOfficeType:
idx = parmName.rfind("_")
@ -510,13 +510,13 @@ class IscMosaic:
numFailed = 0
while retryAttempt != retries:
LogStream.logDebug("iscMosaic: Attempting to acquire cluster lock for:",parmName)
self.logDebug("iscMosaic: Attempting to acquire cluster lock for:",parmName)
startTime = time.time()
clusterLock = ClusterLockUtils.lock("ISC Write Lock",parmName , 120000, True)
elapsedTime = (time.time() - startTime)*1000
LogStream.logDebug("iscMosaic: Request for",parmName+" took",elapsedTime,"ms")
self.logDebug("iscMosaic: Request for",parmName+" took",elapsedTime,"ms")
if str(clusterLock.getLockState()) == "SUCCESSFUL":
LogStream.logDebug("iscMosaic: Successfully acquired cluster lock for:",parmName)
self.logDebug("iscMosaic: Successfully acquired cluster lock for:",parmName)
try:
# open up the ifpServer weather element
self.__dbwe = self.__db.getItem(parmName,ISC_USER)
@ -531,7 +531,7 @@ class IscMosaic:
gridType = getattr(vars[0], "gridType")
minV = self.__dbwe.getGpi().getMinValue()
# compute the site mask
self.__siteID = getattr(vars[0], "siteID")
self.__siteID = str(getattr(vars[0], "siteID"))
if self.__areaMask is None:
self.__areaMask = self.__computeAreaMask().getGrid().__numpy__[0]
@ -631,23 +631,23 @@ class IscMosaic:
retryAttempt = retries
except:
retryAttempt = retryAttempt + 1
LogStream.logProblem("Error saving ISC data. Retrying (", retryAttempt, "/", retries, ")",traceback.format_exc())
self.logProblem("Error saving ISC data. Retrying (", retryAttempt, "/", retries, ")",traceback.format_exc())
time.sleep(1)
finally:
LogStream.logDebug("iscMosaic: Attempting to release cluster lock for:",parmName)
self.logDebug("iscMosaic: Attempting to release cluster lock for:",parmName)
ClusterLockUtils.unlock(clusterLock, False)
LogStream.logDebug("iscMosaic: Successfully released cluster lock for:",parmName)
self.logDebug("iscMosaic: Successfully released cluster lock for:",parmName)
elif str(clusterLock.getLockState()) == "OLD":
retryAttempt = retryAttempt + 1
# Clear old lock to retry
LogStream.logDebug("Old lock retrieved for ISC write. Attempting to renew lock")
self.logDebug("Old lock retrieved for ISC write. Attempting to renew lock")
ClusterLockUtils.unlock(clusterLock, False)
elif str(clusterLock.getLockState()) == "FAILED":
retryAttempt = retryAttempt + 1
if retryAttempt == retries:
LogStream.logProblem("Cluster lock could not be established for ",self._we.getParmid(),"at time range",TimeRange(tr[0],tr[1]),"Data was not saved.")
self.logProblem("Cluster lock could not be established for ",self._we.getParmid(),"at time range",TimeRange(tr[0],tr[1]),"Data was not saved.")
else:
LogStream.logProblem("Cluster lock request failed for ISC write.", retries, "Retrying (", retryAttempt, "/", retries, ")")
self.logProblem("Cluster lock request failed for ISC write.", retries, "Retrying (", retryAttempt, "/", retries, ")")
time.sleep(1)
return (pName, totalTimeRange, len(inTimesProc), numFailed)
@ -1096,6 +1096,7 @@ class IscMosaic:
gridType = gpi.getGridType().toString()
gs = self.__decodeGridSlice(pid, grid, TimeRange())
pd = self.__decodeProj(inGeoDict)
fill = inFillV
ifill = int(inFillV)
@ -1342,7 +1343,7 @@ class IscMosaic:
# get the list of discrete keys for this parameter that are allowed
dd = self.__disDef.keys(parmName)
if dd.size() == 0:
LogStream.logProblem("Unable to validate keys for ",
self.logProblem("Unable to validate keys for ",
parmName, " - no def in DiscreteDefinition")
return grid
@ -1393,7 +1394,7 @@ class IscMosaic:
keyentry = "^".join(eachKey) #join back to string
if len(changedReasons):
LogStream.logProblem(smsg,
self.logProblem(smsg,
"from [" + oldEntry + "] to [" + keyentry + "]",
"(" + ",".join(changedReasons) + ")")
msg = self.__siteID + " " + parmName + " " + \
@ -1495,7 +1496,7 @@ class IscMosaic:
# report any changes
if len(changedReasons):
LogStream.logProblem(smsg,
self.logProblem(smsg,
" from [" + oldEntry + "] to [" + keyentry + "]",
"(" + ",".join(changedReasons) + ")")
msg = self.__siteID + " " + parmName + " " + \

View file

@ -58,7 +58,7 @@ mkdir -p $commonDest/site
log_msg 25
log_msg Making temporary cave configuration directories
mkdir -p $caveDest/site/colormaps
mkdir -p $caveDest/site
log_msg 30
# Copies the localization information to the staging area
@ -78,8 +78,8 @@ log_msg Copying cave site configuration for site ${CAPS_SITE} to temporary direc
cp -r ${LOCALIZATION_PATH}/cave_static/site/${CAPS_SITE}/gfe $caveDest/site
log_msg 70
log_msg Copying cave site configuration for site ${CAPS_SITE} to temporary directory...
cp -r ${LOCALIZATION_PATH}/cave_static/site/${CAPS_SITE}/colormaps/GFE $caveDest/site/colormaps
log_msg Copying cave site colormaps configuration for site ${CAPS_SITE} to temporary directory...
cp -r ${LOCALIZATION_PATH}/cave_static/site/${CAPS_SITE}/colormaps $caveDest/site
log_msg 80
# Tar up everything.

View file

@ -132,7 +132,7 @@ cp -r GFEconfig/edex_static/site/gfe ${edex_site_dest}
log_msg 80
cp -r GFEconfig/edex_static/site/smartinit ${edex_site_si_dest}
log_msg 90
cp -r GFEconfig/cave_static/site ${cave_site_dest}
cp -r GFEconfig/cave_static/site/* ${cave_site_dest}
log_msg 93
log_msg "Files successfully copied!"

View file

@ -8,7 +8,7 @@
Name: awips2-python-h5py
Summary: AWIPS II Python h5py Distribution - 64 Bit
Version: 1.3.0
Release: 1
Release: 2
Group: AWIPSII
BuildRoot: %{_build_root}
URL: N/A

View file

@ -76,6 +76,7 @@
<packagereq type="default">awips2-python-pygtk</packagereq>
<packagereq type="default">awips2-python-pycairo</packagereq>
<packagereq type="default">awips2-localapps-environment</packagereq>
<packagereq type="default">awips2-data.gfe</packagereq>
</packagelist>
</group>

View file

@ -1,89 +0,0 @@
#
# AWIPS II Python pupynere Site-Package Spec File
#
Name: awips2-python-pupynere
Summary: AWIPS II Python pupynere Site-Package
Version: 1.0.15
Release: 1
Group: AWIPSII
BuildRoot: /tmp
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
requires: awips2-python
requires: awips2-python-numpy
provides: awips2-python-pupynere
%define _docdir python.pupynere
%description
AWIPS II Python pupynere Site-Package - Installs the AWIPS II Python
pupynere Site-Package in the Python installation.
# Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
then
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
echo "Unable To Continue ... Terminating"
exit 1
fi
mkdir -p ${RPM_BUILD_ROOT}
%build
SITE_PACKAGE_SRC_DIR="pythonPackages/pupynere"
PREREQ_PACKAGE_SRC_DIR="pythonPackages/setuptools"
# Build and install the pre-req setuptools
cd ${WORKSPACE_DIR}/${PREREQ_PACKAGE_SRC_DIR}
${PYTHON_EXE} setup.py build
${PYTHON_EXE} setup.py install
# Build pupynere
cd ${WORKSPACE_DIR}/${SITE_PACKAGE_SRC_DIR}
${PYTHON_EXE} setup.py build
%install
SITE_PACKAGE_SRC_DIR="pythonPackages/pupynere"
cd ${WORKSPACE_DIR}/${SITE_PACKAGE_SRC_DIR}
${PYTHON_EXE} setup.py install --root=${RPM_BUILD_ROOT} \
--prefix=/awips2/python
%pre
if [ -d /usr/share/doc/awips2/%{_docdir} ]; then
rm -rf /usr/share/doc/awips2/%{_docdir}
fi
PYTHON_INSTALL="/awips2/python"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing the AWIPS II Python pupynere Site-Package...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m Python Install Root = ${PYTHON_INSTALL}\e[m"
%post
PYTHON_INSTALL="/awips2/python"
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;32m\| AWIPS II Python pupynere Site-Package Installation - COMPLETE\e[m"
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
%preun
%postun
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| The AWIPS II Python pupynere Site-Package Has Been Successfully Removed\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo ""
%files
%defattr(644,awips,fxalpha,755)
/awips2/python/lib/python2.7/site-packages/*