Search in sources :

Example 6 with DataProcessingOutputInfo

use of cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo in project vcell by virtualcell.

the class PDEDataViewer method calcVarStat.

private static ArrayList<VarStatistics> calcVarStat(PDEDataContext pdeDataContext, String[] stateVarNames) throws Exception {
    ArrayList<VarStatistics> varStatsArr = new ArrayList<>();
    DataProcessingOutputInfo dataProcessingOutputInfo = DataProcessingResultsPanel.getDataProcessingOutputInfo(pdeDataContext);
    if (dataProcessingOutputInfo == null) {
        return null;
    }
    String[] statisticVarNames = dataProcessingOutputInfo.getVariableNames();
    for (String stateVarName : stateVarNames) {
        double[] minValuesOvertime = null;
        double[] maxValuesOverTime = null;
        for (String statisticVarName : statisticVarNames) {
            if (statisticVarName.startsWith(stateVarName + "_min")) {
                minValuesOvertime = dataProcessingOutputInfo.getVariableStatValues().get(statisticVarName);
            }
            if (statisticVarName.startsWith(stateVarName + "_max")) {
                maxValuesOverTime = dataProcessingOutputInfo.getVariableStatValues().get(statisticVarName);
            }
        }
        if (minValuesOvertime != null && maxValuesOverTime != null) {
            FunctionRangeGenerator.VarStatistics varstatistics = new VarStatistics(stateVarName, minValuesOvertime, maxValuesOverTime);
            varStatsArr.add(varstatistics);
        }
    }
    return varStatsArr;
}
Also used : VarStatistics(cbit.vcell.util.FunctionRangeGenerator.VarStatistics) VarStatistics(cbit.vcell.util.FunctionRangeGenerator.VarStatistics) DataProcessingOutputInfo(cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo) ArrayList(java.util.ArrayList) FunctionRangeGenerator(cbit.vcell.util.FunctionRangeGenerator)

Example 7 with DataProcessingOutputInfo

use of cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo in project vcell by virtualcell.

the class DataSetControllerImplTest method testDoDataOperation.

@Test
public void testDoDataOperation() throws DataAccessException {
    boolean bIncludeStartValuesInfo = true;
    DataOperation dataOperation = new DataOperation.DataProcessingOutputInfoOP(vcDataIdentifier, bIncludeStartValuesInfo, outputContext);
    DataProcessingOutputInfo results = (DataProcessingOutputInfo) dsc.doDataOperation(dataOperation);
    String[] varNames = results.getVariableNames();
    String[] expectedVarNames = { "C_cyt_average", "C_cyt_total", "C_cyt_min", "C_cyt_max", "Ran_cyt_average", "Ran_cyt_total", "Ran_cyt_min", "Ran_cyt_max", "RanC_cyt_average", "RanC_cyt_total", "RanC_cyt_min", "RanC_cyt_max", "RanC_nuc_average", "RanC_nuc_total", "RanC_nuc_min", "RanC_nuc_max", "s2_average", "s2_total", "s2_min", "s2_max" };
    String[] expectedUnits = { "uM", "molecules", "uM", "uM", "uM", "molecules", "uM", "uM", "uM", "molecules", "uM", "uM", "uM", "molecules", "uM", "uM", "molecules.um-2", "molecules", "uM", "uM" };
    double[] expectedTimePoints = { 0.0, 0.5, 1.0 };
    double[] expectedStatistics_RanC_cyt_max = { 8.9, 3.5890337679723476, 3.057119332620108 };
    Assert.assertArrayEquals(varNames, expectedVarNames);
    Assert.assertArrayEquals(expectedTimePoints, results.getVariableTimePoints(), 1e-8);
    for (int i = 0; i < expectedVarNames.length; i++) {
        Assert.assertEquals(results.getVariableUnits(expectedVarNames[i]), expectedUnits[i]);
    }
    Assert.assertArrayEquals(expectedStatistics_RanC_cyt_max, results.getVariableStatValues().get("RanC_cyt_max"), 1e-8);
}
Also used : DataProcessingOutputInfo(cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo) Test(org.junit.Test)

Aggregations

DataProcessingOutputInfo (cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo)7 ArrayList (java.util.ArrayList)5 DataIdentifier (cbit.vcell.simdata.DataIdentifier)3 DataAccessException (org.vcell.util.DataAccessException)3 VCDataIdentifier (org.vcell.util.document.VCDataIdentifier)3 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)2 DataOperation (cbit.vcell.simdata.DataOperation)2 DataProcessingOutputInfoOP (cbit.vcell.simdata.DataOperation.DataProcessingOutputInfoOP)2 DataOperationResults (cbit.vcell.simdata.DataOperationResults)2 PDEDataManager (cbit.vcell.simdata.PDEDataManager)2 AnnotatedFunction (cbit.vcell.solver.AnnotatedFunction)2 VarStatistics (cbit.vcell.util.FunctionRangeGenerator.VarStatistics)2 Point (java.awt.Point)2 Hashtable (java.util.Hashtable)2 ImageException (cbit.image.ImageException)1 SourceDataInfo (cbit.image.SourceDataInfo)1 LocalVCSimulationDataIdentifier (cbit.vcell.client.ClientSimManager.LocalVCSimulationDataIdentifier)1 NrrdInfo (cbit.vcell.export.nrrd.NrrdInfo)1 ExportSpecs (cbit.vcell.export.server.ExportSpecs)1 FieldDataFileOperationSpec (cbit.vcell.field.io.FieldDataFileOperationSpec)1