Issue #1638 Made pypies slab reads work in more than 2-d data. Moved DecisionTree to common.dataquery. Merged changes into CAVEApplication.
Amend: Deleted old DecisionTree Change-Id: Id51a32c42f5485a5261dd73f88f55a6fda3263c8 Former-commit-id:14dba9a749
[formerlyea2501abbb
] [formerly40c76c2c82
[formerly 4f76cfa7102f2b266bc94dbeb4ed6d2e4028c106]] Former-commit-id:40c76c2c82
Former-commit-id:fc27ac4a30
This commit is contained in:
parent
ced7f55d63
commit
48a283f0f2
7 changed files with 46 additions and 12 deletions
|
@ -31,13 +31,13 @@ import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.dataquery.DecisionTree;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||||
import com.raytheon.uf.viz.core.datastructure.DecisionTree;
|
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.URICatalog.IURIRefreshCallback;
|
import com.raytheon.uf.viz.core.rsc.URICatalog.IURIRefreshCallback;
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ package com.raytheon.uf.viz.core.rsc.updater;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.dataquery.DecisionTree;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.viz.core.datastructure.DecisionTree;
|
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
import com.raytheon.uf.viz.core.rsc.IDisposeListener;
|
import com.raytheon.uf.viz.core.rsc.IDisposeListener;
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ import com.raytheon.uf.viz.core.RecordFactory;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.localization.CAVELocalizationNotificationObserver;
|
import com.raytheon.uf.viz.core.localization.CAVELocalizationNotificationObserver;
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
|
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
|
||||||
|
import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
|
||||||
import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor;
|
import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor;
|
||||||
import com.raytheon.viz.alerts.jobs.AutoUpdater;
|
import com.raytheon.viz.alerts.jobs.AutoUpdater;
|
||||||
import com.raytheon.viz.alerts.jobs.MenuUpdater;
|
import com.raytheon.viz.alerts.jobs.MenuUpdater;
|
||||||
|
@ -129,11 +130,21 @@ public class CAVEApplication implements IStandaloneComponent {
|
||||||
// dialog which would break gfeClient-based cron jobs.
|
// dialog which would break gfeClient-based cron jobs.
|
||||||
return IApplication.EXIT_OK;
|
return IApplication.EXIT_OK;
|
||||||
}
|
}
|
||||||
initializeSerialization();
|
|
||||||
|
Job serializationJob = initializeSerialization();
|
||||||
initializeDataStoreFactory();
|
initializeDataStoreFactory();
|
||||||
initializeObservers();
|
initializeObservers();
|
||||||
initializeSimulatedTime();
|
initializeSimulatedTime();
|
||||||
|
|
||||||
|
// wait for serialization initialization to complete before
|
||||||
|
// opening JMS connection to avoid deadlock in class loaders
|
||||||
|
if (serializationJob != null) {
|
||||||
|
serializationJob.join();
|
||||||
|
}
|
||||||
|
|
||||||
|
// open JMS connection to allow alerts to be received
|
||||||
|
NotificationManagerJob.connect();
|
||||||
|
|
||||||
int returnCode = IApplication.EXIT_OK;
|
int returnCode = IApplication.EXIT_OK;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -154,6 +165,14 @@ public class CAVEApplication implements IStandaloneComponent {
|
||||||
// catch any exceptions to ensure rest of finally block
|
// catch any exceptions to ensure rest of finally block
|
||||||
// executes
|
// executes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// disconnect from JMS
|
||||||
|
NotificationManagerJob.disconnect();
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
// catch any exceptions to ensure rest of finally block
|
||||||
|
// executes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (returnCode == PlatformUI.RETURN_RESTART) {
|
if (returnCode == PlatformUI.RETURN_RESTART) {
|
||||||
|
@ -176,8 +195,8 @@ public class CAVEApplication implements IStandaloneComponent {
|
||||||
new PyPiesDataStoreFactory(pypiesProps));
|
new PyPiesDataStoreFactory(pypiesProps));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeSerialization() {
|
protected Job initializeSerialization() {
|
||||||
new Job("Loading Serialization") {
|
Job job = new Job("Loading Serialization") {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
@ -190,7 +209,9 @@ public class CAVEApplication implements IStandaloneComponent {
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}.schedule();
|
};
|
||||||
|
job.schedule();
|
||||||
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,13 +27,13 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||||
|
import com.raytheon.uf.common.dataquery.DecisionTree;
|
||||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
||||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequestSet;
|
import com.raytheon.uf.common.dataquery.requests.DbQueryRequestSet;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponseSet;
|
import com.raytheon.uf.common.dataquery.responses.DbQueryResponseSet;
|
||||||
import com.raytheon.uf.viz.core.RecordFactory;
|
import com.raytheon.uf.viz.core.RecordFactory;
|
||||||
import com.raytheon.uf.viz.core.datastructure.DecisionTree;
|
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
||||||
|
|
|
@ -6,7 +6,8 @@ Bundle-Version: 1.0.0.qualifier
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||||
Export-Package: com.raytheon.uf.common.dataquery.db,
|
Export-Package: com.raytheon.uf.common.dataquery,
|
||||||
|
com.raytheon.uf.common.dataquery.db,
|
||||||
com.raytheon.uf.common.dataquery.requests,
|
com.raytheon.uf.common.dataquery.requests,
|
||||||
com.raytheon.uf.common.dataquery.responses
|
com.raytheon.uf.common.dataquery.responses
|
||||||
Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.12.1173",
|
Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.12.1173",
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
package com.raytheon.uf.viz.core.datastructure;
|
package com.raytheon.uf.common.dataquery;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
|
@ -95,12 +95,24 @@ def read(ds, request):
|
||||||
elif rt == 'SLAB':
|
elif rt == 'SLAB':
|
||||||
minIndex = request.getMinIndexForSlab()
|
minIndex = request.getMinIndexForSlab()
|
||||||
maxIndex = request.getMaxIndexForSlab()
|
maxIndex = request.getMaxIndexForSlab()
|
||||||
|
|
||||||
|
# Get all sizes and slices in reverse order
|
||||||
|
slices = []
|
||||||
|
sizes = []
|
||||||
|
numIndices = len(minIndex)
|
||||||
|
# Get all sizes and slices in reverse order
|
||||||
|
for i in reversed(range(numIndices)):
|
||||||
|
slices.append(slice(minIndex[i], maxIndex[i]))
|
||||||
|
sizes.append(maxIndex[i] - minIndex[i])
|
||||||
|
|
||||||
sel = h5py.selections.HyperSelection(ds.shape)
|
sel = h5py.selections.HyperSelection(ds.shape)
|
||||||
|
# mask the request slices
|
||||||
sel[()] = False
|
sel[()] = False
|
||||||
# reverse x and y for hdf5
|
sel[tuple(slices)] = True
|
||||||
sel[minIndex[1]:maxIndex[1], minIndex[0]:maxIndex[0]] = True
|
|
||||||
|
# Resize data to desired slab size
|
||||||
result = ds[sel]
|
result = ds[sel]
|
||||||
result.resize(maxIndex[1]-minIndex[1], maxIndex[0]-minIndex[0])
|
result.resize(tuple(sizes))
|
||||||
else:
|
else:
|
||||||
raise NotImplementedException('Only read requests supported are ' +
|
raise NotImplementedException('Only read requests supported are ' +
|
||||||
'ALL, POINT, XLINE, YLINE, and SLAB')
|
'ALL, POINT, XLINE, YLINE, and SLAB')
|
||||||
|
|
Loading…
Add table
Reference in a new issue