Skip to content
Snippets Groups Projects
Commit daeeddab authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

corr bug in 'ci': didn't work properly when nz>1.

reason: pointer abuse.
other than suspected, not correlated to changed j guessing in expr.cpp
parent 44463445
No related branches found
No related tags found
No related merge requests found
......@@ -1021,7 +1021,7 @@ void NCurveFile::IntegralProperty()
continue;
POld fout( new COld );
PSpec S( new CSpec );
PSpec S;
uint nz = fin->ZCo.size();
bool savable = ( nz > 0 );
......@@ -1031,6 +1031,8 @@ void NCurveFile::IntegralProperty()
if( fout->name.substr(0,4)=="fit_" )
fout->name.replace( 0, 4, "" );
fout->name.insert( 0, label + "_" );
fout->lDoc.push_back( "ci " + ( mode=="p" ? strg(ip) : mode ) );
// last z becomes x
fout->xco = fin->ZCo.back();
if ( mode=="p" )
fout->yco = fin->PCo[ip];
......@@ -1039,13 +1041,19 @@ void NCurveFile::IntegralProperty()
if( fout->ZCo.size()<1 )
throw string( "input has no z coord" );
fout->ZCo.pop_back();
fout->lDoc.push_back( "ci " + ( mode=="p" ? strg(ip) : mode ) );
S->z = fin->VC(0)->z;
S->z.pop_back();
}
bool newoutspec = true;
for (uint j=0; j<fin->nJ(); j++) {
if( newoutspec ) {
S = PSpec( new CSpec );
S->z = fin->VC(j)->z;
S->z.pop_back();
newoutspec = false;
}
// determine integral value
double val;
if ( mode=="p" )
......@@ -1071,18 +1079,20 @@ void NCurveFile::IntegralProperty()
// store in integral spectrum
S->push_xy( fin->VC(j)->z[nz-1], val );
// move z values
if (nz>=2 &&
(j+1)<fin->nJ() &&
fin->VC(j+1)->z[nz-2]!=fin->VC(j)->z[nz-2]) {
if ( nz>=2 &&
(j+1)<fin->nJ() &&
fin->VC(j+1)->z[nz-2]!=fin->VC(j)->z[nz-2] ) {
cout << "DEB j="<<j<<", S: "<<S->z[0]<<"\n";
fout->V.push_back(S);
S->clear();
S->z = fin->VC(j+1)->z;
S->z.pop_back();
newoutspec = true;
}
}
if (savable) {
fout->V.push_back(S);
cout << "DEB ultimo, S: "<<S->z[0]<<"\n";
NOlm::OloAdd( fout );
for (uint j=0; j<fout->nJ(); j++)
cout << "DEB post j="<<j<<", Sz="<<fout->VS(j)->z[0]<<"\n";
}
}
fiter.reset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment