1 #include <QApplication>
31 #define DbgLv(a) if(dbg_level>=a)qDebug()
34 int main(
int argc,
char* argv[] )
36 QApplication application( argc, argv );
44 return application.exec();
49 const QChar chlamb( 955 );
51 setWindowTitle( tr(
"Multi-Wavelength S Spectra Viewer" ) );
54 QGridLayout* settings =
new QGridLayout;
63 QFontMetrics fmet( sfont );
64 int fwid = fmet.maxWidth();
72 QLabel* lb_run =
us_banner ( tr(
"Load the Models" ) );
79 QLabel* lb_smooth =
us_label( tr(
"%1 Gaussian Smooth Points:" )
90 QLabel* lb_prcntls =
us_banner( tr(
"Plot Range Controls" ) );
91 QLabel* lb_sstart =
us_label( tr(
"S Start:" ), -1 );
93 QLabel* lb_send =
us_label( tr(
"S End:" ), -1 );
95 QLabel* lb_lstart =
us_label( tr(
"%1 Start:" ).arg( chlamb ), -1 );
97 QLabel* lb_lend =
us_label( tr(
"%1 End:" ).arg( chlamb ), -1 );
110 QLabel* lb_advplot =
us_banner( tr(
"Advanced Plotting Control" ) );
116 QLabel* lb_delay =
us_label( tr(
"Delay" ) );
125 QLabel* lb_status =
us_banner( tr(
"Status" ) );
128 stpal.setColor( QPalette::Text, Qt::white );
129 stpal.setColor( QPalette::Base, Qt::blue );
140 connect(
pb_reset, SIGNAL( clicked() ),
144 connect(
cb_sstart, SIGNAL( currentIndexChanged(
int ) ),
146 connect(
cb_send, SIGNAL( currentIndexChanged(
int ) ),
148 connect(
cb_lstart, SIGNAL( currentIndexChanged(
int ) ),
150 connect(
cb_lend, SIGNAL( currentIndexChanged(
int ) ),
152 connect(
ct_smooth, SIGNAL( valueChanged(
double ) ),
154 connect(
cb_pltrec, SIGNAL( currentIndexChanged(
int ) ),
156 connect(
pb_prev, SIGNAL( clicked() ),
158 connect(
pb_next, SIGNAL( clicked() ),
170 connect( pb_help, SIGNAL( clicked() ),
171 this, SLOT (
help() ) );
172 connect( pb_close, SIGNAL( clicked() ),
173 this, SLOT ( close() ) );
177 settings->addLayout(
dkdb_cntrls, row++, 0, 1, 8 );
178 settings->addWidget( lb_run, row++, 0, 1, 8 );
179 settings->addWidget(
pb_prefilt, row, 0, 1, 4 );
180 settings->addWidget(
pb_loaddis, row++, 4, 1, 4 );
181 settings->addWidget(
pb_reset, row, 0, 1, 4 );
182 settings->addWidget(
pb_details, row++, 4, 1, 4 );
183 settings->addWidget( lb_prcntls, row++, 0, 1, 8 );
184 settings->addWidget( lb_sstart, row, 0, 1, 2 );
185 settings->addWidget(
cb_sstart, row, 2, 1, 2 );
186 settings->addWidget( lb_send, row, 4, 1, 2 );
187 settings->addWidget(
cb_send, row++, 6, 1, 2 );
188 settings->addWidget( lb_lstart, row, 0, 1, 2 );
189 settings->addWidget(
cb_lstart, row, 2, 1, 2 );
190 settings->addWidget( lb_lend, row, 4, 1, 2 );
191 settings->addWidget(
cb_lend, row++, 6, 1, 2 );
192 settings->addWidget( lb_smooth, row, 0, 1, 4 );
193 settings->addWidget(
ct_smooth, row++, 4, 1, 2 );
194 settings->addWidget(
lb_pltrec, row, 0, 1, 2 );
195 settings->addWidget(
cb_pltrec, row, 2, 1, 2 );
196 settings->addWidget(
pb_prev, row, 4, 1, 2 );
197 settings->addWidget(
pb_next, row++, 6, 1, 2 );
198 settings->addWidget( lb_advplot, row++, 0, 1, 8 );
199 settings->addWidget(
pb_plot2d, row, 0, 1, 4 );
200 settings->addWidget(
pb_movie2d, row++, 4, 1, 4 );
201 settings->addWidget(
pb_plot3d, row, 0, 1, 4 );
202 settings->addWidget( lb_delay, row, 4, 1, 2 );
203 settings->addWidget(
ct_delay, row++, 6, 1, 2 );
204 settings->addWidget(
pb_svplot, row, 0, 1, 4 );
205 settings->addWidget(
pb_svmovie, row++, 4, 1, 4 );
206 settings->addWidget( lb_status, row++, 0, 1, 8 );
207 settings->addWidget(
le_status, row++, 0, 1, 8 );
208 settings->addWidget( pb_help, row, 0, 1, 4 );
209 settings->addWidget( pb_close, row++, 4, 1, 4 );
213 tr(
"S Record Spectrum Data"
214 "\nS (x 10^13) : 1.12" ),
215 tr(
"Wavelength (nm)" ),
216 tr(
"Concentration (OD)" ) );
220 data_plot->enableAxis( QwtPlot::xBottom,
true );
221 data_plot->enableAxis( QwtPlot::yLeft ,
true );
223 data_plot->setAxisScale( QwtPlot::xBottom, 230, 450 );
224 data_plot->setAxisScale( QwtPlot::yLeft , 0.0, 1.5 );
227 picker->setRubberBand ( QwtPicker::VLineRubberBand );
228 picker->setMousePattern ( QwtEventPattern::MouseSelect1,
229 Qt::LeftButton, Qt::ControlModifier );
233 QVBoxLayout* left =
new QVBoxLayout;
234 QVBoxLayout* right =
new QVBoxLayout;
235 QHBoxLayout*
main =
new QHBoxLayout(
this );
237 left ->addLayout( settings );
238 right->addLayout( plot );
240 main->setSpacing ( 2 );
241 main->setContentsMargins ( 2, 2, 2, 2 );
242 main->addLayout( left );
243 main->addLayout( right );
244 main->setStretch( 0, 2 );
245 main->setStretch( 1, 4 );
278 data_plot->setAxisScale( QwtPlot::xBottom, 230, 450 );
279 data_plot->setAxisScale( QwtPlot::yLeft , 0.0, 1.5 );
288 le_status->setText( tr(
"(no distributions loaded)" ) );
296 int status = QMessageBox::information(
this,
297 tr(
"New Data Warning" ),
298 tr(
"This will erase all data currently on the screen, and "
299 "reset the program to its starting condition. No hard-drive "
300 "data or database information will be affected. Proceed? " ),
301 tr(
"&OK" ), tr(
"&Cancel" ),
303 if ( status != 0 )
return;
309 data_plot->setTitle( tr(
"S Record Spectrum Data"
310 "\nS (x 10^13) : 1.00" ) );
317 if (
mdlxyz.count() == 0 )
348 for (
int jj = 0; jj <
nsedcos; jj++ )
349 slscos << QString::number(
sedcoes[ jj ] );
351 for (
int jj = 0; jj <
nlambda; jj++ )
352 sllmbs << QString::number(
lambdas[ jj ] );
368 cb_send ->setCurrentIndex( nsedcos - 1 );
370 cb_lend ->setCurrentIndex( nlambda - 1 );
377 cb_pltrec ->setCurrentIndex( nlambda / 2 );
378 qApp->processEvents();
387 srdiag.move( this->pos() + QPoint( 200, 200 ) );
388 connect( &srdiag, SIGNAL( dkdb_changed (
bool ) ),
391 if ( srdiag.exec() != QDialog::Accepted )
402 QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
404 lddiag.move( this->pos() + QPoint( 200, 200 ) );
406 connect( &lddiag, SIGNAL( changed (
bool ) ),
408 QApplication::restoreOverrideCursor();
410 if ( lddiag.exec() != QDialog::Accepted )
431 for (
int jj = 0; jj < models.count(); jj++ )
447 double scalen = 1.0 / (double)models.count();
449 for (
int jj = 0; jj <
nsedcos; jj++ )
452 DbgLv(1) <<
"LD: jj" << jj <<
"sedco" << sedco;
454 for (
int ii = 0; ii <
nlambda; ii++ )
456 double waveln = (double)
lambdas[ ii ];
457 DbgLv(1) <<
"LD: ii" << ii <<
"waveln" << waveln;
462 for (
int kk = 0; kk <
nipoint; kk++ )
464 if(kk<2||(kk+3)>nipoint)
476 conc = csum * scalen;
480 if(nconcs>5||conc>1000.0)
482 << nconcs << conc <<
"jj,ii" << jj << ii <<
"s wl" << sedco << waveln;
490 xyzdat << QVector3D( waveln, sedco, conc );
491 DbgLv(1) <<
"LD: nconcs" << nconcs;
496 DbgLv(1) <<
"LD: nipoint" << nipoint <<
"nnpoint" <<
nnpoint <<
"ntpoint"
501 for (
int jj = 0; jj <
nsedcos; jj++ )
503 QVector< double > cvect;
505 for (
int ii = 0; ii <
nlambda; ii++ )
507 cvect <<
xyzdat[ kdx++ ].z();
522 QString mdesc = mdescr.section( mdescr.left( 1 ), 1, 1 );
527 mdesc = mdesc.endsWith(
"model" ) ? mdesc : model.
description;
528 lambda = mdesc.section(
".", -3, -3 ).mid( 2 ).toInt();
531 if (
runID.isEmpty() )
533 runID = mdesc.section(
".", -4, -4 );
536 double waveln = (double)lambda;
539 if ( !
lambdas.contains( lambda ) )
542 for (
int jj = 0; jj < model.
components.size(); jj++ )
544 double sedc = model.
components[ jj ].s * 1e+13;
545 double conc = model.
components[ jj ].signal_concentration;
551 mdlxyz << QVector3D( waveln, sedc, conc );
553 DbgLv(1) <<
"LD: **co_max" <<
co_max <<
"conc" << conc <<
"jj" << jj
554 <<
"lambda sedc" << lambda << sedc <<
"mdesc" << mdesc;
556 if ( !
sedcoes.contains( sedc ) )
565 int nmodels =
mdescs.count();
566 int lmx = nmodels - 1;
567 QString fmd =
mdescs[ 0 ].section(
mdescs[ 0 ].left( 1 ), 1, 1 );
568 QString lmd =
mdescs[ lmx ].section(
mdescs[ lmx ].left( 1 ), 1, 1 );
571 double wln1 = (double)
lambdas[ 0 ];
581 QVector< int > istaa;
582 QVector< double > dstaa;
583 QVector< double > lmbsa;
584 QVector< double > sedsa;
585 QVector< double > consa;
586 QVector< int > istaw1;
587 QVector< double > dstaw1;
588 QVector< double > lmbsw1;
589 QVector< double > sedsw1;
590 QVector< double > consw1;
591 QVector< int > istaw2;
592 QVector< double > dstaw2;
593 QVector< double > lmbsw2;
594 QVector< double > sedsw2;
595 QVector< double > consw2;
596 QVector< int > istaw3;
597 QVector< double > dstaw3;
598 QVector< double > lmbsw3;
599 QVector< double > sedsw3;
600 QVector< double > consw3;
601 QVector< int > istaw4;
602 QVector< double > dstaw4;
603 QVector< double > lmbsw4;
604 QVector< double > sedsw4;
605 QVector< double > consw4;
606 QVector< int > istaw5;
607 QVector< double > dstaw5;
608 QVector< double > lmbsw5;
609 QVector< double > sedsw5;
610 QVector< double > consw5;
611 QVector< int > istas1;
612 QVector< double > dstas1;
613 QVector< double > lmbss1;
614 QVector< double > sedss1;
615 QVector< double > conss1;
616 QVector< int > istas2;
617 QVector< double > dstas2;
618 QVector< double > lmbss2;
619 QVector< double > sedss2;
620 QVector< double > conss2;
621 QVector< int > istas3;
622 QVector< double > dstas3;
623 QVector< double > lmbss3;
624 QVector< double > sedss3;
625 QVector< double > conss3;
626 QVector< int > istas4;
627 QVector< double > dstas4;
628 QVector< double > lmbss4;
629 QVector< double > sedss4;
630 QVector< double > conss4;
631 QVector< int > istas5;
632 QVector< double > dstas5;
633 QVector< double > lmbss5;
634 QVector< double > sedss5;
635 QVector< double > conss5;
638 dstaa .fill( 0.0, 10 );
640 dstaw1.fill( 0.0, 10 );
642 dstaw2.fill( 0.0, 10 );
644 dstaw3.fill( 0.0, 10 );
646 dstaw4.fill( 0.0, 10 );
648 dstaw5.fill( 0.0, 10 );
650 dstas1.fill( 0.0, 10 );
652 dstas2.fill( 0.0, 10 );
654 dstas3.fill( 0.0, 10 );
656 dstas4.fill( 0.0, 10 );
658 dstas5.fill( 0.0, 10 );
660 for (
int ii = 0; ii <
mdlxyz.count(); ii++ )
662 double wlnv =
mdlxyz[ ii ].x();
663 double sedv =
mdlxyz[ ii ].y();
664 double conv =
mdlxyz[ ii ].z();
666 if ( conv == 0.0 )
continue;
668 bld_stats( wlnv, sedv, conv, istaa, dstaa, lmbsa, sedsa, consa );
672 bld_stats( wlnv, sedv, conv, istaw1, dstaw1, lmbsw1, sedsw1, consw1 );
677 bld_stats( wlnv, sedv, conv, istaw2, dstaw2, lmbsw2, sedsw2, consw2 );
682 bld_stats( wlnv, sedv, conv, istaw3, dstaw3, lmbsw3, sedsw3, consw3 );
687 bld_stats( wlnv, sedv, conv, istaw4, dstaw4, lmbsw4, sedsw4, consw4 );
692 bld_stats( wlnv, sedv, conv, istaw5, dstaw5, lmbsw5, sedsw5, consw5 );
697 bld_stats( wlnv, sedv, conv, istas1, dstas1, lmbss1, sedss1, conss1 );
702 bld_stats( wlnv, sedv, conv, istas2, dstas2, lmbss2, sedss2, conss2 );
707 bld_stats( wlnv, sedv, conv, istas3, dstas3, lmbss3, sedss3, conss3 );
712 bld_stats( wlnv, sedv, conv, istas4, dstas4, lmbss4, sedss4, conss4 );
717 bld_stats( wlnv, sedv, conv, istas5, dstas5, lmbss5, sedss5, conss5 );
723 final_stats( istaw1, dstaw1, lmbsw1, sedsw1, consw1 );
724 final_stats( istaw2, dstaw2, lmbsw2, sedsw2, consw2 );
725 final_stats( istaw3, dstaw3, lmbsw3, sedsw3, consw3 );
726 final_stats( istaw4, dstaw4, lmbsw4, sedsw4, consw4 );
727 final_stats( istaw5, dstaw5, lmbsw5, sedsw5, consw5 );
728 final_stats( istas1, dstas1, lmbss1, sedss1, conss1 );
729 final_stats( istas2, dstas2, lmbss2, sedss2, conss2 );
730 final_stats( istas3, dstas3, lmbss3, sedss3, conss3 );
731 final_stats( istas4, dstas4, lmbss4, sedss4, conss4 );
732 final_stats( istas5, dstas5, lmbss5, sedss5, conss5 );
735 QString msg = tr(
"Multi-Wavelength Statistics for RunID %1 --\n\n" )
737 msg += tr(
"General Models Values and Counts.\n" );
738 msg += tr(
" First Model Description: %1\n" ).arg( fmd );
739 msg += tr(
" Last Model Description: %1\n" ).arg( lmd );
740 msg += tr(
" Models Loaded: %1\n" ).arg( nmodels );
741 msg += tr(
" Sedimentation Coefficients: %1\n" ).arg(
nsedcos );
742 msg += tr(
" Wavelengths: %1\n" ).arg(
nlambda );
743 msg += tr(
" Total Loaded Points: %1\n" ).arg(
nipoint );
744 msg += tr(
"\nNormalized Composite Input Grid.\n" );
745 msg += tr(
" Points after Normalizing: %1\n" ).arg(
nnpoint );
746 msg += tr(
" Maximum Single-Bin Points: %1\n" ).arg(
nc_max );
747 msg += tr(
" Maximum Concentration (OD): %1\n" ).arg(
cn_max );
748 msg += tr(
"Padded Full S x Lambda Grid.\n" );
749 msg += tr(
" Grid Points: %1\n" ).arg(
ntpoint );
750 msg += tr(
" Minimum Sedimentation Coeff.: %1\n" ).arg(
se_min );
751 msg += tr(
" Maximum Sedimentation Coeff.: %1\n" ).arg(
se_max );
752 msg += tr(
" Minimum Wavelength (nm): %1\n" ).arg(
wl_min );
753 msg += tr(
" Maximum Wavelength (nm): %1\n" ).arg(
wl_max );
754 msg += tr(
" Minimum Concentration (OD): %1\n" ).arg(
co_min );
755 msg += tr(
" Maximum Concentration (OD): %1\n" ).arg(
co_max );
756 msg += tr(
"Current Plotting Controls.\n" );
757 msg += tr(
" Start Sedimentation Coeff.: %1\n" ).arg(
sed_start );
758 msg += tr(
" End Sedimentation Coeff.: %1\n" ).arg(
sed_end );
759 msg += tr(
" Start Wavelength: %1\n" ).arg(
lmb_start );
760 msg += tr(
" End Wavelength: %1\n" ).arg(
lmb_end );
762 msg += tr(
"\nStatistical Details for the Full Model set.\n" );
763 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istaa[ 0 ] );
764 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istaa[ 1 ] );
765 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istaa[ 2 ] );
766 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstaa[ 0 ] );
767 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstaa[ 1 ] );
768 msg += tr(
" Mean Concentration: %1\n" ).arg( dstaa[ 4 ] );
769 msg += tr(
" Median Concentration: %1\n" ).arg( dstaa[ 9 ] );
770 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstaa[ 2 ] );
771 msg += tr(
" Median Wavelength: %1\n" ).arg( dstaa[ 7 ] );
772 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstaa[ 5 ] );
773 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstaa[ 3 ] );
774 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstaa[ 8 ] );
775 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstaa[ 6 ] );
776 msg += tr(
"\nStatistical Details for Wavelength %1 .\n" ).arg( wln1 );
777 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istaw1[ 0 ] );
778 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istaw1[ 1 ] );
779 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istaw1[ 2 ] );
780 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstaw1[ 0 ] );
781 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstaw1[ 1 ] );
782 msg += tr(
" Mean Concentration: %1\n" ).arg( dstaw1[ 4 ] );
783 msg += tr(
" Median Concentration: %1\n" ).arg( dstaw1[ 9 ] );
784 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstaw1[ 2 ] );
785 msg += tr(
" Median Wavelength: %1\n" ).arg( dstaw1[ 7 ] );
786 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstaw1[ 5 ] );
787 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstaw1[ 3 ] );
788 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstaw1[ 8 ] );
789 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstaw1[ 6 ] );
790 msg += tr(
"Statistical Details for Wavelength %1 .\n" ).arg( wln2 );
791 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istaw2[ 0 ] );
792 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istaw2[ 1 ] );
793 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istaw2[ 2 ] );
794 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstaw2[ 0 ] );
795 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstaw2[ 1 ] );
796 msg += tr(
" Mean Concentration: %1\n" ).arg( dstaw2[ 4 ] );
797 msg += tr(
" Median Concentration: %1\n" ).arg( dstaw2[ 9 ] );
798 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstaw2[ 2 ] );
799 msg += tr(
" Median Wavelength: %1\n" ).arg( dstaw2[ 7 ] );
800 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstaw2[ 5 ] );
801 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstaw2[ 3 ] );
802 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstaw2[ 8 ] );
803 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstaw2[ 6 ] );
804 msg += tr(
"Statistical Details for Wavelength %1 .\n" ).arg( wln3 );
805 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istaw3[ 0 ] );
806 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istaw3[ 1 ] );
807 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istaw3[ 2 ] );
808 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstaw3[ 0 ] );
809 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstaw3[ 1 ] );
810 msg += tr(
" Mean Concentration: %1\n" ).arg( dstaw3[ 4 ] );
811 msg += tr(
" Median Concentration: %1\n" ).arg( dstaw3[ 9 ] );
812 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstaw3[ 2 ] );
813 msg += tr(
" Median Wavelength: %1\n" ).arg( dstaw3[ 7 ] );
814 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstaw3[ 5 ] );
815 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstaw3[ 3 ] );
816 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstaw3[ 8 ] );
817 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstaw3[ 6 ] );
818 msg += tr(
"Statistical Details for Wavelength %1 .\n" ).arg( wln4 );
819 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istaw4[ 0 ] );
820 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istaw4[ 1 ] );
821 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istaw4[ 2 ] );
822 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstaw4[ 0 ] );
823 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstaw4[ 1 ] );
824 msg += tr(
" Mean Concentration: %1\n" ).arg( dstaw4[ 4 ] );
825 msg += tr(
" Median Concentration: %1\n" ).arg( dstaw4[ 9 ] );
826 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstaw4[ 2 ] );
827 msg += tr(
" Median Wavelength: %1\n" ).arg( dstaw4[ 7 ] );
828 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstaw4[ 5 ] );
829 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstaw4[ 3 ] );
830 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstaw4[ 8 ] );
831 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstaw4[ 6 ] );
832 msg += tr(
"Statistical Details for Wavelength %1 .\n" ).arg( wln5 );
833 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istaw5[ 0 ] );
834 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istaw5[ 1 ] );
835 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istaw5[ 2 ] );
836 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstaw5[ 0 ] );
837 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstaw5[ 1 ] );
838 msg += tr(
" Mean Concentration: %1\n" ).arg( dstaw5[ 4 ] );
839 msg += tr(
" Median Concentration: %1\n" ).arg( dstaw5[ 9 ] );
840 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstaw5[ 2 ] );
841 msg += tr(
" Median Wavelength: %1\n" ).arg( dstaw5[ 7 ] );
842 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstaw5[ 5 ] );
843 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstaw5[ 3 ] );
844 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstaw5[ 8 ] );
845 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstaw5[ 6 ] );
846 msg += tr(
"\nStatistical Details for Sed.Coeff. %1 .\n" ).arg( sed1 );
847 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istas1[ 0 ] );
848 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istas1[ 1 ] );
849 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istas1[ 2 ] );
850 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstas1[ 0 ] );
851 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstas1[ 1 ] );
852 msg += tr(
" Mean Concentration: %1\n" ).arg( dstas1[ 4 ] );
853 msg += tr(
" Median Concentration: %1\n" ).arg( dstas1[ 9 ] );
854 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstas1[ 2 ] );
855 msg += tr(
" Median Wavelength: %1\n" ).arg( dstas1[ 7 ] );
856 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstas1[ 5 ] );
857 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstas1[ 3 ] );
858 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstas1[ 8 ] );
859 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstas1[ 6 ] );
860 msg += tr(
"Statistical Details for Sed.Coeff. %1 .\n" ).arg( sed2 );
861 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istas2[ 0 ] );
862 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istas2[ 1 ] );
863 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istas2[ 2 ] );
864 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstas2[ 0 ] );
865 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstas2[ 1 ] );
866 msg += tr(
" Mean Concentration: %1\n" ).arg( dstas2[ 4 ] );
867 msg += tr(
" Median Concentration: %1\n" ).arg( dstas2[ 9 ] );
868 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstas2[ 2 ] );
869 msg += tr(
" Median Wavelength: %1\n" ).arg( dstas2[ 7 ] );
870 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstas2[ 5 ] );
871 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstas2[ 3 ] );
872 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstas2[ 8 ] );
873 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstas2[ 6 ] );
874 msg += tr(
"Statistical Details for Sed.Coeff. %1 .\n" ).arg( sed3 );
875 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istas3[ 0 ] );
876 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istas3[ 1 ] );
877 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istas3[ 2 ] );
878 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstas3[ 0 ] );
879 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstas3[ 1 ] );
880 msg += tr(
" Mean Concentration: %1\n" ).arg( dstas3[ 4 ] );
881 msg += tr(
" Median Concentration: %1\n" ).arg( dstas3[ 9 ] );
882 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstas3[ 2 ] );
883 msg += tr(
" Median Wavelength: %1\n" ).arg( dstas3[ 7 ] );
884 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstas3[ 5 ] );
885 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstas3[ 3 ] );
886 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstas3[ 8 ] );
887 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstas3[ 6 ] );
888 msg += tr(
"Statistical Details for Sed.Coeff. %1 .\n" ).arg( sed4 );
889 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istas4[ 0 ] );
890 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istas4[ 1 ] );
891 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istas4[ 2 ] );
892 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstas4[ 0 ] );
893 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstas4[ 1 ] );
894 msg += tr(
" Mean Concentration: %1\n" ).arg( dstas4[ 4 ] );
895 msg += tr(
" Median Concentration: %1\n" ).arg( dstas4[ 9 ] );
896 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstas4[ 2 ] );
897 msg += tr(
" Median Wavelength: %1\n" ).arg( dstas4[ 7 ] );
898 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstas4[ 5 ] );
899 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstas4[ 3 ] );
900 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstas4[ 8 ] );
901 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstas4[ 6 ] );
902 msg += tr(
"Statistical Details for Sed.Coeff. %1 .\n" ).arg( sed5 );
903 msg += tr(
" Total Non-Zero Count: %1\n" ).arg( istas5[ 0 ] );
904 msg += tr(
" Count of Wavelengths: %1\n" ).arg( istas5[ 1 ] );
905 msg += tr(
" Count of Sed. Coeffs.: %1\n" ).arg( istas5[ 2 ] );
906 msg += tr(
" Minimum Concentration: %1\n" ).arg( dstas5[ 0 ] );
907 msg += tr(
" Maximum Concentration: %1\n" ).arg( dstas5[ 1 ] );
908 msg += tr(
" Mean Concentration: %1\n" ).arg( dstas5[ 4 ] );
909 msg += tr(
" Median Concentration: %1\n" ).arg( dstas5[ 9 ] );
910 msg += tr(
" Mean Wavelength: %1\n" ).arg( dstas5[ 2 ] );
911 msg += tr(
" Median Wavelength: %1\n" ).arg( dstas5[ 7 ] );
912 msg += tr(
" Weighted Avg. Wavelength: %1\n" ).arg( dstas5[ 5 ] );
913 msg += tr(
" Mean Sed. Coeff.: %1\n" ).arg( dstas5[ 3 ] );
914 msg += tr(
" Median Sed. Coeff.: %1\n" ).arg( dstas5[ 8 ] );
915 msg += tr(
" Weighted Avg. Sed. Coeff.: %1\n" ).arg( dstas5[ 6 ] );
919 editd->setWindowTitle( tr(
"Multi-Wavelength Spectra Statistics" ) );
920 editd->move( pos() + QPoint( 200, 200 ) );
921 editd->resize( 600, 500 );
924 editd->
e->setText( msg );
931 if (
mdlxyz.count() == 0 )
945 QString title = tr(
"Sedimentation Coefficient Spectrum\n"
946 "Run ID : " ) +
runID +
"\ns (x 10^13) : " + prec;
965 for(
int ii=0;ii<
kpoint;ii++)
966 {
double cvl=
pltyvals[ii];
if(cvl!=0.0) knz++; cmx=qMax(cmx,cvl); }
967 DbgLv(1) <<
"PltA: kpoint" << kpoint <<
"knz" << knz <<
"cmx" << cmx;
973 QString title = tr(
"s=%1 sindex=%2" ).arg(
sed_plot ).arg(
sedxp );
976 curv->setPen( pen_plot );
978 curv->setData( rr, vv, kpoint );
1003 QwtScaleDiv* sdx =
data_plot->axisScaleDiv( QwtPlot::xBottom );
1004 QwtScaleDiv* sdy =
data_plot->axisScaleDiv( QwtPlot::yLeft );
1016 DbgLv(1) <<
"chgSedcoeff";
1043 DbgLv(1) <<
"chgLambda";
1058 bool plt_one = !
le_status->text().contains( tr(
"saving" ) );
1073 int pltrx =
cb_pltrec->currentIndex() - 1;
1081 QwtScaleDiv* sdx =
data_plot->axisScaleDiv( QwtPlot::xBottom );
1082 QwtScaleDiv* sdy =
data_plot->axisScaleDiv( QwtPlot::yLeft );
1094 int pltrx =
cb_pltrec->currentIndex() + 1;
1097 if ( ( pltrx + 2 ) > nitems )
1103 QwtScaleDiv* sdx =
data_plot->axisScaleDiv( QwtPlot::xBottom );
1104 QwtScaleDiv* sdy =
data_plot->axisScaleDiv( QwtPlot::yLeft );
1116 DbgLv(1) <<
"chgSmooth:";
1157 for (
int ii = lmbxs; ii <
lmbxe; ii++ )
1161 for (
int ii = lmbxs; ii <
lmbxe; ii++ )
1172 connect(
cb_sstart, SIGNAL( currentIndexChanged(
int ) ),
1174 connect(
cb_send, SIGNAL( currentIndexChanged(
int ) ),
1176 connect(
cb_lstart, SIGNAL( currentIndexChanged(
int ) ),
1178 connect(
cb_lend, SIGNAL( currentIndexChanged(
int ) ),
1180 connect(
cb_pltrec, SIGNAL( currentIndexChanged(
int ) ),
1197 DbgLv(1) <<
"Show 2D Movie";
1201 int mdelay = (int)qRound(
ct_delay->value() * 1000.0 );
1203 for (
int prx = 0; prx <
krecs; prx++ )
1206 qApp->processEvents();
1211 qApp->processEvents();
1217 DbgLv(1) <<
"Plt3D";
1227 QVector< double > cvect;
1229 double sedv =
xyzdat[ jd ].y();
1233 cvect <<
xyzdat[ jd + ii ].z();
1241 for (
int ii = 0; ii < cvect.count(); ii++, jd++ )
1243 double wlnv =
xyzdat[ jd ].x();
1244 double conv = cvect [ ii ];
1246 p3dxyz << QVector3D( wlnv, sedv, conv );
1257 int cx = qApp->desktop()->width() -
p3d_ctld->width() - 40;
1260 connect(
p3d_ctld, SIGNAL( has_closed() ),
1275 QString ptitle = tr(
"MWL 3-D Plot, Spectra" );
1287 DbgLv(1) <<
"Save Plot";
1289 QDir().mkpath( savedir );
1290 savedir = savedir.replace(
"\\",
"/" ) +
"/";
1291 QString fname2d =
runID +
".SSpectra_sedRec_RRRRR_2D.png";
1292 QString fname3d =
runID +
".SSpectra_3D.png";
1294 int nfiles = (
p3d_pltw != NULL ) ? 2 : 1;
1300 QString fpath3d = savedir + fname3d;
1302 p3d_pltw->save_plot( fpath3d, QString(
"png" ) );
1306 QString rec_str =
cb_pltrec->currentText().replace(
".",
"p" );
1307 fname2d = fname2d.replace(
"RRRRR", rec_str );
1308 QString fpath2d = savedir + fname2d;
1313 QString mtitle = ( nfiles == 1 )
1314 ? tr(
"Plot File Saved" )
1315 : tr(
"Plot Files Saved" );
1316 QString msg = tr(
"In the directory\n %1,\n\n" ).arg( savedir );
1318 msg += tr(
"File\n %1 was saved." ).arg( fname2d );
1320 msg += tr(
"Files\n %1 ; and\n %2\nwere saved." )
1321 .arg( fname3d ).arg( fname2d );
1323 QMessageBox::information(
this, mtitle, msg );
1329 DbgLv(1) <<
"Save 2D Movie";
1335 QDir().mkpath( savedir );
1336 savedir = savedir.replace(
"\\",
"/" ) +
"/";
1337 QString bfname =
runID +
".2D_frame_XXXXX.png";
1338 QString bstat = tr(
"Of %1 records, saving frame " ).arg( krecs );
1341 for (
int prx = 0; prx <
krecs; prx++ )
1344 qApp->processEvents();
1346 QString frm_str = QString().sprintf(
"%05d", ( prx + 1 ) );
1347 QString fname = QString( bfname ).replace(
"XXXXX", frm_str );
1348 QString fpath = savedir + fname;
1357 qApp->processEvents();
1359 QMessageBox::information(
this, tr(
"Frame Files Saved" ),
1360 tr(
"In the directory\n %1,\n\n%2 2-D movie frame files"
1361 " were saved:\n %3\n ...\n %4 ." )
1362 .arg( savedir ).arg( krecs ).arg( fnames[ 0 ] )
1363 .arg( fnames[ krecs - 1 ] ) );
1369 const double eps = 1.e-4;
1371 int indx = dvec.indexOf( dval );
1376 for (
int jj = 0; jj < dvec.size(); jj++ )
1378 double ddif = qAbs( dvec[ jj ] - dval );
1394 const double eps = 1.e-4;
1396 return ( qAbs( ( d1 - d2 ) / d2 ) < eps );
1417 QVector< int >& istats, QVector< double >& dstats,
1418 QVector< double >& lwlns, QVector< double >& lseds,
1419 QVector< double >& lcons )
1421 if ( conv == 0.0 )
return;
1425 istats[ 1 ] += lwlns.contains( wlnv ) ? 0 : 1;
1426 istats[ 2 ] += lseds.contains( sedv ) ? 0 : 1;
1429 dstats[ 0 ] = ( istats[ 0 ] == 1 ) ? conv : qMin( dstats[ 0 ], conv );
1430 dstats[ 1 ] = ( istats[ 0 ] == 1 ) ? conv : qMax( dstats[ 1 ], conv );
1431 dstats[ 2 ] += wlnv;
1432 dstats[ 3 ] += sedv;
1433 dstats[ 4 ] += conv;
1436 dstats[ 5 ] += ( wlnv * conv );
1437 dstats[ 6 ] += ( sedv * conv );
1447 QVector< double >& dstats, QVector< double >& lwlns,
1448 QVector< double >& lseds, QVector< double >& lcons )
1455 double dnnz = (double)istats[ 0 ];
1456 double ctot = dstats[ 4 ];
1457 dstats[ 2 ] /= dnnz;
1458 dstats[ 3 ] /= dnnz;
1459 dstats[ 4 ] /= dnnz;
1460 dstats[ 5 ] /= ctot;
1461 dstats[ 6 ] /= ctot;
1467 dstats[ 7 ] = lwlns[ lwlns.count() / 2 ];
1468 dstats[ 8 ] = lseds[ lseds.count() / 2 ];
1469 dstats[ 9 ] = lcons[ lcons.count() / 2 ];