| 187 |
|
} |
| 188 |
|
|
| 189 |
|
outStream << "#######################################################\n"; |
| 190 |
< |
outStream << "# Standard Deviations in those quantities follow:\n"; |
| 190 |
> |
outStream << "# 95% confidence intervals in those quantities follow:\n"; |
| 191 |
|
outStream << "#######################################################\n"; |
| 192 |
|
|
| 193 |
|
for (int j = 0; j < nBins_; j++) { |
| 200 |
|
|
| 201 |
|
int n = outputData->accumulator[j]->count(); |
| 202 |
|
if (n != 0) { |
| 203 |
< |
writeStdDev( outStream, outputData, j ); |
| 203 |
> |
writeErrorBars( outStream, outputData, j ); |
| 204 |
|
} |
| 205 |
|
} |
| 206 |
|
outStream << std::endl; |
| 257 |
|
} |
| 258 |
|
} |
| 259 |
|
|
| 260 |
< |
void SpatialStatistics::writeStdDev(ostream& os, OutputData* dat, |
| 260 |
> |
void SpatialStatistics::writeErrorBars(ostream& os, OutputData* dat, |
| 261 |
|
unsigned int bin) { |
| 262 |
|
assert(int(bin) < nBins_); |
| 263 |
|
int n = dat->accumulator[bin]->count(); |
| 265 |
|
|
| 266 |
|
if( dat->dataType == odtReal ) { |
| 267 |
|
RealType r; |
| 268 |
< |
dynamic_cast<Accumulator*>(dat->accumulator[bin])->getStdDev(r); |
| 268 |
> |
dynamic_cast<Accumulator*>(dat->accumulator[bin])->get95percentConfidenceInterval(r); |
| 269 |
|
if (isinf(r) || isnan(r) ) { |
| 270 |
|
sprintf( painCave.errMsg, |
| 271 |
|
"SpatialStatistics detected a numerical error writing:\n" |
| 279 |
|
|
| 280 |
|
} else if ( dat->dataType == odtVector3 ) { |
| 281 |
|
Vector3d v; |
| 282 |
< |
dynamic_cast<VectorAccumulator*>(dat->accumulator[bin])->getStdDev(v); |
| 282 |
> |
dynamic_cast<VectorAccumulator*>(dat->accumulator[bin])->get95percentConfidenceInterval(v); |
| 283 |
|
if (isinf(v[0]) || isnan(v[0]) || |
| 284 |
|
isinf(v[1]) || isnan(v[1]) || |
| 285 |
|
isinf(v[2]) || isnan(v[2]) ) { |
| 328 |
|
|
| 329 |
|
void SlabStatistics::processFrame(int istep) { |
| 330 |
|
RealType z; |
| 331 |
+ |
|
| 332 |
|
hmat_ = currentSnapshot_->getHmat(); |
| 333 |
|
for (int i = 0; i < nBins_; i++) { |
| 334 |
|
z = (((RealType)i + 0.5) / (RealType)nBins_) * hmat_(2,2); |
| 354 |
|
SpatialStatistics(info, filename, sele, nbins), coordinateOrigin_(V3Zero) { |
| 355 |
|
|
| 356 |
|
binWidth_ = 1.0; |
| 357 |
+ |
|
| 358 |
+ |
Globals* simParams = info->getSimParams(); |
| 359 |
+ |
RNEMDParameters* rnemdParams = simParams->getRNEMDParameters(); |
| 360 |
+ |
bool hasCoordinateOrigin = rnemdParams->haveCoordinateOrigin(); |
| 361 |
+ |
|
| 362 |
+ |
if (hasCoordinateOrigin) { |
| 363 |
+ |
std::vector<RealType> co = rnemdParams->getCoordinateOrigin(); |
| 364 |
+ |
if (co.size() != 3) { |
| 365 |
+ |
sprintf(painCave.errMsg, |
| 366 |
+ |
"RNEMD: Incorrect number of parameters specified for coordinateOrigin.\n" |
| 367 |
+ |
"\tthere should be 3 parameters, but %lu were specified.\n", |
| 368 |
+ |
co.size()); |
| 369 |
+ |
painCave.isFatal = 1; |
| 370 |
+ |
simError(); |
| 371 |
+ |
} |
| 372 |
+ |
coordinateOrigin_.x() = co[0]; |
| 373 |
+ |
coordinateOrigin_.y() = co[1]; |
| 374 |
+ |
coordinateOrigin_.z() = co[2]; |
| 375 |
+ |
} else { |
| 376 |
+ |
coordinateOrigin_ = V3Zero; |
| 377 |
+ |
} |
| 378 |
|
|
| 379 |
|
r_ = new OutputData; |
| 380 |
|
r_->units = "Angstroms"; |
| 395 |
|
ShellStatistics::~ShellStatistics() { |
| 396 |
|
} |
| 397 |
|
|
| 398 |
< |
int ShellStatistics::getBin(Vector3d pos) { |
| 398 |
> |
int ShellStatistics::getBin(Vector3d pos) { |
| 399 |
|
Vector3d rPos = pos - coordinateOrigin_; |
| 400 |
|
return int(rPos.length() / binWidth_); |
| 401 |
|
} |