Merge branch 'ss_builds' (12.12.1-3) into development
Former-commit-id:8fc896f7d4
[formerly448dd1c35f
] [formerly00f3d51546
[formerly 7a44f29952ec89991e578c67357e1ef3f3c51d59]] Former-commit-id:00f3d51546
Former-commit-id:c8cac52915
This commit is contained in:
commit
21ecd53719
40 changed files with 946 additions and 422 deletions
|
@ -47,7 +47,7 @@ from java.util import HashSet
|
|||
# 04/01/09 njensen Initial Creation.
|
||||
# 08/20/2012 #1077 randerso Fixed backgroundColor setting
|
||||
# 09/13/2012 #1147 dgilling Allow map labels to be disabled.
|
||||
#
|
||||
# 11/6/2012 15406 ryu Correction for computing domain from mask
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -64,7 +64,7 @@ class GFEPainter(VizPainter.VizPainter):
|
|||
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType
|
||||
self.refId = ReferenceID(mask)
|
||||
if wholeDomain == 0:
|
||||
envelope = self.dataMgr.getRefManager().loadRefSet(self.refId).overallDomain(CoordinateType.LATLON)
|
||||
envelope = self.dataMgr.getRefManager().loadRefSet(self.refId).overallDomain(CoordinateType.GRID)
|
||||
if imageWidth is not None:
|
||||
imageWidth = Integer(int(imageWidth))
|
||||
if imageHeight is not None:
|
||||
|
|
|
@ -69,7 +69,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* 04/08/2008 chammack Initial Port from AWIPS I (minus ISC support)
|
||||
* 07/23/2012 #936 dgilling Reinstate config-handling code to
|
||||
* calcGridLabels().
|
||||
* 11/05/2012 #14566 jzeng Reverse the order of grids
|
||||
* 11/05/2012 #14566 jzeng Paint the sample points with the order of grids
|
||||
* in calcGridLabels ()
|
||||
* </pre>
|
||||
*
|
||||
|
@ -254,13 +254,17 @@ public class SamplePainter {
|
|||
* @param colors
|
||||
* The color list
|
||||
*/
|
||||
private void calcGridLabels(Coordinate worldLoc, final List<GridID> grids,
|
||||
private void calcGridLabels(Coordinate worldLoc, final List<GridID> Grids,
|
||||
final GridID imageGrid, List<String> sampleLabels, List<RGB> colors) {
|
||||
|
||||
if (grids.isEmpty()) {
|
||||
if (Grids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<GridID> grids = Grids;
|
||||
|
||||
Collections.reverse(grids);
|
||||
|
||||
// if list is not defined, then all samples will be painted for
|
||||
// all parms
|
||||
List<String> limitSamples = Arrays.asList(Activator.getDefault()
|
||||
|
@ -284,8 +288,6 @@ public class SamplePainter {
|
|||
inGrid = true;
|
||||
}
|
||||
|
||||
Collections.reverse(grids);
|
||||
|
||||
// get the list of samples that should be painted and in the
|
||||
// order
|
||||
for (GridID grid : grids) {
|
||||
|
@ -340,6 +342,7 @@ public class SamplePainter {
|
|||
sampleLabels.add(label);
|
||||
colors.add(labelColor);
|
||||
}
|
||||
Collections.reverse(grids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,16 +19,15 @@
|
|||
**/
|
||||
package com.raytheon.viz.gfe.ifpimage;
|
||||
|
||||
|
||||
import org.geotools.coverage.grid.GeneralGridEnvelope;
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.geotools.geometry.GeneralEnvelope;
|
||||
import org.opengis.geometry.Envelope;
|
||||
import org.opengis.referencing.FactoryException;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.vividsolutions.jts.geom.Point;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Static methods to support IFP Image or generating GFE images off screen.
|
||||
|
@ -40,6 +39,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 12, 2009 njensen Initial creation
|
||||
* 21May2009 6309 garmendariz Modified path for Geotools 2.6.4
|
||||
* 11/6/2012 15406 ryu Modified computing domain from mask
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,26 +57,16 @@ public class GfeImageUtil {
|
|||
Envelope envelope = null;
|
||||
GridGeometry2D newGridGeometry = null;
|
||||
|
||||
try {
|
||||
if (env != null) {
|
||||
Point[] points = new Point[2];
|
||||
points[0] = MapUtil.getPoint(env.getMinY(), env.getMinX());
|
||||
points[1] = MapUtil.getPoint(env.getMaxY(), env.getMaxX());
|
||||
envelope = MapUtil.extractProjectedEnvelope(gloc.getCrs(),
|
||||
points, MapUtil.getTransformFromLatLon(gloc.getCrs()));
|
||||
Coordinate ll = new Coordinate(env.getMinX(), env.getMinY());
|
||||
Coordinate ur = new Coordinate(env.getMaxX(), env.getMaxY());
|
||||
envelope = MapUtil.convertToNativeEnvelope(ll, ur, gloc);
|
||||
}
|
||||
} catch (TransformException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
if (envelope == null) {
|
||||
GridGeometry2D gridGeometry = MapUtil.getGridGeometry(gloc);
|
||||
envelope = gridGeometry.getEnvelope();
|
||||
}
|
||||
}
|
||||
|
||||
double dLeft = envelope.getSpan(0) * percentLeft;
|
||||
double dRight = envelope.getSpan(0) * percentRight;
|
||||
|
|
|
@ -128,6 +128,9 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
|
|||
* 06 Nov 2012 15399 wkwock Fix refine the plot algorithm and sampling algorithm
|
||||
* 06 Nov 2012 15459 lbousaidi update data when page/up or page/down is pressed without having
|
||||
* to click in graph button again.
|
||||
* 06 Nov 2012 15400 lbousaidi Changed logic in buildPointString routine, added discharge2stage
|
||||
* to display stage value, also added checking for rating curve for both
|
||||
* stage and discharge.
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*
|
||||
|
@ -1599,31 +1602,57 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
|
|||
double yValue = pixel2y(graphData, y);
|
||||
String units = FEET;
|
||||
boolean isRiverData = true;
|
||||
boolean isStage= true;
|
||||
ArrayList<TraceData> traces = graphData.getTraces();
|
||||
for (TraceData trace : traces) {
|
||||
if (!trace.getPe().toUpperCase().startsWith("H")
|
||||
&& !trace.getPe().toUpperCase().startsWith("Q")) {
|
||||
isRiverData = false;
|
||||
}
|
||||
if (trace.getPe().toUpperCase().startsWith("Q")) {
|
||||
isStage=false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isRiverData) {
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue) + " "
|
||||
+ units + " ");
|
||||
|
||||
if (isStage) {
|
||||
/**
|
||||
* Convert the stage to discharge for the location and stage value passed in.
|
||||
*/
|
||||
double q = StageDischargeUtils.stage2discharge(lid, yValue);
|
||||
if (q != HydroConstants.MISSING_VALUE) {
|
||||
units = CFS;
|
||||
//check for rating curve
|
||||
if (q != HydroConstants.RATING_CONVERT_FAILED) {
|
||||
if (q > 10000) {
|
||||
units = KCFS;
|
||||
q = q / 1000;
|
||||
}else {
|
||||
units = CFS;
|
||||
}
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue)
|
||||
+ " " + FEET + " ");
|
||||
sb.append(String.format("%8.1f", q) + " " + units);
|
||||
}else {
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue));
|
||||
}
|
||||
} else {
|
||||
units = INCH;
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue) + " "
|
||||
+ units + " ");
|
||||
|
||||
}else {
|
||||
/**
|
||||
* Convert the discharge to stage for the location and discharge value passed in.
|
||||
*/
|
||||
double q = StageDischargeUtils.discharge2stage(lid, yValue);
|
||||
//check for rating curve
|
||||
if (q != HydroConstants.RATING_CONVERT_FAILED) {
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue)
|
||||
+ " " + CFS + " ");
|
||||
sb.append(String.format("%8.1f", q) + " " + FEET);
|
||||
}else {
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue));
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
sb.append(" value=" + twoDecimalFormat.format(yValue));
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
|
|||
* function adjust_pcymax()
|
||||
* Aug. 10, 2011 10457 djingtao allow the red rubberband box to be drawn for setMissing in Edit
|
||||
* Jul. 24, 2012 15195 mpduff Fix x axis scales.
|
||||
* 06 Nov 2012 15399 wkwock Fix refine the plot algorithm and sampling algorithm
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -500,11 +501,11 @@ public class TimeSeriesGraphCanvas extends Canvas {
|
|||
int x = -999;
|
||||
int dy = 5;
|
||||
int dx = 4;
|
||||
long startMillis = gd.getXMin().getTime();
|
||||
long startMillis = ((long)Math.ceil(gd.getXMin().getTime()/HydroConstants.MILLIS_PER_HOUR))*HydroConstants.MILLIS_PER_HOUR;
|
||||
long endMillis = gd.getXMax().getTime();
|
||||
|
||||
for (long i = startMillis; i <= endMillis; i += HydroConstants.MILLIS_PER_HOUR) {
|
||||
x = x2pixel(gd, i);
|
||||
x = x2pixel(gd, i+59000); //59 seconds for better sampling
|
||||
Date d = SimulatedTime.getSystemTime().getTime();
|
||||
d.setTime(i);
|
||||
dy = 5;
|
||||
|
@ -667,8 +668,8 @@ public class TimeSeriesGraphCanvas extends Canvas {
|
|||
long xMin = gd.getXMin().getTime();
|
||||
long xMax = gd.getXMax().getTime();
|
||||
long xDiff = xMax - xMin;
|
||||
long millisPerPixel = xDiff / graphAreaWidth;
|
||||
long millisTime = (xpix - GRAPHBORDER_LEFT) * millisPerPixel + xMin;
|
||||
double millisPerPixel = xDiff / graphAreaWidth;
|
||||
long millisTime = (long)(xpix * millisPerPixel) + xMin;
|
||||
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
cal.setTimeInMillis(millisTime);
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.viz.hydrocommon.whfslib.GeoUtil;
|
|||
* Sep 18, 2009 2260 mpduff Initial creation
|
||||
* Apr 25, 2012 14499 wkwock Refine format, query, etc
|
||||
* Sep 11, 2012 13781 wkwock add print menu
|
||||
* Oct 19, 2012 15454 wkwock Fix missing River mile, Zero Datum, Check bar
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -141,14 +142,14 @@ public class E19AReport extends E19Report {
|
|||
buffer.append(String.format("STATION NO: %-11s\n", locData.getLocation().getSn()));
|
||||
|
||||
String mile = null;
|
||||
if (data.getRiverstat().getDa() != HydroConstants.MISSING_VALUE) {
|
||||
if (data.getRiverstat().getMile() != HydroConstants.MISSING_VALUE) {
|
||||
mile = String.format("%8.2f", data.getRiverstat().getMile());
|
||||
} else {
|
||||
mile = " ";
|
||||
}
|
||||
|
||||
String wstg = null;
|
||||
if (data.getRiverstat().getFs() != HydroConstants.MISSING_VALUE) {
|
||||
if (data.getRiverstat().getWstg() != HydroConstants.MISSING_VALUE) {
|
||||
wstg = String.format("%8.2f", data.getRiverstat().getWstg());
|
||||
} else {
|
||||
wstg = " ";
|
||||
|
@ -158,14 +159,14 @@ public class E19AReport extends E19Report {
|
|||
buffer.append(String.format(" USGS NO: %-11s\n", data.getRiverstat().getGsno()));
|
||||
|
||||
String zd = null;
|
||||
if (data.getRiverstat().getDa() != HydroConstants.MISSING_VALUE) {
|
||||
if (data.getRiverstat().getZd() != HydroConstants.MISSING_VALUE) {
|
||||
zd = String.format("%8.3f", data.getRiverstat().getZd());
|
||||
} else {
|
||||
zd = " ";
|
||||
}
|
||||
|
||||
String bf = null;
|
||||
if (data.getRiverstat().getFs() != HydroConstants.MISSING_VALUE) {
|
||||
if (data.getRiverstat().getBf() != HydroConstants.MISSING_VALUE) {
|
||||
bf = String.format("%8.2f", data.getRiverstat().getBf());
|
||||
} else {
|
||||
bf = " ";
|
||||
|
@ -175,7 +176,7 @@ public class E19AReport extends E19Report {
|
|||
buffer.append(String.format(" NESS ID: %-8s\n", dataDcpTelem.getDcp().getGoes()));
|
||||
|
||||
String cb = null;
|
||||
if (data.getRiverstat().getDa() != HydroConstants.MISSING_VALUE) {
|
||||
if (data.getRiverstat().getCb() != HydroConstants.MISSING_VALUE) {
|
||||
cb = String.format("%8.3f", data.getRiverstat().getCb());
|
||||
} else {
|
||||
cb = " ";
|
||||
|
@ -277,7 +278,7 @@ public class E19AReport extends E19Report {
|
|||
buffer.append(" LATEST GAGE TYPE START DATE OWNER OF GAGE\n");
|
||||
|
||||
if (dataG.getGageList() != null && dataG.getGageList().size() > 0) {
|
||||
Gage gage=dataG.getGageList().get(dataG.getGageList().size()-1);
|
||||
Gage gage=dataG.getGageList().get(0);
|
||||
buffer.append(String.format(" %-11s %10s %-11s\n", gage.getType(), sdf.format(gage.getBegin()), gage.getOwner()));
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.viz.hydrocommon.whfslib.GeoUtil;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 18, 2009 2260 mpduff Initial creation
|
||||
* Apr 25, 2012 14499 wkwock Refine format, query, etc
|
||||
* Oct 14, 2012 15454 wkwock Fix can not generate e19 if damage filed is empty
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1392,9 +1393,13 @@ public class E19Report extends TextReport {
|
|||
tmp1 = String.format("%7.2f", floodList.get(floodIndex).getStage());
|
||||
}
|
||||
|
||||
if (lines==null || lines[lineIndex]==null) {
|
||||
thisLineStr=" " + tmp1 + " -";
|
||||
} else {
|
||||
thisLineStr=" " + tmp1 + " - " + lines[lineIndex];
|
||||
}
|
||||
}else {
|
||||
thisLineStr=" " + lines[lineIndex];
|
||||
thisLineStr=" ";
|
||||
}
|
||||
|
||||
int spaces = flood_filler - thisLineStr.length();
|
||||
|
@ -1410,7 +1415,7 @@ public class E19Report extends TextReport {
|
|||
|
||||
lineIndex++;
|
||||
|
||||
if (lineIndex == lines.length - 1) { // No more lines in this record
|
||||
if (lines !=null && lineIndex == lines.length - 1) { // No more lines in this record
|
||||
floodIndex++; // Get the next record
|
||||
|
||||
if ((floodList.size() > floodIndex) && (floodList.get(floodIndex) != null)) {
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.viz.hydrocommon.textreport.TextReportData.StaffGageData;
|
|||
* Nov 09, 2010 5416 lbousaid changed gageQuery
|
||||
* Dec 08, 2011 11728 lbousaidi changed the routines that retrieve data
|
||||
* Apr 25, 2012 14499 wkwock Refine format, query, etc
|
||||
* Nov 06, 2012 15454 wkwock Fix query for get data from gage table
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -356,7 +357,7 @@ public class TextReportDataManager extends HydroDataManager {
|
|||
public TextReportData getGageQueryList(String lid) {
|
||||
TextReportData data = new TextReportData();
|
||||
String gageQuery = "select gbegin, type, owner, remark, maint, gend from gage where lid = '"
|
||||
+ lid + "' order by gbegin,type";
|
||||
+ lid + "' and gend is null ORDER BY gbegin desc";
|
||||
ArrayList<Object[]> rs = runQuery(gageQuery);
|
||||
ArrayList<Gage> gageList = new ArrayList<Gage>();
|
||||
int i = 0;
|
||||
|
|
|
@ -75,6 +75,7 @@ import com.raytheon.viz.mpe.util.WriteQPFGrids;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 24, 2009 snaples Initial creation
|
||||
* Sep 19, 2011 10955 rferrel Use RunProcess
|
||||
* Nov 06, 2012 15481 wkwock Fix save 6 hours precipitation files
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -649,6 +650,81 @@ public class SaveLevel2Data {
|
|||
}
|
||||
}
|
||||
|
||||
//save for each 6 hour periods
|
||||
for (l = 0; l < 5; l++) {
|
||||
|
||||
if (DailyQcUtils.pdata[j].used[l] == 0 || qctype_flag[0] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* this needs to be fixed to ensure that the gridded temperature
|
||||
* files are named correctly.
|
||||
*/
|
||||
if (l < 2) {
|
||||
old_time = DailyQcUtils.pdata[j].data_time;
|
||||
Calendar od = Calendar.getInstance();
|
||||
od.setTime(old_time);
|
||||
od.add(Calendar.SECOND, -86400);
|
||||
old_time = od.getTime();
|
||||
} else {
|
||||
old_time = DailyQcUtils.pdata[j].data_time;
|
||||
}
|
||||
|
||||
gm.setTime(old_time);
|
||||
|
||||
if (l < 4) {
|
||||
ll = 0;
|
||||
} else {
|
||||
ll = 1;
|
||||
}
|
||||
|
||||
RenderPcp rcp = new RenderPcp();
|
||||
rcp.render_pcp(j, l, ll, max_stations,
|
||||
DailyQcUtils.precip_stations, hrap_grid,
|
||||
DailyQcUtils.pdata, DailyQcUtils.pcp_in_use);
|
||||
|
||||
String dbuf = String.format("%s%s_%04d%02d%02d", grid_file,
|
||||
timefile[2][l], gm.get(Calendar.YEAR),
|
||||
gm.get(Calendar.MONTH) + 1,
|
||||
gm.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
/* output grid to file in ascii xmrg format */
|
||||
WriteQPFGrids wqg = new WriteQPFGrids();
|
||||
wqg.write_qpf_grids(dbuf);
|
||||
|
||||
if (DailyQcUtils.mpe_dqc_save_grib == true) {
|
||||
WriteDQCNetCDFGrids wng = new WriteDQCNetCDFGrids();
|
||||
String ncfile = String.format("%s.nc", dbuf);
|
||||
wng.write_dqc_netcdf_grids(ncfile, l, 1, 1,
|
||||
ga.getCommonGridAttributes(), datavals);
|
||||
WriteDQCGribGrids wgg = new WriteDQCGribGrids();
|
||||
String fname_grib = String.format("%s.grb", dbuf);
|
||||
int status = wgg
|
||||
.write_dqc_grib_grids(ncfile, fname_grib, 1);
|
||||
if (status != 0) {
|
||||
statusHandler
|
||||
.handle(Priority.WARN,
|
||||
String.format(
|
||||
"problem with writing GRIB file in write_dqc_grib_grids. status=%d\n",
|
||||
status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (l < 4) {
|
||||
num = j * 4 + 3 - l;
|
||||
} else {
|
||||
num = 40 + j;
|
||||
}
|
||||
|
||||
/* Create the MAP. */
|
||||
CreateMap cm = new CreateMap();
|
||||
cm.create_map(num);
|
||||
|
||||
}
|
||||
|
||||
//save the whole days
|
||||
for (l = 0; l < 5; l++) {
|
||||
|
||||
if (DailyQcUtils.pdata[j].used[l] == 0 || qctype_flag[0] == -1) {
|
||||
|
@ -698,25 +774,6 @@ public class SaveLevel2Data {
|
|||
ga.getCommonGridAttributes(), datavals);
|
||||
}
|
||||
|
||||
if (DailyQcUtils.mpe_dqc_save_grib == true) {
|
||||
WriteDQCNetCDFGrids wng = new WriteDQCNetCDFGrids();
|
||||
String ncfile = String.format("%s.nc", dbuf);
|
||||
wng.write_dqc_netcdf_grids(ncfile, l, 1, 1,
|
||||
ga.getCommonGridAttributes(), datavals);
|
||||
WriteDQCGribGrids wgg = new WriteDQCGribGrids();
|
||||
String fname_grib = String.format("%s.grb", dbuf);
|
||||
int status = wgg
|
||||
.write_dqc_grib_grids(ncfile, fname_grib, 1);
|
||||
if (status != 0) {
|
||||
statusHandler
|
||||
.handle(Priority.WARN,
|
||||
String.format(
|
||||
"problem with writing GRIB file in write_dqc_grib_grids. status=%d\n",
|
||||
status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (l < 4) {
|
||||
num = j * 4 + 3 - l;
|
||||
} else {
|
||||
|
|
|
@ -308,6 +308,8 @@ public class AutoDailyQC {
|
|||
}
|
||||
}
|
||||
|
||||
num_period_qc=5;
|
||||
//for the 6 hours periods
|
||||
for (int l = 0; l < 5; l++) {
|
||||
if (DailyQcUtils.pdata[i].used[l] == 0) {
|
||||
continue;
|
||||
|
@ -343,6 +345,79 @@ public class AutoDailyQC {
|
|||
WriteQPFGrids wq = new WriteQPFGrids();
|
||||
wq.write_qpf_grids(dbuf);
|
||||
|
||||
/* output grid to file in grib format */
|
||||
|
||||
// create netCDF file from data, write it out then call
|
||||
// nc2grib against it making a grib file, when done
|
||||
// remove the unneeded netCDF file.
|
||||
if (DailyQcUtils.mpe_dqc_save_grib == true) {
|
||||
WriteDQCNetCDFGrids wng = new WriteDQCNetCDFGrids();
|
||||
String ncfile = String.format("%s.nc", dbuf);
|
||||
wng.write_dqc_netcdf_grids(ncfile, 0, 1, 1,
|
||||
ga.getCommonGridAttributes(), datavals);
|
||||
WriteDQCGribGrids wgg = new WriteDQCGribGrids();
|
||||
String fname_grib = String.format("%s.grb", dbuf);
|
||||
int status = wgg.write_dqc_grib_grids(ncfile,
|
||||
fname_grib, 1);
|
||||
File nfile = new File(ncfile);
|
||||
nfile.delete();
|
||||
nfile = null;
|
||||
if (status != 0) {
|
||||
System.out
|
||||
.println(String
|
||||
.format("\n problem with writing GRIB file in write_dqc_grib_grids. status=%d\n",
|
||||
status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int num;
|
||||
if (l < 4) {
|
||||
num = i * 4 + 3 - l;
|
||||
} else {
|
||||
num = i + 40;
|
||||
}
|
||||
|
||||
/* create the MAP */
|
||||
CreateMap cm = new CreateMap();
|
||||
cm.create_map(num);
|
||||
}
|
||||
//for (int l = 0; l < 5; l++) {
|
||||
for (int l = 0; l < num_period_qc; l++) {
|
||||
if (DailyQcUtils.pdata[i].used[l] == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (l < 2) {
|
||||
otime.setTime(DailyQcUtils.pdata[i].data_time);
|
||||
otime.add(Calendar.SECOND, -86400);
|
||||
} else {
|
||||
otime.setTime(DailyQcUtils.pdata[i].data_time);
|
||||
}
|
||||
|
||||
int ll;
|
||||
if (l < 4) {
|
||||
ll = 0;
|
||||
} else {
|
||||
ll = 1;
|
||||
}
|
||||
RenderPcp rp = new RenderPcp();
|
||||
rp.render_pcp(i, l, ll,
|
||||
DailyQcUtils.precip_stations.size(),
|
||||
DailyQcUtils.precip_stations,
|
||||
DailyQcUtils.getHrap_grid(),
|
||||
DailyQcUtils.pdata, DailyQcUtils.pcp_in_use);
|
||||
|
||||
/* output grid to file in Ascii format */
|
||||
dbuf = String.format("%s%s_%04d%02d%02d",
|
||||
DailyQcUtils.grid_file,
|
||||
DailyQcUtils.timefile[2][l],
|
||||
otime.get(Calendar.YEAR),
|
||||
otime.get(Calendar.MONTH) + 1,
|
||||
otime.get(Calendar.DAY_OF_MONTH));
|
||||
WriteQPFGrids wq = new WriteQPFGrids();
|
||||
wq.write_qpf_grids(dbuf);
|
||||
|
||||
/* output grid to file in NetCDF format */
|
||||
if (DailyQcUtils.mpe_dqc_save_netcdf == true) {
|
||||
WriteDQCNetCDFGrids wng = new WriteDQCNetCDFGrids();
|
||||
|
@ -351,42 +426,6 @@ public class AutoDailyQC {
|
|||
ga.getCommonGridAttributes(), datavals);
|
||||
}
|
||||
|
||||
/* output grid to file in grib format */
|
||||
|
||||
// create netCDF file from data, write it out then call
|
||||
// nc2grib against it making a grib file, when done
|
||||
// remove the unneeded netCDF file.
|
||||
if (DailyQcUtils.mpe_dqc_save_grib == true) {
|
||||
WriteDQCNetCDFGrids wng = new WriteDQCNetCDFGrids();
|
||||
String ncfile = String.format("%s.nc", dbuf);
|
||||
wng.write_dqc_netcdf_grids(ncfile, 0, 1, 1,
|
||||
ga.getCommonGridAttributes(), datavals);
|
||||
WriteDQCGribGrids wgg = new WriteDQCGribGrids();
|
||||
String fname_grib = String.format("%s.grb", dbuf);
|
||||
int status = wgg.write_dqc_grib_grids(ncfile,
|
||||
fname_grib, 1);
|
||||
File nfile = new File(ncfile);
|
||||
nfile.delete();
|
||||
nfile = null;
|
||||
if (status != 0) {
|
||||
System.out
|
||||
.println(String
|
||||
.format("\n problem with writing GRIB file in write_dqc_grib_grids. status=%d\n",
|
||||
status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int num;
|
||||
if (l < 4) {
|
||||
num = i * 4 + 3 - l;
|
||||
} else {
|
||||
num = i + 40;
|
||||
}
|
||||
|
||||
/* create the MAP */
|
||||
CreateMap cm = new CreateMap();
|
||||
cm.create_map(num);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
</capabilities>
|
||||
</loadProperties>
|
||||
<resourceData xsi:type="satBestResResourceData"
|
||||
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true"
|
||||
inclusionFactor="${inclusionFactor;0.4}">
|
||||
<metadataMap>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="satellite"
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Map;
|
|||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import org.geotools.referencing.CRS;
|
||||
|
@ -67,7 +68,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 30, 2010 mschenke Initial creation
|
||||
* Oct 31, 2012 DR 15287 D. Friedman Fix overlap calculation
|
||||
* Nov 06, 2012 DR 15157 D. Friedman Allow configured inclusion percentage
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -82,6 +83,9 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
|||
@XmlElement(name = "resource")
|
||||
protected ResourceList resourceList = new ResourceList();
|
||||
|
||||
@XmlAttribute
|
||||
protected Double inclusionFactor;
|
||||
|
||||
private ResourcePair resourceToDraw;
|
||||
|
||||
/**
|
||||
|
@ -156,12 +160,14 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
|||
|
||||
Map<ResourcePair, Double> percentOfIntersection = new HashMap<ResourcePair, Double>();
|
||||
if (disclosedResource != null) {
|
||||
final double inclusionPercentageToUse = inclusionFactor != null ?
|
||||
inclusionFactor : DESIRED_PERCENTAGE;
|
||||
// check inclusion percentage of the disclosed resource
|
||||
Double inclusion = getInclusionPercentage(descriptor,
|
||||
disclosedResource, extent);
|
||||
if (inclusion != Double.NaN) {
|
||||
percentOfIntersection.put(disclosedResource, inclusion);
|
||||
if (inclusion < DESIRED_PERCENTAGE) {
|
||||
if (inclusion < inclusionPercentageToUse) {
|
||||
disclosedResource = null;
|
||||
}
|
||||
} else {
|
||||
|
@ -335,7 +341,7 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
|||
|
||||
for (Polygon last : prevs) {
|
||||
// Don't want to double include percentage areas
|
||||
totalPercentage -= last.intersection(polygon).intersection(extent)
|
||||
totalPercentage -= last.intersection(polygon)
|
||||
.getArea() / extent.getArea();
|
||||
}
|
||||
}
|
||||
|
@ -347,4 +353,12 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
|||
}
|
||||
return totalPercentage;
|
||||
}
|
||||
|
||||
public Double getInclusionFactor() {
|
||||
return inclusionFactor;
|
||||
}
|
||||
|
||||
public void setInclusionFactor(Double inclusionFactor) {
|
||||
this.inclusionFactor = inclusionFactor;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -302,6 +302,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
|||
* 12OCT2012 15418 D.Friedman Do not store product when sending in operational mode.
|
||||
* Do not use changed BBB from OUPResponse.
|
||||
* 17OCT2012 1229 rferrel Changes for non-blocking SWTMessageBox.
|
||||
* 05Nov2012 15560 S. Naples Added check to see if we are in edit mode before capturing keys.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -3530,6 +3531,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
|
||||
textEditor.addVerifyKeyListener(new VerifyKeyListener() {
|
||||
public void verifyKey(VerifyEvent event) {
|
||||
// Ignore edit keys when not in edit mode.
|
||||
if (textEditor.getEditable() == false){
|
||||
return;
|
||||
}
|
||||
if (event.keyCode == SWT.DEL || event.character == SWT.BS
|
||||
|| event.keyCode == SWT.SHIFT) {
|
||||
// Do nothing...
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
|
|||
* Add vtec to checkHeadline signature
|
||||
* 20 JUL 2012 15006 mgamazaychikov Do not perform search for a list of
|
||||
* county/zones names in the MWS segment heading.
|
||||
* 07 NOV 2012 15003 mgamazaychikov Do not perform QC check on standalone MWS headline.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -500,18 +501,13 @@ public class TextSegmentCheck implements IQCCheck {
|
|||
return errorMsg;
|
||||
}
|
||||
/*
|
||||
* DR15003 standalone MWS can have no headline.
|
||||
* DR15003: no headline QC on standalone MWS.
|
||||
* To distinguish between standalone and follow up MWS
|
||||
* the VTEC check is performed as standalone MWS
|
||||
* do not contain VTEC
|
||||
*/
|
||||
if (nnn.equals("MWS") && vtec == null) {
|
||||
if (headline.length() == 0) {
|
||||
return errorMsg;
|
||||
} else if (!headline.endsWith("...")) {
|
||||
errorMsg += "Headline should end with '...'.\n";
|
||||
}
|
||||
return errorMsg;
|
||||
return "";
|
||||
}
|
||||
|
||||
if (headline.length() == 0) {
|
||||
|
|
|
@ -71,6 +71,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Apr 13, 2012 #14691 Qinglu lin Added code for two more fe_area: er and nr.
|
||||
* May 4, 2012 #14887 Qinglu lin Changed 0.25 to 0.60 for DEFAULT_PORTION_TOLERANCE;
|
||||
* added code to pass a Envelope calculatePortion().
|
||||
* Nov 9, 2012 DR 15430 D. Friedman Extracted method converFeAreaToPartList.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -229,67 +230,7 @@ public class Area {
|
|||
.get(parentAreaField));
|
||||
String feArea = (String) regionFeature.attributes
|
||||
.get("FE_AREA");
|
||||
final List<String> partList = new ArrayList<String>();
|
||||
if (feArea == null) {
|
||||
// Marine warnings
|
||||
partList.add("");
|
||||
} else {
|
||||
if (feArea.equals("pa"))
|
||||
partList.add("PA");
|
||||
else if (feArea.equals("mi"))
|
||||
partList.add("MI");
|
||||
else if (feArea.equals("pd"))
|
||||
partList.add("PD");
|
||||
else if (feArea.equals("up"))
|
||||
partList.add("UP");
|
||||
else if (feArea.equals("bb"))
|
||||
partList.add("BB");
|
||||
else if (feArea.equals("er"))
|
||||
partList.add("ER");
|
||||
else if (feArea.equals("eu"))
|
||||
partList.add("EU");
|
||||
else if (feArea.equals("sr"))
|
||||
partList.add("SR");
|
||||
else if (feArea.equals("nr"))
|
||||
partList.add("NR");
|
||||
else if (feArea.equals("wu"))
|
||||
partList.add("WU");
|
||||
else if (feArea.equals("ds"))
|
||||
partList.add("DS");
|
||||
else if (feArea.equals("ne"))
|
||||
partList.add("NE");
|
||||
else if (feArea.equals("nw"))
|
||||
partList.add("NW");
|
||||
else if (feArea.equals("se"))
|
||||
partList.add("SE");
|
||||
else if (feArea.equals("sw"))
|
||||
partList.add("SW");
|
||||
else {
|
||||
for (int i = 0; i < feArea.length(); i++) {
|
||||
char c = feArea.charAt(i);
|
||||
switch (c) {
|
||||
case 'c':
|
||||
partList.add("CENTRAL");
|
||||
break;
|
||||
case 'w':
|
||||
partList.add("WEST");
|
||||
break;
|
||||
case 'n':
|
||||
partList.add("NORTH");
|
||||
break;
|
||||
case 'e':
|
||||
partList.add("EAST");
|
||||
break;
|
||||
case 's':
|
||||
partList.add("SOUTH");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
area.partOfParentRegion = partList;
|
||||
area.partOfParentRegion = converFeAreaToPartList(feArea);
|
||||
}
|
||||
|
||||
// Search against point matches
|
||||
|
@ -391,4 +332,68 @@ public class Area {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
public static List<String> converFeAreaToPartList(String feArea) {
|
||||
final List<String> partList = new ArrayList<String>();
|
||||
if (feArea == null) {
|
||||
// Marine warnings
|
||||
partList.add("");
|
||||
} else {
|
||||
if (feArea.equals("pa"))
|
||||
partList.add("PA");
|
||||
else if (feArea.equals("mi"))
|
||||
partList.add("MI");
|
||||
else if (feArea.equals("pd"))
|
||||
partList.add("PD");
|
||||
else if (feArea.equals("up"))
|
||||
partList.add("UP");
|
||||
else if (feArea.equals("bb"))
|
||||
partList.add("BB");
|
||||
else if (feArea.equals("er"))
|
||||
partList.add("ER");
|
||||
else if (feArea.equals("eu"))
|
||||
partList.add("EU");
|
||||
else if (feArea.equals("sr"))
|
||||
partList.add("SR");
|
||||
else if (feArea.equals("nr"))
|
||||
partList.add("NR");
|
||||
else if (feArea.equals("wu"))
|
||||
partList.add("WU");
|
||||
else if (feArea.equals("ds"))
|
||||
partList.add("DS");
|
||||
else if (feArea.equals("ne"))
|
||||
partList.add("NE");
|
||||
else if (feArea.equals("nw"))
|
||||
partList.add("NW");
|
||||
else if (feArea.equals("se"))
|
||||
partList.add("SE");
|
||||
else if (feArea.equals("sw"))
|
||||
partList.add("SW");
|
||||
else {
|
||||
for (int i = 0; i < feArea.length(); i++) {
|
||||
char c = feArea.charAt(i);
|
||||
switch (c) {
|
||||
case 'c':
|
||||
partList.add("CENTRAL");
|
||||
break;
|
||||
case 'w':
|
||||
partList.add("WEST");
|
||||
break;
|
||||
case 'n':
|
||||
partList.add("NORTH");
|
||||
break;
|
||||
case 'e':
|
||||
partList.add("EAST");
|
||||
break;
|
||||
case 's':
|
||||
partList.add("SOUTH");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return partList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,12 +22,10 @@ package com.raytheon.viz.warngen.template;
|
|||
import java.awt.geom.Point2D;
|
||||
import java.io.StringWriter;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -35,9 +33,11 @@ import java.util.Hashtable;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -45,14 +45,12 @@ import javax.measure.converter.UnitConverter;
|
|||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.tools.generic.ListTool;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
|
||||
import com.raytheon.uf.common.activetable.ActiveTableMode;
|
||||
import com.raytheon.uf.common.activetable.ActiveTableRecord;
|
||||
|
@ -60,11 +58,11 @@ import com.raytheon.uf.common.activetable.GetActiveTableRequest;
|
|||
import com.raytheon.uf.common.activetable.GetActiveTableResponse;
|
||||
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
|
||||
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration;
|
||||
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType;
|
||||
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
|
||||
import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData;
|
||||
import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialQuery.SearchMode;
|
||||
import com.raytheon.uf.common.geospatial.SpatialQueryFactory;
|
||||
import com.raytheon.uf.common.geospatial.SpatialQueryResult;
|
||||
import com.raytheon.uf.common.site.SiteMap;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -75,7 +73,6 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
import com.raytheon.uf.edex.core.EdexException;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.maps.rsc.DbMapQueryFactory;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.awipstools.common.StormTrackData;
|
||||
|
@ -101,11 +98,11 @@ import com.raytheon.viz.warngen.util.FollowUpUtil;
|
|||
import com.raytheon.viz.warngen.util.WarnGenMathTool;
|
||||
import com.raytheon.viz.warngen.util.WatchUtil;
|
||||
import com.raytheon.viz.warngen.util.WeatherAdvisoryWatch;
|
||||
import com.raytheon.viz.warngen.util.WeatherAdvisoryWatch.Portion;
|
||||
import com.raytheon.viz.warnings.DateUtil;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
|
||||
import com.vividsolutions.jts.io.WKTReader;
|
||||
|
||||
/**
|
||||
|
@ -129,6 +126,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
|||
* Aug 29, 2011 15351 jsanchez Set the timezone for TML time.
|
||||
* Sep 10, 2012 15295 snaples Added property setting for runtime log to createScript.
|
||||
* Sep 18, 2012 15332 jsanchez Used a new warning text handler.
|
||||
* Nov 9, 1202 DR 15430 D. Friedman Improve watch inclusion.
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -742,7 +740,7 @@ public class TemplateRunner {
|
|||
try {
|
||||
t0 = System.currentTimeMillis();
|
||||
WatchUtil watches = getWatches(warngenLayer, config, warnPolygon,
|
||||
fourLetterSiteId);
|
||||
fourLetterSiteId, simulatedTime);
|
||||
System.out.println("getWatches time: "
|
||||
+ (System.currentTimeMillis() - t0));
|
||||
if (watches != null) {
|
||||
|
@ -837,12 +835,13 @@ public class TemplateRunner {
|
|||
* ([template_name_site.xml])
|
||||
* @param polygon
|
||||
* The Geometry surrounded by the warning polygon.
|
||||
* @param simulatedTime
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private static WatchUtil getWatches(WarngenLayer warngenLayer,
|
||||
WarngenConfiguration config, Geometry polygon,
|
||||
String fourLetterSiteId) throws Exception {
|
||||
String fourLetterSiteId, Date simulatedTime) throws Exception {
|
||||
Validate.isTrue(config.getHatchedAreaSource()
|
||||
.getIncludedWatchAreaBuffer() >= 0,
|
||||
"IncludedWatchAreaBuffer can not be negative");
|
||||
|
@ -877,8 +876,27 @@ public class TemplateRunner {
|
|||
GetActiveTableResponse resp = (GetActiveTableResponse) ThriftClient
|
||||
.sendRequest(req);
|
||||
long t1 = System.currentTimeMillis();
|
||||
java.util.List<ActiveTableRecord> activeTable = resp
|
||||
.getActiveTable();
|
||||
java.util.List<ActiveTableRecord> respList = resp.getActiveTable();
|
||||
ArrayList<ActiveTableRecord> activeTable = new ArrayList<ActiveTableRecord>(
|
||||
respList.size());
|
||||
// Filter out entries representing non-active events.
|
||||
for (ActiveTableRecord ar : respList) {
|
||||
if ("CAN".equals(ar.getAct()) || "EXP".equals(ar.getAct()))
|
||||
continue;
|
||||
if (ar.getEndTime() == null) {
|
||||
statusHandler.handle(Priority.ERROR, String.format(
|
||||
"Watch %s has null end time; not included.",
|
||||
ar.getVtecstr()));
|
||||
continue;
|
||||
}
|
||||
// From A1 SELSparagraphs.C processWOU
|
||||
if (simulatedTime.before(new Date(ar.getStartTime().getTime()
|
||||
.getTime() - 180 * 1000))
|
||||
|| simulatedTime.after(ar.getEndTime().getTime()))
|
||||
continue;
|
||||
|
||||
activeTable.add(ar);
|
||||
}
|
||||
|
||||
System.out.println("getWatches.getActiveTable time: " + (t1 - t0)
|
||||
+ ", found "
|
||||
|
@ -902,96 +920,293 @@ public class TemplateRunner {
|
|||
t1 = System.currentTimeMillis();
|
||||
System.out.println("getWatches.createWatchGeometry time: "
|
||||
+ (t1 - t0));
|
||||
SpatialQueryResult[] parentRegionFeatures = null;
|
||||
|
||||
try {
|
||||
String field = "the_geom";
|
||||
t0 = System.currentTimeMillis();
|
||||
List<Double> results = DbMapQueryFactory.getMapQuery(
|
||||
"mapdata.states", field).getLevels();
|
||||
Collections.sort(results, Collections.reverseOrder());
|
||||
Double decimationTolerance = null;
|
||||
for (Double result : results) {
|
||||
if (result <= 0.064) {
|
||||
decimationTolerance = result;
|
||||
}
|
||||
}
|
||||
|
||||
if (decimationTolerance != null) {
|
||||
DecimalFormat df = new DecimalFormat("0.######");
|
||||
String suffix = "_"
|
||||
+ StringUtils.replaceChars(df.format(results
|
||||
.get(results.size() - 1)), '.', '_');
|
||||
parentRegionFeatures = SpatialQueryFactory.create()
|
||||
.query("states", field + suffix,
|
||||
new String[] { "Name" }, watchArea,
|
||||
null, false, SearchMode.INTERSECTS);
|
||||
} else {
|
||||
parentRegionFeatures = SpatialQueryFactory.create()
|
||||
.query("states", new String[] { "Name" },
|
||||
watchArea, null, false,
|
||||
SearchMode.INTERSECTS);
|
||||
}
|
||||
|
||||
t1 = System.currentTimeMillis();
|
||||
System.out.println("getWatches.stateSpatialQuery time: "
|
||||
+ (t1 - t0) + ", found "
|
||||
+ parentRegionFeatures.length + " states");
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error querying state geometries", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
rval = new WatchUtil();
|
||||
WeatherAdvisoryWatch watch = null;
|
||||
long cumulativeIntersect = 0;
|
||||
long cumulativeCalcPortion = 0;
|
||||
GeodeticCalculator gc = new GeodeticCalculator();
|
||||
|
||||
// For each State in our watchArea...
|
||||
for (int j = 0; j < parentRegionFeatures.length; j++) {
|
||||
Geometry parentGeom = parentRegionFeatures[j].geometry;
|
||||
List<PreparedGeometry> prepGeoms = new ArrayList<PreparedGeometry>();
|
||||
GeometryUtil.recursivePreparedGeometry(parentGeom,
|
||||
prepGeoms);
|
||||
|
||||
for (ActiveTableRecord atr : activeTable) {
|
||||
// Get the intersection of watchArea with State.
|
||||
watch = new WeatherAdvisoryWatch();
|
||||
watch.setEndTime(atr.getEndTime().getTime());
|
||||
watch.setPhensig(atr.getPhensig());
|
||||
|
||||
// If State intersections intersects with out ATR
|
||||
// record, add watch
|
||||
t0 = System.currentTimeMillis();
|
||||
boolean intersects = GeometryUtil.intersects(prepGeoms,
|
||||
atr.getGeometry());
|
||||
t1 = System.currentTimeMillis();
|
||||
cumulativeIntersect = (t1 - t0);
|
||||
|
||||
if (intersects) {
|
||||
watch.setParentRegion(parentRegionFeatures[j].attributes
|
||||
.get("Name").toString());
|
||||
|
||||
t0 = System.currentTimeMillis();
|
||||
watch.setPartOfParentRegion(GisUtil
|
||||
.asStringList(GisUtil.calculatePortion(
|
||||
parentGeom, atr.getGeometry(), gc)));
|
||||
t1 = System.currentTimeMillis();
|
||||
cumulativeCalcPortion = (t1 - t0);
|
||||
rval.addWaw(watch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("getWatches.cumulativeIntersect: "
|
||||
+ cumulativeIntersect);
|
||||
System.out.println("getWatches.cumulativeCalcPortion: "
|
||||
+ cumulativeCalcPortion);
|
||||
rval = processATEntries(activeTable, warngenLayer);
|
||||
System.out.println("getWatches.createPoritions time: "
|
||||
+ (t1 - t0));
|
||||
}
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
private static class WatchWork {
|
||||
public WeatherAdvisoryWatch waw;
|
||||
public boolean valid;
|
||||
public ArrayList<String> ugcZone = new ArrayList<String>();
|
||||
|
||||
public WatchWork(WeatherAdvisoryWatch waw) {
|
||||
this.waw = waw;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the list of objects representing active watches that will be
|
||||
* passed to the template context.
|
||||
*
|
||||
* @param activeTable
|
||||
* List of entries for active watches
|
||||
* @param warngenLayer
|
||||
* @return
|
||||
*/
|
||||
private static WatchUtil processATEntries(
|
||||
List<ActiveTableRecord> activeTable, WarngenLayer warngenLayer) {
|
||||
WatchUtil rval = new WatchUtil();
|
||||
TreeMap<WeatherAdvisoryWatch, WatchWork> map = new TreeMap<WeatherAdvisoryWatch, TemplateRunner.WatchWork>();
|
||||
|
||||
AreaSourceConfiguration asc = null;
|
||||
for (AreaSourceConfiguration a : warngenLayer.getConfiguration()
|
||||
.getAreaSources()) {
|
||||
if (a.getType() == AreaType.HATCHING) {
|
||||
asc = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (asc == null) {
|
||||
statusHandler
|
||||
.handle(Priority.ERROR,
|
||||
"Cannot process watches: missing HATCHING area source configuration");
|
||||
return rval;
|
||||
}
|
||||
GeospatialData[] geoData = warngenLayer.getGeodataFeatures(asc
|
||||
.getAreaSource() + "." + warngenLayer.getLocalizedSite());
|
||||
if (geoData == null || geoData.length == 0) {
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Cannot process watches: cannot get geospatial data");
|
||||
return rval;
|
||||
}
|
||||
|
||||
// For each watch event, get the end time and list of active zones
|
||||
for (ActiveTableRecord ar : activeTable) {
|
||||
/*
|
||||
* Currently reports all zones in the watch even if a given zone is
|
||||
* not in the warning polygon. If the logic is changed to only show
|
||||
* the portions of the watch near our warning polygon, perform the
|
||||
* isEmpty check here.
|
||||
*/
|
||||
WeatherAdvisoryWatch waw = new WeatherAdvisoryWatch();
|
||||
waw.setPhensig(ar.getPhensig());
|
||||
try {
|
||||
waw.setEventId(Integer.parseInt(ar.getEtn()));
|
||||
} catch (RuntimeException e) {
|
||||
statusHandler.handle(Priority.ERROR, String.format(
|
||||
"Watch %s has null end time; not included.",
|
||||
ar.getVtecstr()));
|
||||
continue;
|
||||
}
|
||||
|
||||
WatchWork work = map.get(waw);
|
||||
if (work == null) {
|
||||
waw.setEndTime(ar.getEndTime().getTime());
|
||||
work = new WatchWork(waw);
|
||||
map.put(waw, work);
|
||||
}
|
||||
// TODO: Building geometry just to perform this test is probably
|
||||
// inefficient with the post-DR-15430 logic...
|
||||
if (!ar.getGeometry().isEmpty())
|
||||
work.valid = true;
|
||||
|
||||
work.ugcZone.add(ar.getUgcZone());
|
||||
}
|
||||
|
||||
for (WatchWork work : map.values()) {
|
||||
/*
|
||||
* If none of the areas in the watch were neer our warning polygon,
|
||||
* do not included it.
|
||||
*/
|
||||
if (!work.valid)
|
||||
continue;
|
||||
if (determineAffectedPortions(work.ugcZone, asc, geoData, work.waw));
|
||||
rval.addWaw(work.waw);
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the list of counties in a watch, fill out the "portions" part of
|
||||
* the given WeatherAdvisoryWatch
|
||||
*
|
||||
* @param ugcs
|
||||
* @param asc
|
||||
* @param geoData
|
||||
* @param waw
|
||||
*/
|
||||
private static boolean determineAffectedPortions(List<String> ugcs,
|
||||
AreaSourceConfiguration asc, GeospatialData[] geoData,
|
||||
WeatherAdvisoryWatch waw) {
|
||||
|
||||
// Maps state abbreviation to unique fe_area values
|
||||
HashMap<String, Set<String>> map = new HashMap<String, Set<String>>();
|
||||
|
||||
for (String ugc : ugcs) {
|
||||
for (Entry<String, String[]> e : FipsUtil.parseCountyHeader(ugc).entrySet()) {
|
||||
String stateAbbrev = e.getKey();
|
||||
if (e.getValue().length != 1) // either zero or more than one
|
||||
// would be wrong
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Invalid ugczone in active table entry");
|
||||
Set<String> feAreas = map.get(stateAbbrev);
|
||||
if (feAreas == null) {
|
||||
feAreas = new HashSet<String>();
|
||||
map.put(stateAbbrev, feAreas);
|
||||
}
|
||||
try {
|
||||
feAreas.add(getFeArea(stateAbbrev, e.getValue()[0], asc,
|
||||
geoData));
|
||||
} catch (RuntimeException exc) {
|
||||
statusHandler.handle(Priority.ERROR, "Error generating included watches.", exc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<Portion> portions = new ArrayList<Portion>(map.size());
|
||||
for (Entry<String, Set<String>> e : map.entrySet()) {
|
||||
Portion portion = new Portion();
|
||||
try {
|
||||
portion.parentRegion = getStateName(e.getKey(), asc, geoData)
|
||||
.toUpperCase();
|
||||
} catch (RuntimeException exc) {
|
||||
statusHandler.handle(Priority.ERROR, "Error generating included watches.", exc);
|
||||
return false;
|
||||
}
|
||||
portion.partOfParentRegion = Area
|
||||
.converFeAreaToPartList(mungeFeAreas(e.getValue()));
|
||||
System.out.format("Munged %s to %s (%s)\n", e.getValue(),
|
||||
mungeFeAreas(e.getValue()), portion.partOfParentRegion);
|
||||
portions.add(portion);
|
||||
}
|
||||
waw.setPortions(portions);
|
||||
// Set legacy values
|
||||
if (portions.size() > 0) {
|
||||
waw.setParentRegion(portions.get(0).parentRegion);
|
||||
waw.setPartOfParentRegion(portions.get(0).partOfParentRegion);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Based on AWIPS 1 SELSparagraphs.C SELSparagraphs::processWOU().
|
||||
private static String mungeFeAreas(Set<String> feAreas) {
|
||||
String abrev = "";
|
||||
// If eight or more portions, don't qualify area of state
|
||||
int m = feAreas.size();
|
||||
if (m < 8) {
|
||||
String partAbrev = "";
|
||||
/*
|
||||
* TODO: Unused variables should be removed if we are not going to
|
||||
* improve this in A2.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
int nw, nc, ne, wc, cc, ec, sw, sc, se, pa;
|
||||
int eee, www, nnn, sss, ee, ww, nn, ss;
|
||||
|
||||
// Identify individual sub areas of this state affected
|
||||
nw = nc = ne = wc = cc = ec = sw = sc = se = pa = 0;
|
||||
eee = www = nnn = sss = ee = ww = nn = ss = 0;
|
||||
for (String part : feAreas) {
|
||||
if ("pa".equals(part)) {
|
||||
pa = 1;
|
||||
continue;
|
||||
} else if ("nn".equals(part))
|
||||
nnn = nn = 1;
|
||||
else if ("ss".equals(part))
|
||||
sss = ss = 1;
|
||||
else if ("ee".equals(part))
|
||||
eee = ee = 1;
|
||||
else if ("ww".equals(part))
|
||||
www = ww = 1;
|
||||
else if ("nw".equals(part))
|
||||
nnn = www = nw = 1;
|
||||
else if ("nc".equals(part))
|
||||
nnn = nc = 1;
|
||||
else if ("ne".equals(part))
|
||||
nnn = eee = ne = 1;
|
||||
else if ("wc".equals(part))
|
||||
www = wc = 1;
|
||||
else if ("cc".equals(part)) {
|
||||
cc = 1;
|
||||
continue;
|
||||
} else if ("ec".equals(part))
|
||||
eee = ec = 1;
|
||||
else if ("sw".equals(part))
|
||||
sss = www = sw = 1;
|
||||
else if ("sc".equals(part))
|
||||
sss = sc = 1;
|
||||
else if ("se".equals(part))
|
||||
sss = eee = se = 1;
|
||||
partAbrev = part;
|
||||
}
|
||||
// decide how to describe these subareas.
|
||||
if (ne > 0 && nw > 0)
|
||||
nn = 1;
|
||||
if (se > 0 && sw > 0)
|
||||
ss = 1;
|
||||
if (se > 0 && ne > 0)
|
||||
ee = 1;
|
||||
if (sw > 0 && nw > 0)
|
||||
ww = 1;
|
||||
if (nnn > 0 && sss > 0 && eee > 0 && www > 0)
|
||||
return abrev;
|
||||
if (nn > 0 && ss > 0 || ee > 0 && ww > 0)
|
||||
return abrev;
|
||||
if (nnn + sss + eee + www == 3) {
|
||||
if (www == 0) {
|
||||
abrev = "e";
|
||||
} else if (eee == 0) {
|
||||
abrev = "w";
|
||||
} else if (nnn == 0) {
|
||||
abrev = "s";
|
||||
} else if (sss == 0) {
|
||||
abrev = "n";
|
||||
}
|
||||
return abrev;
|
||||
}
|
||||
if (nnn == sss && eee == www || cc == m) {
|
||||
abrev = "c";
|
||||
return abrev;
|
||||
}
|
||||
if (pa != 0 && cc == 0) {
|
||||
abrev = "pa";
|
||||
if (--m <= 0) {
|
||||
return abrev;
|
||||
}
|
||||
}
|
||||
if (m == 1 + cc) {
|
||||
abrev += partAbrev + " ";
|
||||
return abrev;
|
||||
}
|
||||
if (nnn != sss) {
|
||||
abrev += nnn != 0 ? "n" : "s";
|
||||
}
|
||||
if (eee != www) {
|
||||
abrev += eee != 0 ? "e" : "w";
|
||||
}
|
||||
}
|
||||
return abrev;
|
||||
}
|
||||
|
||||
private static String getStateName(String key, AreaSourceConfiguration asc,
|
||||
GeospatialData[] geoData) {
|
||||
for (GeospatialData g : geoData) {
|
||||
if (key.equals((String) g.attributes.get("STATE")))
|
||||
return (String) g.parent.attributes.get("NAME");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String getFeArea(String stateAbbrev, String ugc,
|
||||
AreaSourceConfiguration asc, GeospatialData[] geoData) {
|
||||
for (GeospatialData g : geoData) {
|
||||
if (stateAbbrev.equals((String) g.attributes.get("STATE"))
|
||||
&& ((String) g.attributes.get(asc.getFipsField()))
|
||||
.endsWith(ugc))
|
||||
return (String) g.attributes.get(asc.getFeAreaField());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.List;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 1, 2009 bwoodle Initial creation
|
||||
* Nov 9, 2012 DR 15430 D. Friedman Support proper watch inclusion language
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -40,12 +41,44 @@ import java.util.List;
|
|||
|
||||
public class WeatherAdvisoryWatch implements Comparable<WeatherAdvisoryWatch> {
|
||||
|
||||
public static class Portion {
|
||||
public String parentRegion;
|
||||
|
||||
public List<String> partOfParentRegion;
|
||||
|
||||
public String getParentRegion() {
|
||||
return parentRegion;
|
||||
}
|
||||
|
||||
public void setParentRegion(String parentRegion) {
|
||||
this.parentRegion = parentRegion;
|
||||
}
|
||||
|
||||
public List<String> getPartOfParentRegion() {
|
||||
return partOfParentRegion;
|
||||
}
|
||||
|
||||
public void setPartOfParentRegion(List<String> partOfParentRegion) {
|
||||
this.partOfParentRegion = partOfParentRegion;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: NOTE: There is no site field. We currently only process
|
||||
* WCNs for the site and not WOUs from the SPC.
|
||||
*/
|
||||
|
||||
private String phensig;
|
||||
|
||||
private int eventId;
|
||||
|
||||
private Date endTime;
|
||||
|
||||
private List<Portion> portions;
|
||||
|
||||
@Deprecated
|
||||
private String parentRegion;
|
||||
|
||||
@Deprecated
|
||||
private List<String> partOfParentRegion;
|
||||
|
||||
public String getPhensig() {
|
||||
|
@ -64,23 +97,59 @@ public class WeatherAdvisoryWatch implements Comparable<WeatherAdvisoryWatch> {
|
|||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getParentRegion() {
|
||||
return parentRegion;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setParentRegion(String parentRegion) {
|
||||
this.parentRegion = parentRegion;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public List<String> getPartOfParentRegion() {
|
||||
return partOfParentRegion;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setPartOfParentRegion(List<String> partOfParentRegion) {
|
||||
this.partOfParentRegion = partOfParentRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof WeatherAdvisoryWatch &&
|
||||
this.compareTo((WeatherAdvisoryWatch) obj) == 0;
|
||||
}
|
||||
|
||||
public int compareTo(WeatherAdvisoryWatch waw) {
|
||||
return this.parentRegion.compareTo(waw.getParentRegion());
|
||||
if (this.phensig == null)
|
||||
return waw.phensig == null ? 0 : -1;
|
||||
else if (waw.phensig == null)
|
||||
return 1;
|
||||
else {
|
||||
int c = this.phensig.compareTo(waw.phensig);
|
||||
if (c == 0)
|
||||
return this.eventId - waw.eventId;
|
||||
else
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEventId() {
|
||||
return eventId;
|
||||
}
|
||||
|
||||
public void setEventId(int eventId) {
|
||||
this.eventId = eventId;
|
||||
}
|
||||
|
||||
public List<Portion> getPortions() {
|
||||
return portions;
|
||||
}
|
||||
|
||||
public void setPortions(List<Portion> portions) {
|
||||
this.portions = portions;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
##### Qinglu Lin 06-18-2012 DR 15043. Use duration in secondBullet.
|
||||
##### Qinglu Lin 07-31-2012 DR 15217. Use roundAndPad for movement direction in DEG.
|
||||
##### Qinglu Lin 08-13-2012 DR 14493. Use corToNewMarker and corEventtime.
|
||||
##### D. Friedman 11-09-2012 DR 15430. Rework included watches.
|
||||
####################################################################################################
|
||||
Mile Marker Test Code
|
||||
macro "mmarkers" use (called out of VM_global_library.vm):
|
||||
|
@ -146,52 +147,66 @@ ${drainage.name}##
|
|||
|
||||
#macro(inserttorwatches $watches $list $secondtimezone $dateUtil $timeFormat)
|
||||
#set($torWatches = ${watches.getTorWatches()})
|
||||
#if(${list.size($torWatches)} > 0)
|
||||
A TORNADO WATCH REMAINS IN EFFECT UNTIL ${dateUtil.format(${watches.getLatestTorTime()}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#set($torWatchAlso = "")
|
||||
#set($torWatchFirst = 1)
|
||||
#foreach(${watch} in ${torWatches})
|
||||
#if($torWatchFirst)
|
||||
#set($torWatchFirst = 0)
|
||||
##
|
||||
#end
|
||||
A TORNADO WATCH ${torWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
${dateUtil.period(${watches.getLatestTorTime()},${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#if(${secondtimezone})
|
||||
/${dateUtil.format(${list.get($torWatches, 0).endTime}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
/${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
#end
|
||||
FOR ##
|
||||
#set($numWatches = ${list.size($torWatches)})
|
||||
#set($numPortions = ${list.size(${watch.getPortions()})})
|
||||
#set($count = 0)
|
||||
#foreach(${watch} in ${torWatches})
|
||||
#foreach(${portion} in ${watch.getPortions()})
|
||||
#set($count = $count + 1)
|
||||
#areaFormat(${watch.partOfParentRegion} true false) ${watch.parentRegion}##
|
||||
#if($count == $numWatches - 1)
|
||||
#areaFormat(${portion.partOfParentRegion} true false) ${portion.parentRegion}##
|
||||
#if($count == $numPortions - 1)
|
||||
AND ##
|
||||
#elseif($count < $numWatches)
|
||||
#elseif($count < $numPortions)
|
||||
...##
|
||||
#end
|
||||
#end
|
||||
.
|
||||
|
||||
#set($torWatchAlso = "ALSO ")
|
||||
.##
|
||||
#end
|
||||
|
||||
#end
|
||||
|
||||
#macro(insertsvrwatches $watches $list $secondtimezone $dateUtil $timeFormat)
|
||||
#set($svrWatches = ${watches.getSvrWatches()})
|
||||
#if(${list.size($svrWatches)} > 0)
|
||||
A SEVERE THUNDERSTORM WATCH REMAINS IN EFFECT UNTIL ${dateUtil.format(${watches.getLatestSvrTime()}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#set($svrWatchAlso = "")
|
||||
#set($svrWatchFirst = 1)
|
||||
#foreach(${watch} in ${svrWatches})
|
||||
#if($svrWatchFirst)
|
||||
#set($svrWatchFirst = 0)
|
||||
##
|
||||
#end
|
||||
A SEVERE THUNDERSTORM WATCH ${svrWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
${dateUtil.period(${watches.getLatestSvrTime()},${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#if(${secondtimezone})
|
||||
/${dateUtil.format(${list.get($svrWatches, 0).endTime}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
/${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
#end
|
||||
FOR ##
|
||||
#set($numWatches = ${list.size($svrWatches)})
|
||||
#set($numPortions = ${list.size(${watch.getPortions()})})
|
||||
#set($count = 0)
|
||||
#foreach(${watch} in ${svrWatches})
|
||||
#foreach(${portion} in ${watch.getPortions()})
|
||||
#set($count = $count + 1)
|
||||
#areaFormat(${watch.partOfParentRegion} true false) ${watch.parentRegion}##
|
||||
#if($count == $numWatches - 1)
|
||||
#areaFormat(${portion.partOfParentRegion} true false) ${portion.parentRegion}##
|
||||
#if($count == $numPortions - 1)
|
||||
AND ##
|
||||
#elseif($count < $numWatches)
|
||||
#elseif($count < $numPortions)
|
||||
...##
|
||||
#end
|
||||
#end
|
||||
.
|
||||
|
||||
#set($svrWatchAlso = "ALSO ")
|
||||
.##
|
||||
#end
|
||||
|
||||
#end
|
||||
|
||||
#macro(printcoords $coordinates $list)
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>250160</name>
|
||||
<description>QPF Grid for TIR (Ohio Basin RFC Wilmington, Ohio)</description>
|
||||
<la1>36.19</la1>
|
||||
<lo1>-91.347</lo1>
|
||||
<la1>36.203</la1>
|
||||
<lo1>-91.320</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>250</nx>
|
||||
<ny>260</ny>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240161</name>
|
||||
<description>HRAP Grid for ALR (Southeast RFC Peachtree, Georgia)</description>
|
||||
<la1>27.033</la1>
|
||||
<lo1>-91.417</lo1>
|
||||
<la1>27.045</la1>
|
||||
<lo1>-91.395</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>335</nx>
|
||||
<ny>412</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240162</name>
|
||||
<description>HRAP Grid for WFR (West Gulf RFC Fort Worth, Texas)</description>
|
||||
<la1>24.852</la1>
|
||||
<lo1>-108.99</lo1>
|
||||
<la1>24.869</la1>
|
||||
<lo1>-108.973</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>425</nx>
|
||||
<ny>390</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240156</name>
|
||||
<description>HRAP Grid for KRF (Missouri Basin RFC Pleasant Hill, Missouri)</description>
|
||||
<la1>37.275</la1>
|
||||
<lo1>-112.71</lo1>
|
||||
<la1>37.296</la1>
|
||||
<lo1>-112.690</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>485</nx>
|
||||
<ny>325</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240157</name>
|
||||
<description>HRAP Grid for MSR (North Central RFC Chanhassen, Minnesota)</description>
|
||||
<la1>37.87</la1>
|
||||
<lo1>-105.515</lo1>
|
||||
<la1>37.889</la1>
|
||||
<lo1>-105.492</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>450</nx>
|
||||
<ny>350</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240154</name>
|
||||
<description>HRAP Grid for ORN (Lower Mississippi RFC Slidel, Louisiana)</description>
|
||||
<la1>28.686</la1>
|
||||
<lo1>-98.791</lo1>
|
||||
<la1>28.701</la1>
|
||||
<lo1>-98.770</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>419</nx>
|
||||
<ny>419</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240159</name>
|
||||
<description>HRAP Grid for PTR (Northwest RFC Portland, Oregon)</description>
|
||||
<la1>37.952</la1>
|
||||
<lo1>-124.207</lo1>
|
||||
<la1>38.00</la1>
|
||||
<lo1>-124.179</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>400</nx>
|
||||
<ny>378</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240155</name>
|
||||
<description>HRAP Grid for RHA (Middle Atlantic RFC State College, PA)</description>
|
||||
<la1>38.025</la1>
|
||||
<lo1>-83.346</lo1>
|
||||
<la1>38.035</la1>
|
||||
<lo1>-83.315</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>200</nx>
|
||||
<ny>200</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240153</name>
|
||||
<description>HRAP Grid for RSA (California-Nevada RFC Sacramento, California)</description>
|
||||
<la1>30.91</la1>
|
||||
<lo1>-120.872</lo1>
|
||||
<la1>30.931</la1>
|
||||
<lo1>-120.858</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>235</nx>
|
||||
<ny>335</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240152</name>
|
||||
<description>HRAP Grid for STR (Colorado Basin RFC Salt Lake City, Utah)</description>
|
||||
<la1>30.027</la1>
|
||||
<lo1>-114.429</lo1>
|
||||
<la1>30.047</la1>
|
||||
<lo1>-114.413</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>260</nx>
|
||||
<ny>360</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240158</name>
|
||||
<description>HRAP Grid for TAR (Northeast RFC Taunton, Massachusetts)</description>
|
||||
<la1>42.057</la1>
|
||||
<lo1>-80.004</lo1>
|
||||
<la1>42.066</la1>
|
||||
<lo1>-79.970</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>180</nx>
|
||||
<ny>235</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<polarStereoGridCoverage>
|
||||
<name>240150</name>
|
||||
<description>HRAP Grid for TUA (Arkansas-Red River RFC Tulsa, Oklahoma)</description>
|
||||
<la1>33.603</la1>
|
||||
<lo1>-106.455</lo1>
|
||||
<la1>33.621</la1>
|
||||
<lo1>-106.434</lo1>
|
||||
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
|
||||
<nx>335</nx>
|
||||
<ny>159</ny>
|
||||
<dx>4.762</dx>
|
||||
<dy>4.762</dy>
|
||||
<dx>4.7625</dx>
|
||||
<dy>4.7625</dy>
|
||||
<spacingUnit>km</spacingUnit>
|
||||
<minorAxis>6371229.0</minorAxis>
|
||||
<majorAxis>6371229.0</majorAxis>
|
||||
|
|
|
@ -94,6 +94,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* reprojectGeometry.
|
||||
* 06/19/2012 14988 D. Friedman Make oversampling more like AWIPS 1
|
||||
* 09/18/2012 #1091 randerso corrected getBoundingEnvelope
|
||||
* 11/06/2012 15406 ryu Added convertToNativeEnvelope()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -269,6 +270,55 @@ public class MapUtil {
|
|||
return generalEnvelope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a native envelope from the grid domain represented
|
||||
* by the lower left and the upper right corners.
|
||||
*
|
||||
* @param ll
|
||||
* lower left of the grid envelope
|
||||
* @param ur
|
||||
* upper right of the grid envelope
|
||||
* @param gloc
|
||||
* grid location object
|
||||
* @return a native envelope
|
||||
*
|
||||
*/
|
||||
public static GeneralEnvelope convertToNativeEnvelope(
|
||||
Coordinate ll, Coordinate ur, ISpatialObject gloc) {
|
||||
GeneralEnvelope generalEnvelope = new GeneralEnvelope(2);
|
||||
generalEnvelope.setCoordinateReferenceSystem(gloc.getCrs());
|
||||
|
||||
double minX = Double.POSITIVE_INFINITY;
|
||||
double maxX = Double.NEGATIVE_INFINITY;
|
||||
double minY = Double.POSITIVE_INFINITY;
|
||||
double maxY = Double.NEGATIVE_INFINITY;
|
||||
|
||||
for (Coordinate p : new Coordinate[]{ll, ur}) {
|
||||
Coordinate translated = gridCoordinateToNative(p,
|
||||
PixelOrientation.CENTER, gloc);
|
||||
double x = translated.x;
|
||||
double y = translated.y;
|
||||
|
||||
if (x < minX) {
|
||||
minX = x;
|
||||
}
|
||||
if (x > maxX) {
|
||||
maxX = x;
|
||||
}
|
||||
if (y < minY) {
|
||||
minY = y;
|
||||
}
|
||||
if (y > maxY) {
|
||||
maxY = y;
|
||||
}
|
||||
}
|
||||
|
||||
generalEnvelope.setRange(0, minX, maxX);
|
||||
generalEnvelope.setRange(1, minY, maxY);
|
||||
|
||||
return generalEnvelope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reproject a grid coverage into a different coordinate reference system
|
||||
*
|
||||
|
|
|
@ -45,6 +45,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 14, 2010 chammack Initial creation
|
||||
*
|
||||
* 10/30/2012 15448 Xiaochuan Check if container != null first in from().
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -157,6 +159,8 @@ public class PointDataThriftContainer implements ISerializableObject {
|
|||
List<StringPointDataObject> stringTypes = new ArrayList<StringPointDataObject>();
|
||||
List<LongPointDataObject> longTypes = new ArrayList<LongPointDataObject>();
|
||||
|
||||
if( container != null )
|
||||
{
|
||||
for (Map.Entry<String, AbstractPointDataObject<?>> v : container.pointDataTypes
|
||||
.entrySet()) {
|
||||
AbstractPointDataObject<?> o = v.getValue();
|
||||
|
@ -173,6 +177,7 @@ public class PointDataThriftContainer implements ISerializableObject {
|
|||
+ o.getClass().getName()
|
||||
+ ". Code must be updated to support new type");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pdtc.intData = intTypes
|
||||
|
@ -185,6 +190,7 @@ public class PointDataThriftContainer implements ISerializableObject {
|
|||
.size()]);
|
||||
|
||||
pdtc.size = container.getAllocatedSz();
|
||||
}
|
||||
|
||||
return pdtc;
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<purgeRuleSet>
|
||||
<defaultRule>
|
||||
<versionsToKeep>24</versionsToKeep>
|
||||
<delta>=00-01:00:00</delta>
|
||||
<round>00-01:00:00</round>
|
||||
</defaultRule>
|
||||
</purgeRuleSet>
|
|
@ -8,7 +8,7 @@ Summary: Pypies Apache HTTP Server
|
|||
Name: awips2-httpd-pypies
|
||||
Version: 2.2.3
|
||||
# This Is Officially Release: 22%{?dist}
|
||||
Release: 28%{?dist}
|
||||
Release: 29%{?dist}
|
||||
URL: http://httpd.apache.org/
|
||||
Prefix: /awips2/httpd_pypies
|
||||
Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Name: awips2-ldm
|
||||
Summary: AWIPS II LDM Distribution
|
||||
Version: 6.8.1
|
||||
Release: 23
|
||||
Release: 24
|
||||
Group: AWIPSII
|
||||
BuildRoot: /tmp
|
||||
URL: N/A
|
||||
|
|
|
@ -59,12 +59,14 @@ EXEC "dvbs_multicast -b 40000 -m 224.0.1.1"
|
|||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.2"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.3"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.4"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.5"
|
||||
#
|
||||
# readnoaaport shared memory readers
|
||||
EXEC "readnoaaport -m 224.0.1.1 -n -u 3 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.2 -n -u 4 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.3 -n -u 5 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.4 -n -u 6 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.5 -n -u 7 -t mhs -r 1"
|
||||
#
|
||||
# rtstats uses the LDM to send product latency statistics to the UPC.
|
||||
# For more info on rtstats please see the man page.
|
||||
|
|
|
@ -59,12 +59,14 @@ EXEC "dvbs_multicast -b 40000 -m 224.0.1.1"
|
|||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.2"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.3"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.4"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.5"
|
||||
#
|
||||
# readnoaaport shared memory readers
|
||||
EXEC "readnoaaport -m 224.0.1.1 -n -u 3 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.2 -n -u 4 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.3 -n -u 5 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.4 -n -u 6 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.5 -n -u 7 -t mhs -r 1"
|
||||
#
|
||||
# rtstats uses the LDM to send product latency statistics to the UPC.
|
||||
# For more info on rtstats please see the man page.
|
||||
|
|
|
@ -59,12 +59,14 @@ EXEC "dvbs_multicast -b 40000 -m 224.0.1.1"
|
|||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.2"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.3"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.4"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.5"
|
||||
#
|
||||
# readnoaaport shared memory readers
|
||||
EXEC "readnoaaport -m 224.0.1.1 -n -u 3 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.2 -n -u 4 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.3 -n -u 5 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.4 -n -u 6 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.5 -n -u 7 -t mhs -r 1"
|
||||
#
|
||||
# rtstats uses the LDM to send product latency statistics to the UPC.
|
||||
# For more info on rtstats please see the man page.
|
||||
|
|
|
@ -59,12 +59,14 @@ EXEC "dvbs_multicast -b 40000 -m 224.0.1.1"
|
|||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.2"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.3"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.4"
|
||||
EXEC "dvbs_multicast -b 40000 -m 224.0.1.5"
|
||||
#
|
||||
# readnoaaport shared memory readers
|
||||
EXEC "readnoaaport -m 224.0.1.1 -n -u 3 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.2 -n -u 4 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.3 -n -u 5 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.4 -n -u 6 -t mhs -r 1"
|
||||
EXEC "readnoaaport -m 224.0.1.5 -n -u 7 -t mhs -r 1"
|
||||
#
|
||||
# rtstats uses the LDM to send product latency statistics to the UPC.
|
||||
# For more info on rtstats please see the man page.
|
||||
|
|
|
@ -311,6 +311,12 @@ if [ "${1}" = "-ade" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Build the source jar file
|
||||
ade_work_dir="/home/dmsys/Dim12/build/AWIPS2/AWIPS2-ADE-OB12.11.2-CM"
|
||||
cd $ade_work_dir
|
||||
./build_source_jar.sh
|
||||
cp -v /tmp/awips2-ade-baseline-SOURCES.jar ${WORKSPACE}/${ade_directory}
|
||||
|
||||
# Tar the directory.
|
||||
pushd . > /dev/null 2>&1
|
||||
cd ${WORKSPACE}
|
||||
|
|
Loading…
Add table
Reference in a new issue