7 #include "CubeCalculator.h"
15 #include "Statistics.h"
22 CubeCalculator::CubeCalculator() {
23 m_calculations = NULL;
25 m_dataDefinitions = NULL;
28 m_cameraBuffers = NULL;
42 CubeCalculator::~CubeCalculator() {
45 delete m_calculations;
47 delete m_dataDefinitions;
50 delete m_cameraBuffers;
52 m_calculations = NULL;
54 m_dataDefinitions = NULL;
57 m_cameraBuffers = NULL;
64 void CubeCalculator::Clear() {
68 m_calculations->clear();
75 if (m_dataDefinitions) {
76 m_dataDefinitions->clear();
81 for (
int i = 0; i < m_cubeStats->size(); i++) {
82 delete (*m_cubeStats)[i];
83 (*m_cubeStats)[i] = NULL;
89 m_cubeCameras->clear();
93 if (m_cameraBuffers) {
94 for (
int i = 0; i < m_cameraBuffers->size(); i++) {
95 delete (*m_cameraBuffers)[i];
96 (*m_cameraBuffers)[i] = NULL;
98 m_cameraBuffers->clear();
123 for (
int currentCalculation = 0; currentCalculation < m_calculations->size();
124 currentCalculation++) {
125 if ((*m_calculations)[currentCalculation] == CallNextMethod) {
126 void (
Calculator::*aMethod)() = (*m_methods)[methodIndex];
131 DataValue &data = (*m_dataDefinitions)[dataIndex];
132 if (data.
type() == DataValue::Constant) {
135 else if (data.
type() == DataValue::Band) {
138 else if (data.
type() == DataValue::Line) {
141 else if (data.
type() == DataValue::Sample) {
143 samples.resize(m_outputSamples);
145 for (
int i = 0; i < m_outputSamples; i++) {
151 else if (data.
type() == DataValue::CubeData) {
154 else if (data.
type() == DataValue::InaData) {
155 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->inaBuffer(curLine,
159 else if (data.
type() == DataValue::EmaData) {
160 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->emaBuffer(curLine,
164 else if (data.
type() == DataValue::PhaData) {
165 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->phaBuffer(curLine,
169 else if (data.
type() == DataValue::InalData) {
170 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->inalBuffer(curLine,
174 else if (data.
type() == DataValue::EmalData) {
175 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->emalBuffer(curLine,
179 else if (data.
type() == DataValue::PhalData) {
180 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->phalBuffer(curLine,
184 else if (data.
type() == DataValue::LatData) {
185 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->latBuffer(curLine,
189 else if (data.
type() == DataValue::LonData) {
190 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->lonBuffer(curLine,
194 else if (data.
type() == DataValue::ResData) {
195 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->resBuffer(curLine,
199 else if (data.
type() == DataValue::RadiusData) {
200 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->radiusBuffer(curLine,
204 else if (data.
type() == DataValue::InacData) {
205 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->inacBuffer(curLine,
209 else if (data.
type() == DataValue::EmacData) {
210 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->emacBuffer(curLine,
214 else if (data.
type() == DataValue::PhacData) {
215 Push(*((*m_cameraBuffers)[data.
cubeIndex()]->phacBuffer(curLine,
226 if (StackSize() != 1) {
227 string msg =
"Too many operands in the equation.";
228 throw IException(IException::Unknown, msg, _FILEINFO_);
249 void CubeCalculator::prepareCalculations(QString equation,
265 if (isdigit(token[0]) || token[0] ==
'.') {
266 m_calculations->push_back(PushNextData);
267 m_dataDefinitions->push_back(
DataValue(DataValue::Constant,
272 else if (token[0] ==
'f') {
275 if (file < 0 || file >= (
int)inCubes.size()) {
276 QString msg =
"Invalid file number [" + tok.
ToQt() +
"]";
277 throw IException(IException::Unknown, msg, _FILEINFO_);
280 m_calculations->push_back(PushNextData);
281 m_dataDefinitions->push_back(
DataValue(DataValue::CubeData, file));
283 else if (token ==
"band") {
284 m_calculations->push_back(PushNextData);
285 m_dataDefinitions->push_back(
DataValue(DataValue::Band));
287 else if (token ==
"line") {
288 m_calculations->push_back(PushNextData);
289 m_dataDefinitions->push_back(
DataValue(DataValue::Line));
291 else if (token ==
"sample") {
292 m_calculations->push_back(PushNextData);
293 m_dataDefinitions->push_back(
DataValue(DataValue::Sample));
296 else if (token ==
"+") {
297 addMethodCall(&Calculator::Add);
301 else if (token ==
"-") {
302 addMethodCall(&Calculator::Subtract);
306 else if (token ==
"*") {
307 addMethodCall(&Calculator::Multiply);
311 else if (token ==
"/") {
312 addMethodCall(&Calculator::Divide);
316 else if (token ==
"%") {
317 addMethodCall(&Calculator::Modulus);
321 else if (token ==
"^") {
322 addMethodCall(&Calculator::Exponent);
326 else if (token ==
"--") {
327 addMethodCall(&Calculator::Negative);
331 else if (token ==
"neg") {
332 addMethodCall(&Calculator::Negative);
336 else if (token ==
"<<") {
337 addMethodCall(&Calculator::LeftShift);
341 else if (token ==
">>") {
342 addMethodCall(&Calculator::RightShift);
346 else if (token ==
"linemax") {
347 addMethodCall(&Calculator::MaximumLine);
351 else if (token ==
"max") {
352 addMethodCall(&Calculator::MaximumPixel);
356 else if (token ==
"linemin") {
357 addMethodCall(&Calculator::MinimumLine);
361 else if (token ==
"min") {
362 addMethodCall(&Calculator::MinimumPixel);
366 else if (token ==
"abs") {
367 addMethodCall(&Calculator::AbsoluteValue);
371 else if (token ==
"sqrt") {
372 addMethodCall(&Calculator::SquareRoot);
376 else if (token ==
"log" || token ==
"ln") {
377 addMethodCall(&Calculator::Log);
381 else if (token ==
"log10") {
382 addMethodCall(&Calculator::Log10);
386 else if (token ==
"pi") {
387 m_calculations->push_back(PushNextData);
388 m_dataDefinitions->push_back(
394 else if (token ==
"e") {
395 m_calculations->push_back(PushNextData);
396 m_dataDefinitions->push_back(
401 else if (token ==
"rads") {
402 m_calculations->push_back(PushNextData);
403 m_dataDefinitions->push_back(
407 addMethodCall(&Calculator::Multiply);
410 else if (token ==
"degs") {
411 m_calculations->push_back(PushNextData);
412 m_dataDefinitions->push_back(
415 addMethodCall(&Calculator::Multiply);
419 else if (token ==
"sin") {
420 addMethodCall(&Calculator::Sine);
424 else if (token ==
"cos") {
425 addMethodCall(&Calculator::Cosine);
429 else if (token ==
"tan") {
430 addMethodCall(&Calculator::Tangent);
434 else if (token ==
"sec") {
435 addMethodCall(&Calculator::Secant);
439 else if (token ==
"csc") {
440 addMethodCall(&Calculator::Cosecant);
444 else if (token ==
"cot") {
445 addMethodCall(&Calculator::Cotangent);
449 else if (token ==
"asin") {
450 addMethodCall(&Calculator::Arcsine);
454 else if (token ==
"acos") {
455 addMethodCall(&Calculator::Arccosine);
459 else if (token ==
"atan") {
460 addMethodCall(&Calculator::Arctangent);
464 else if (token ==
"atan2") {
465 addMethodCall(&Calculator::Arctangent2);
469 else if (token ==
"sinh") {
470 addMethodCall(&Calculator::SineH);
474 else if (token ==
"cosh") {
475 addMethodCall(&Calculator::CosineH);
479 else if (token ==
"tanh") {
480 addMethodCall(&Calculator::TangentH);
484 else if (token ==
"<") {
485 addMethodCall(&Calculator::LessThan);
489 else if (token ==
">") {
490 addMethodCall(&Calculator::GreaterThan);
494 else if (token ==
"<=") {
495 addMethodCall(&Calculator::LessThanOrEqual);
499 else if (token ==
">=") {
500 addMethodCall(&Calculator::GreaterThanOrEqual);
504 else if (token ==
"==") {
505 addMethodCall(&Calculator::Equal);
509 else if (token ==
"!=") {
510 addMethodCall(&Calculator::NotEqual);
514 else if (token ==
"cubemax") {
515 int cubeIndex = lastPushToCubeStats(inCubes);
517 m_calculations->push_back(PushNextData);
518 m_dataDefinitions->push_back(
519 DataValue(DataValue::Constant, (*m_cubeStats)[cubeIndex]->Maximum())
525 else if (token ==
"cubemin") {
526 int cubeIndex = lastPushToCubeStats(inCubes);
528 m_calculations->push_back(PushNextData);
529 m_dataDefinitions->push_back(
530 DataValue(DataValue::Constant, (*m_cubeStats)[cubeIndex]->Minimum())
536 else if (token ==
"cubeavg") {
537 int cubeIndex = lastPushToCubeStats(inCubes);
539 m_calculations->push_back(PushNextData);
540 m_dataDefinitions->push_back(
547 else if (token ==
"cubestd") {
548 int cubeIndex = lastPushToCubeStats(inCubes);
550 m_calculations->push_back(PushNextData);
551 m_dataDefinitions->push_back(
552 DataValue(DataValue::Constant, (*m_cubeStats)[cubeIndex]->StandardDeviation())
558 else if (token ==
"inac") {
559 int cubeIndex = lastPushToCubeCameras(inCubes);
560 (*m_cameraBuffers)[cubeIndex]->enableInacBuffer();
562 m_calculations->push_back(PushNextData);
563 m_dataDefinitions->push_back(
DataValue(DataValue::InacData, cubeIndex));
567 else if (token ==
"emac") {
568 int cubeIndex = lastPushToCubeCameras(inCubes);
569 (*m_cameraBuffers)[cubeIndex]->enableEmacBuffer();
571 m_calculations->push_back(PushNextData);
572 m_dataDefinitions->push_back(
DataValue(DataValue::EmacData, cubeIndex));
576 else if (token ==
"phac") {
577 int cubeIndex = lastPushToCubeCameras(inCubes);
578 (*m_cameraBuffers)[cubeIndex]->enablePhacBuffer();
580 m_calculations->push_back(PushNextData);
581 m_dataDefinitions->push_back(
DataValue(DataValue::PhacData, cubeIndex));
585 else if (token ==
"ina") {
586 int cubeIndex = lastPushToCubeCameras(inCubes);
587 (*m_cameraBuffers)[cubeIndex]->enableInaBuffer();
589 m_calculations->push_back(PushNextData);
590 m_dataDefinitions->push_back(
DataValue(DataValue::InaData, cubeIndex));
594 else if (token ==
"ema") {
595 int cubeIndex = lastPushToCubeCameras(inCubes);
596 (*m_cameraBuffers)[cubeIndex]->enableEmaBuffer();
598 m_calculations->push_back(PushNextData);
599 m_dataDefinitions->push_back(
DataValue(DataValue::EmaData, cubeIndex));
603 else if (token ==
"pha") {
604 int cubeIndex = lastPushToCubeCameras(inCubes);
605 (*m_cameraBuffers)[cubeIndex]->enablePhaBuffer();
607 m_calculations->push_back(PushNextData);
608 m_dataDefinitions->push_back(
DataValue(DataValue::PhaData, cubeIndex));
612 else if (token ==
"inal") {
613 int cubeIndex = lastPushToCubeCameras(inCubes);
614 (*m_cameraBuffers)[cubeIndex]->enableInalBuffer();
616 m_calculations->push_back(PushNextData);
617 m_dataDefinitions->push_back(
DataValue(DataValue::InalData, cubeIndex));
621 else if (token ==
"emal") {
622 int cubeIndex = lastPushToCubeCameras(inCubes);
623 (*m_cameraBuffers)[cubeIndex]->enableEmalBuffer();
625 m_calculations->push_back(PushNextData);
626 m_dataDefinitions->push_back(
DataValue(DataValue::EmalData, cubeIndex));
630 else if (token ==
"phal") {
631 int cubeIndex = lastPushToCubeCameras(inCubes);
632 (*m_cameraBuffers)[cubeIndex]->enablePhalBuffer();
634 m_calculations->push_back(PushNextData);
635 m_dataDefinitions->push_back(
DataValue(DataValue::PhalData, cubeIndex));
639 else if (token ==
"lat") {
640 int cubeIndex = lastPushToCubeCameras(inCubes);
641 (*m_cameraBuffers)[cubeIndex]->enableLatBuffer();
643 m_calculations->push_back(PushNextData);
644 m_dataDefinitions->push_back(
DataValue(DataValue::LatData, cubeIndex));
648 else if (token ==
"lon") {
649 int cubeIndex = lastPushToCubeCameras(inCubes);
650 (*m_cameraBuffers)[cubeIndex]->enableLonBuffer();
652 m_calculations->push_back(PushNextData);
653 m_dataDefinitions->push_back(
DataValue(DataValue::LonData, cubeIndex));
657 else if (token ==
"res") {
658 int cubeIndex = lastPushToCubeCameras(inCubes);
659 (*m_cameraBuffers)[cubeIndex]->enableResBuffer();
661 m_calculations->push_back(PushNextData);
662 m_dataDefinitions->push_back(
DataValue(DataValue::ResData, cubeIndex));
666 else if (token ==
"radius") {
667 int cubeIndex = lastPushToCubeCameras(inCubes);
668 (*m_cameraBuffers)[cubeIndex]->enableRadiusBuffer();
670 m_calculations->push_back(PushNextData);
671 m_dataDefinitions->push_back(
DataValue(DataValue::RadiusData, cubeIndex));
675 else if (token ==
"") {
679 string msg =
"Unidentified operator [";
681 throw IException(IException::Unknown, msg, _FILEINFO_);
700 if (!m_calculations->size()) {
701 string msg =
"Not sure which file to get statistics from";
702 throw IException(IException::Unknown, msg, _FILEINFO_);
705 if ((*m_calculations)[m_calculations->size() - 1] != PushNextData) {
706 string msg =
"This function must not contain calculations,";
707 msg +=
" only input cubes may be specified.";
708 throw IException(IException::Unknown, msg, _FILEINFO_);
711 m_calculations->pop_back();
714 DataValue lastData = (*m_dataDefinitions)[m_dataDefinitions->size() - 1];
716 if (lastData.
type() != DataValue::CubeData) {
717 string msg =
"This function must not contain constants,";
718 msg +=
" only input cubes may be specified.";
719 throw IException(IException::Unknown, msg, _FILEINFO_);
722 int cubeStatsIndex = lastData.
cubeIndex();
723 m_dataDefinitions->pop_back();
728 while (m_cubeStats->size() < cubeStatsIndex + 1) {
729 m_cubeStats->push_back(NULL);
734 if ((*m_cubeStats)[cubeStatsIndex] == NULL) {
735 (*m_cubeStats)[cubeStatsIndex] = inCubes[cubeStatsIndex]->statistics();
738 return cubeStatsIndex;
760 if (!m_calculations->size()) {
761 string msg =
"Not sure which file to get cameras from";
762 throw IException(IException::Unknown, msg, _FILEINFO_);
765 if ((*m_calculations)[m_calculations->size() - 1] != PushNextData) {
766 string msg =
"This function must not contain calculations,";
767 msg +=
" only input cubes may be specified.";
768 throw IException(IException::Unknown, msg, _FILEINFO_);
771 m_calculations->pop_back();
774 DataValue lastData = (*m_dataDefinitions)[m_dataDefinitions->size() - 1];
776 if (lastData.
type() != DataValue::CubeData) {
777 string msg =
"This function must not contain constants,";
778 msg +=
" only input cubes may be specified.";
779 throw IException(IException::Unknown, msg, _FILEINFO_);
783 m_dataDefinitions->pop_back();
788 while (m_cubeCameras->size() < cubeIndex + 1) {
789 m_cubeCameras->push_back(NULL);
792 while (m_cameraBuffers->size() < cubeIndex + 1) {
793 m_cameraBuffers->push_back(NULL);
798 if ((*m_cubeCameras)[cubeIndex] == NULL) {
801 cam = inCubes[cubeIndex]->camera();
803 string msg =
"This function requires a camera and the input cube does";
804 msg +=
" not have one. You may need to run spiceinit";
805 throw IException(IException::Unknown, msg, _FILEINFO_);
809 string msg =
"This function requires a camera and the input cube does";
810 msg +=
" not have one. You may need to run spiceinit";
811 throw IException(e, IException::Unknown, msg, _FILEINFO_);
814 (*m_cubeCameras)[cubeIndex] = cam;
828 void CubeCalculator::addMethodCall(
void (
Calculator::*method)(
void)) {
829 m_calculations->push_back(CallNextMethod);
830 m_methods->push_back(method);
840 DataValue::DataValue() {
843 m_constantValue = 0.0;
857 m_constantValue = 0.0;
873 m_constantValue = 0.0;
874 m_cubeIndex = cubeIndex;
892 if (type == Constant) {
893 m_constantValue = value;
913 int DataValue::cubeIndex() {
923 double DataValue::constant() {
924 return m_constantValue;
933 CameraBuffers::CameraBuffers(
Camera *camera) {
947 m_radiusBuffer = NULL;
956 CameraBuffers::~CameraBuffers() {
969 delete m_radiusBuffer;
983 m_radiusBuffer = NULL;
988 void CameraBuffers::enablePhaBuffer() {
994 void CameraBuffers::enableInaBuffer() {
1000 void CameraBuffers::enableEmaBuffer() {
1006 void CameraBuffers::enableLatBuffer() {
1012 void CameraBuffers::enableLonBuffer() {
1018 void CameraBuffers::enableResBuffer() {
1024 void CameraBuffers::enableRadiusBuffer() {
1030 void CameraBuffers::enablePhalBuffer() {
1036 void CameraBuffers::enableInalBuffer() {
1042 void CameraBuffers::enableEmalBuffer() {
1048 void CameraBuffers::enablePhacBuffer() {
1054 void CameraBuffers::enableInacBuffer() {
1060 void CameraBuffers::enableEmacBuffer() {
1065 QVector<double> *CameraBuffers::phaBuffer(
int currentLine,
int ns,
int currentBand) {
1066 loadBuffers(currentLine, ns, currentBand);
1071 QVector<double> *CameraBuffers::inaBuffer(
int currentLine,
int ns,
int currentBand) {
1072 loadBuffers(currentLine, ns, currentBand);
1077 QVector<double> *CameraBuffers::emaBuffer(
int currentLine,
int ns,
int currentBand) {
1078 loadBuffers(currentLine, ns, currentBand);
1083 QVector<double> *CameraBuffers::latBuffer(
int currentLine,
int ns,
int currentBand) {
1084 loadBuffers(currentLine, ns, currentBand);
1089 QVector<double> *CameraBuffers::lonBuffer(
int currentLine,
int ns,
int currentBand) {
1090 loadBuffers(currentLine, ns, currentBand);
1095 QVector<double> *CameraBuffers::resBuffer(
int currentLine,
int ns,
int currentBand) {
1096 loadBuffers(currentLine, ns, currentBand);
1101 QVector<double> *CameraBuffers::radiusBuffer(
int currentLine,
int ns,
int currentBand) {
1102 loadBuffers(currentLine,ns,currentBand);
1103 return m_radiusBuffer;
1107 QVector<double> *CameraBuffers::phalBuffer(
int currentLine,
int ns,
int currentBand) {
1108 loadBuffers(currentLine, ns, currentBand);
1109 return m_phalBuffer;
1113 QVector<double> *CameraBuffers::inalBuffer(
int currentLine,
int ns,
int currentBand) {
1114 loadBuffers(currentLine, ns, currentBand);
1115 return m_inalBuffer;
1119 QVector<double> *CameraBuffers::emalBuffer(
int currentLine,
int ns,
int currentBand) {
1120 loadBuffers(currentLine, ns, currentBand);
1121 return m_emalBuffer;
1125 QVector<double> *CameraBuffers::phacBuffer(
int currentLine,
int ns,
int currentBand) {
1126 loadBuffers(currentLine, ns, currentBand);
1127 return m_phacBuffer;
1131 QVector<double> *CameraBuffers::inacBuffer(
int currentLine,
int ns,
int currentBand) {
1132 loadBuffers(currentLine, ns, currentBand);
1133 return m_inacBuffer;
1137 QVector<double> *CameraBuffers::emacBuffer(
int currentLine,
int ns,
int currentBand) {
1138 loadBuffers(currentLine, ns, currentBand);
1139 return m_emacBuffer;
1143 void CameraBuffers::loadBuffers(
int currentLine,
int ns,
int currentBand) {
1144 if (currentLine != m_lastLine) {
1145 m_lastLine = currentLine;
1148 if (m_phaBuffer) m_phaBuffer->resize(ns);
1149 if (m_inaBuffer) m_inaBuffer->resize(ns);
1150 if (m_emaBuffer) m_emaBuffer->resize(ns);
1151 if (m_latBuffer) m_latBuffer->resize(ns);
1152 if (m_lonBuffer) m_lonBuffer->resize(ns);
1153 if (m_resBuffer) m_resBuffer->resize(ns);
1154 if (m_radiusBuffer) m_radiusBuffer->resize(ns);
1155 if (m_phalBuffer) m_phalBuffer->resize(ns);
1156 if (m_inalBuffer) m_inalBuffer->resize(ns);
1157 if (m_emalBuffer) m_emalBuffer->resize(ns);
1160 if (m_phacBuffer) m_phacBuffer->resize(1);
1161 if (m_inacBuffer) m_inacBuffer->resize(1);
1162 if (m_emacBuffer) m_emacBuffer->resize(1);
1164 m_camera->SetBand(currentBand);
1166 if (m_phacBuffer || m_inacBuffer || m_emacBuffer) {
1168 double centerLine = m_camera->Lines() / 2.0 + 0.5;
1169 double centerSamp = m_camera->Samples() / 2.0 + 0.5;
1171 if (m_camera->SetImage(centerSamp, centerLine)) {
1174 (*m_phacBuffer)[0] = m_camera->PhaseAngle();
1178 (*m_inacBuffer)[0] = m_camera->IncidenceAngle();
1182 (*m_emacBuffer)[0] = m_camera->EmissionAngle();
1186 QString msg =
"Unable to compute illumination angles at image center for operator ["
1188 throw IException(IException::Unknown, msg, _FILEINFO_);
1193 for (
int i = 0; i < ns; i++) {
1195 if (m_camera->SetImage(i + 1, currentLine)) {
1196 if (m_phaBuffer) (*m_phaBuffer)[i] = m_camera->PhaseAngle();
1197 if (m_inaBuffer) (*m_inaBuffer)[i] = m_camera->IncidenceAngle();
1198 if (m_emaBuffer) (*m_emaBuffer)[i] = m_camera->EmissionAngle();
1199 if (m_latBuffer) (*m_latBuffer)[i] = m_camera->UniversalLatitude();
1200 if (m_lonBuffer) (*m_lonBuffer)[i] = m_camera->UniversalLongitude();
1201 if (m_resBuffer) (*m_resBuffer)[i] = m_camera->PixelResolution();
1202 if (m_radiusBuffer) (*m_radiusBuffer)[i] = m_camera->LocalRadius().meters();
1203 if (m_phalBuffer || m_inalBuffer || m_emalBuffer) {
1204 Angle phal, inal, emal;
1206 m_camera->LocalPhotometricAngles(phal, inal, emal, okay);
1208 if (m_phalBuffer) (*m_phalBuffer)[i] = phal.degrees();
1209 if (m_inalBuffer) (*m_inalBuffer)[i] = inal.degrees();
1210 if (m_emalBuffer) (*m_emalBuffer)[i] = emal.degrees();
1213 if (m_phalBuffer) (*m_phalBuffer)[i] = NAN;
1214 if (m_inalBuffer) (*m_inalBuffer)[i] = NAN;
1215 if (m_emalBuffer) (*m_emalBuffer)[i] = NAN;
1220 if (m_phaBuffer) (*m_phaBuffer)[i] = NAN;
1221 if (m_inaBuffer) (*m_inaBuffer)[i] = NAN;
1222 if (m_emaBuffer) (*m_emaBuffer)[i] = NAN;
1223 if (m_latBuffer) (*m_latBuffer)[i] = NAN;
1224 if (m_lonBuffer) (*m_lonBuffer)[i] = NAN;
1225 if (m_resBuffer) (*m_resBuffer)[i] = NAN;
1226 if (m_radiusBuffer) (*m_radiusBuffer)[i] = NAN;
1227 if (m_phalBuffer) (*m_phalBuffer)[i] = NAN;
1228 if (m_inalBuffer) (*m_inalBuffer)[i] = NAN;
1229 if (m_emalBuffer) (*m_emalBuffer)[i] = NAN;