Issue #189 switch rpg to use grid data.
Former-commit-id: 2a166f22d69d2e83dce6f101145b542d8b4144c7
This commit is contained in:
parent
6879a81436
commit
b702ebdf55
2 changed files with 30 additions and 35 deletions
|
@ -7,21 +7,16 @@ Bundle-Vendor: Raytheon
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.11.24",
|
Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.11.24",
|
||||||
com.raytheon.uf.common.status;bundle-version="1.11.24",
|
com.raytheon.uf.common.status;bundle-version="1.11.24",
|
||||||
com.raytheon.uf.common.serialization;bundle-version="1.11.24",
|
|
||||||
com.raytheon.rcm.lib;bundle-version="1.11.24",
|
com.raytheon.rcm.lib;bundle-version="1.11.24",
|
||||||
com.raytheon.uf.common.time;bundle-version="1.11.24",
|
|
||||||
org.apache.tools.bzip2;bundle-version="1.0.0",
|
|
||||||
com.raytheon.edex.uengine;bundle-version="1.11.24",
|
com.raytheon.edex.uengine;bundle-version="1.11.24",
|
||||||
com.raytheon.uf.common.dataplugin.grib;bundle-version="1.11.24",
|
com.raytheon.uf.common.dataplugin.grid,
|
||||||
com.raytheon.uf.common.dataplugin;bundle-version="1.11.24",
|
|
||||||
com.raytheon.uf.common.geospatial;bundle-version="1.11.24",
|
|
||||||
org.geotools;bundle-version="2.5.8",
|
|
||||||
javax.measure;bundle-version="1.0.0",
|
javax.measure;bundle-version="1.0.0",
|
||||||
com.raytheon.edex.common;bundle-version="1.11.24",
|
com.raytheon.edex.common;bundle-version="1.11.24",
|
||||||
javax.jms;bundle-version="1.0.0",
|
javax.jms;bundle-version="1.0.0",
|
||||||
com.raytheon.edex.plugin.radar;bundle-version="1.12.1174",
|
com.raytheon.edex.plugin.radar;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0"
|
com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174"
|
||||||
Import-Package: com.raytheon.uf.common.dataplugin.radar,
|
Import-Package: com.raytheon.uf.common.dataplugin.radar,
|
||||||
com.raytheon.uf.common.dataplugin.radar.request,
|
com.raytheon.uf.common.dataplugin.radar.request,
|
||||||
com.raytheon.uf.common.ohd,
|
com.raytheon.uf.common.ohd,
|
||||||
|
|
|
@ -63,7 +63,8 @@ import com.raytheon.rcm.mqsrvr.ReplyObj.ConfigReply;
|
||||||
import com.raytheon.rcm.mqsrvr.ReqObj;
|
import com.raytheon.rcm.mqsrvr.ReqObj;
|
||||||
import com.raytheon.rcm.mqsrvr.ReqObj.SendMessageToRPG;
|
import com.raytheon.rcm.mqsrvr.ReqObj.SendMessageToRPG;
|
||||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||||
import com.raytheon.uf.common.dataplugin.grib.GribRecord;
|
import com.raytheon.uf.common.dataplugin.grid.GridConstants;
|
||||||
|
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
|
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
|
||||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
|
@ -154,9 +155,10 @@ public class RPGEnvironmentalDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gridDao = PluginFactory.getInstance().getPluginDao("grib");
|
gridDao = PluginFactory.getInstance().getPluginDao(
|
||||||
|
GridConstants.GRID);
|
||||||
} catch (PluginException e) {
|
} catch (PluginException e) {
|
||||||
log(Priority.SIGNIFICANT, "Unable to get grib dao", e);
|
log(Priority.SIGNIFICANT, "Unable to get grid dao", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
rcmClient = new MyRcmClient();
|
rcmClient = new MyRcmClient();
|
||||||
|
@ -622,7 +624,7 @@ public class RPGEnvironmentalDataManager {
|
||||||
|
|
||||||
for (Field field : configuration.fields) {
|
for (Field field : configuration.fields) {
|
||||||
for (Level levelSpec : field.levels) {
|
for (Level levelSpec : field.levels) {
|
||||||
List<GribRecord> records = inventory(dataTime, field,
|
List<GridRecord> records = inventory(dataTime, field,
|
||||||
levelSpec);
|
levelSpec);
|
||||||
if (records == null) {
|
if (records == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -636,9 +638,8 @@ public class RPGEnvironmentalDataManager {
|
||||||
levelSpec);
|
levelSpec);
|
||||||
// TODO: more efficient matching
|
// TODO: more efficient matching
|
||||||
for (Double level : levelList) {
|
for (Double level : levelList) {
|
||||||
for (GribRecord rec : records) {
|
for (GridRecord rec : records) {
|
||||||
if (rec.getModelInfo().getLevelOneValue()
|
if (level.equals(rec.getLevel().getLevelonevalue())) {
|
||||||
.equals(level)) {
|
|
||||||
grids.add(generateGrid(radarID, field,
|
grids.add(generateGrid(radarID, field,
|
||||||
levelSpec, level, geoInfo.gridDomain,
|
levelSpec, level, geoInfo.gridDomain,
|
||||||
geoInfo.clipDomain, rec));
|
geoInfo.clipDomain, rec));
|
||||||
|
@ -721,7 +722,7 @@ public class RPGEnvironmentalDataManager {
|
||||||
|
|
||||||
GridComponent generateGrid(String radarID, Field field,
|
GridComponent generateGrid(String radarID, Field field,
|
||||||
Level levelSpec, double level, GridEnvelope2D domain,
|
Level levelSpec, double level, GridEnvelope2D domain,
|
||||||
GridEnvelope2D clip, GribRecord gridRecord) {
|
GridEnvelope2D clip, GridRecord gridRecord) {
|
||||||
|
|
||||||
int clippedNx = clip.getSpan(0);
|
int clippedNx = clip.getSpan(0);
|
||||||
int clippedNy = clip.getSpan(1);
|
int clippedNy = clip.getSpan(1);
|
||||||
|
@ -787,7 +788,7 @@ public class RPGEnvironmentalDataManager {
|
||||||
DatabaseQuery q = new DatabaseQuery(gridDao.getDaoClass()
|
DatabaseQuery q = new DatabaseQuery(gridDao.getDaoClass()
|
||||||
.getName());
|
.getName());
|
||||||
q.addDistinctParameter("dataTime");
|
q.addDistinctParameter("dataTime");
|
||||||
q.addQueryParam("modelInfo.modelName",
|
q.addQueryParam(GridConstants.DATASET_ID,
|
||||||
configuration.model.name);
|
configuration.model.name);
|
||||||
q.addOrder("dataTime.refTime", false);
|
q.addOrder("dataTime.refTime", false);
|
||||||
q.addOrder("dataTime.fcstTime", false);
|
q.addOrder("dataTime.fcstTime", false);
|
||||||
|
@ -858,7 +859,7 @@ public class RPGEnvironmentalDataManager {
|
||||||
|
|
||||||
for (Field field : configuration.fields) {
|
for (Field field : configuration.fields) {
|
||||||
for (Level levelSpec : field.levels) {
|
for (Level levelSpec : field.levels) {
|
||||||
List<GribRecord> records = inventory(dt, field,
|
List<GridRecord> records = inventory(dt, field,
|
||||||
levelSpec);
|
levelSpec);
|
||||||
if (records == null) {
|
if (records == null) {
|
||||||
continue dataTimeLoop;
|
continue dataTimeLoop;
|
||||||
|
@ -866,8 +867,7 @@ public class RPGEnvironmentalDataManager {
|
||||||
|
|
||||||
if (gridCoverage == null) {
|
if (gridCoverage == null) {
|
||||||
if (records.size() > 0) {
|
if (records.size() > 0) {
|
||||||
gridCoverage = records.get(0).getModelInfo()
|
gridCoverage = records.get(0).getLocation();
|
||||||
.getLocation();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,9 +878,9 @@ public class RPGEnvironmentalDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
int nFound = 0;
|
int nFound = 0;
|
||||||
for (GribRecord gr : records) {
|
for (GridRecord gr : records) {
|
||||||
if (desiredLevels.contains(gr.getModelInfo()
|
if (desiredLevels.contains(gr.getLevel()
|
||||||
.getLevelOneValue())) {
|
.getLevelonevalue())) {
|
||||||
++nFound;
|
++nFound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -901,17 +901,17 @@ public class RPGEnvironmentalDataManager {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<GribRecord> inventory(DataTime dataTime, Field field,
|
private List<GridRecord> inventory(DataTime dataTime, Field field,
|
||||||
Level levelSpec) {
|
Level levelSpec) {
|
||||||
try {
|
try {
|
||||||
TermQuery q = new TermQuery("grib");
|
TermQuery q = new TermQuery(GridConstants.GRID);
|
||||||
q.addParameter("modelInfo.modelName", configuration.model.name);
|
q.addParameter(GridConstants.DATASET_ID,
|
||||||
q.addParameter("modelInfo.parameterAbbreviation", field.name);
|
configuration.model.name);
|
||||||
q.addParameter("modelInfo.level.masterLevel.name",
|
q.addParameter(GridConstants.PARAMETER_ABBREVIATION, field.name);
|
||||||
levelSpec.name);
|
q.addParameter(GridConstants.MASTER_LEVEL_NAME, levelSpec.name);
|
||||||
q.addParameter("dataTime", dataTime.toString());
|
q.addParameter("dataTime", dataTime.toString());
|
||||||
|
|
||||||
return (List<GribRecord>) (List<?>) q.execute();
|
return (List<GridRecord>) (List<?>) q.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log(Priority.SIGNIFICANT, String.format(
|
log(Priority.SIGNIFICANT, String.format(
|
||||||
"Unable to get inventory for %s %s %s",
|
"Unable to get inventory for %s %s %s",
|
||||||
|
@ -1057,14 +1057,14 @@ public class RPGEnvironmentalDataManager {
|
||||||
}
|
}
|
||||||
DatabaseQuery q = new DatabaseQuery(gridDao.getDaoClass()
|
DatabaseQuery q = new DatabaseQuery(gridDao.getDaoClass()
|
||||||
.getName());
|
.getName());
|
||||||
q.addDistinctParameter("modelInfo.level.levelonevalue");
|
q.addDistinctParameter(GridConstants.LEVEL_ONE);
|
||||||
q.addQueryParam("modelInfo.modelName",
|
q.addQueryParam(GridConstants.DATASET_ID,
|
||||||
configuration.model.name);
|
configuration.model.name);
|
||||||
q.addQueryParam("modelInfo.parameterAbbreviation",
|
q.addQueryParam(GridConstants.PARAMETER_ABBREVIATION,
|
||||||
field.name);
|
field.name);
|
||||||
q.addQueryParam("modelInfo.level.masterLevel.name",
|
q.addQueryParam(GridConstants.MASTER_LEVEL_NAME,
|
||||||
levelSpec.name);
|
levelSpec.name);
|
||||||
q.addOrder("modelInfo.level.levelonevalue", true);
|
q.addOrder(GridConstants.LEVEL_ONE, true);
|
||||||
levels = (List<Double>) gridDao.queryByCriteria(q);
|
levels = (List<Double>) gridDao.queryByCriteria(q);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log(Priority.SIGNIFICANT, String.format(
|
log(Priority.SIGNIFICANT, String.format(
|
||||||
|
|
Loading…
Add table
Reference in a new issue