use of org.flyte.api.v1.Variable in project vcell by virtualcell.
the class NetCDFReader method getEndTime.
/**
* Get ending time. 0 dimenstion
* @return double, ending time.
*/
public double getEndTime() throws IOException {
Variable v = ncfile.findVariable("TEnd");
Double val = 0.0;
try {
val = v.readScalarDouble();
} catch (IOException ioe) {
ioe.printStackTrace(System.err);
throw new IOException("Cannot get proper ending time from the model.");
}
return val;
}
use of org.flyte.api.v1.Variable in project vcell by virtualcell.
the class NetCDFReader method getCellGrowthTimeSD.
/**
* Get cell growth time SD, which is the standard deviation of the time between cell divisions.
* @return double, standard deviation of cell growth time.
*/
public double getCellGrowthTimeSD() throws IOException {
Variable v = ncfile.findVariable("CellGrowthTimeSD");
Double val = 0.0;
try {
val = v.readScalarDouble();
} catch (IOException ioe) {
ioe.printStackTrace(System.err);
throw new IOException("Cannot get proper standard deviation of the time between cell divisions from the model.");
}
return val;
}
use of org.flyte.api.v1.Variable in project vcell by virtualcell.
the class NetCDFReader method getNumModels_Variable.
/**
* Get Number of Models.
* @return int. number of models.
*/
public int getNumModels_Variable() throws IOException {
Variable v = ncfile.findVariable("NumModels");
int val = 0;
try {
val = v.readScalarInt();
} catch (IOException ioe) {
ioe.printStackTrace(System.err);
throw new IOException("Cannot get proper variable of number of models from the file.");
}
return val;
}
use of org.flyte.api.v1.Variable in project vcell by virtualcell.
the class NetCDFReader method getCellGrowthTime.
/**
* Get cell growth time, which is the average amount of time between cell divisions.
* @return double, cell growth time.
*/
public double getCellGrowthTime() throws IOException {
Variable v = ncfile.findVariable("CellGrowthTime");
Double val = 0.0;
try {
val = v.readScalarDouble();
} catch (IOException ioe) {
ioe.printStackTrace(System.err);
throw new IOException("Cannot get proper cell growth time from the model.");
}
return val;
}
use of org.flyte.api.v1.Variable in project vcell by virtualcell.
the class NetCDFReader method getSpeciesNames_val.
/**
* Get the real string of species' names. The species' names are stored
* in a 2 dimentional structure. First dimension is the number of speceis
* and the second dimension is the allowed string length of the names(default=25).
* @return String[], the list of the species' names in the model.
*/
public String[] getSpeciesNames_val() throws IOException {
if ((this != null) && (getSpeciesNames() != null)) {
Variable snames = getSpeciesNames();
int[] shape = snames.getShape();
String[] result = new String[shape[0]];
ArrayChar.D2 data = null;
try {
data = (ArrayChar.D2) snames.read();
} catch (Exception e) {
e.printStackTrace(System.err);
throw new IOException("Can not read species' names from the model.");
}
for (int i = 0; i < shape[0]; i++) {
char[] name = new char[shape[1]];
for (int j = 0; j < shape[1]; j++) {
name[j] = data.get(i, j);
}
result[i] = new String(name).trim();
}
// }
return result;
}
return null;
}
Aggregations