//virtual bool datafile::getTIC( int /* fcn */, adcontrols::Chromatogram& c ) const { if ( lrpfile_ ) { std::vector< double > time, intens; lrpfile_->getTIC( time, intens ); c.resize( time.size() ); c.setTimeArray( time.data() ); c.setIntensityArray( intens.data() ); return true; } return false; }
bool rawdata::getTIC( int fcn, adcontrols::Chromatogram& c ) const { if ( tic_.size() > unsigned( fcn ) ) { c = *tic_[ fcn ]; c.setFcn( fcn ); return true; } return false; }
bool ChromatographyImpl::findPeaks( const adcontrols::Chromatogram& c ) { using adcontrols::Peaks; using adcontrols::Baselines; Integrator integrator; integrator.minimum_width( method_.minimumWidth() * 60.0 ); // min -> sec integrator.slope_sensitivity( method_.slope() ); // uV/sec -> uV/sec integrator.drift( method_.drift() / 60.0 ); // uV/min -> uV/sec integrator.timeOffset( c.minimumTime() ); integrator.samping_interval( c.sampInterval() ); // sec const size_t nSize = c.size(); const double * y = c.getIntensityArray(); for ( size_t i = 0; i < nSize; ++i ) integrator << *y++; integrator.close( method_, peaks_, baselines_ ); //size_t N = 0; //double sd = 0; double heightTotal = 0; double areaTotal = 0; for ( Peaks::vector_type::const_iterator it = peaks_.begin(); it != peaks_.end(); ++it ) { heightTotal += it->peakHeight(); areaTotal += it->peakArea(); } peaks_.heightTotal( heightTotal ); peaks_.areaTotal( areaTotal ); for ( Peaks::vector_type::iterator it = peaks_.begin(); it != peaks_.end(); ++it ) { it->percentArea( ( it->peakArea() / areaTotal ) * 100 ); it->percentHeight( ( it->peakHeight() / heightTotal ) * 100 ); } return true; }
// virtual bool datafile::getTIC( int fcn, adcontrols::Chromatogram& c ) const { (void)fcn; CComBSTR strSumIntensities( L"SumIntensity" ); CComBSTR strRetentionTime( L"RetentionTime" ); if( pAnalysis_->HasAnalysisData( &strSumIntensities ) ) { _variant_t vIntens = pAnalysis_->GetAnalysisData( &strSumIntensities ); SafeArray sIntens( vIntens ); c.resize( sIntens.size() ); c.setIntensityArray( reinterpret_cast< const double *>( sIntens.p() ) ); } if( pAnalysis_->HasAnalysisData( &strRetentionTime ) ) { // array of seconds _variant_t vTimes = pAnalysis_->GetAnalysisData( &strRetentionTime ); SafeArray sTimes( vTimes ); c.setTimeArray( reinterpret_cast< const double *>( sTimes.p() ) ); } return true; }
void SeriesData::setData( const adcontrols::Chromatogram& c ) { values_.resize( c.size() ); range_x_ = adcontrols::Chromatogram::toMinutes( c.timeRange() ); range_y_ = std::pair<double, double>( c.getMinIntensity(), c.getMaxIntensity() ); const double *x = c.getTimeArray(); const double *y = c.getIntensityArray(); const size_t size = c.size(); if ( x ) { for ( size_t i = 0; i < size; ++i ) values_[i] = QPointF( adcontrols::Chromatogram::toMinutes( x[i] ), y[i] ); } else { for ( size_t i = 0; i < size; ++i ) values_[i] = QPointF( adcontrols::Chromatogram::toMinutes( c.timeFromDataIndex( i ) ), y[i] ); } }