samples;
for (int i = 0; i < list.size(); ++i){
if (cnt++ == 0)
imagesHtml.append("");
@@ -2166,15 +2193,21 @@ qDebug() << "circle fit"<< avgRadius << fittedcircle1.r << fittedcircle2.r;
wf->name = QString("%1").arg(list[i]->angle, 6, 'f', 2, QLatin1Char('0'));
cp->setSurface(wf);
- cp->resize(Width,Height);
+ cp->resize(Width,.8 * Height);
cp->replot();
+ astigSample sample(wf->name, wf->InputZerns[4], wf->InputZerns[5]);
+ samples << sample;
+ QSize s = cp->size();
contour.fill( QColor( Qt::white ).rgb() );
- renderer.render( cp, &painter, QRect(0,0,Width,Height) );
+ renderer.render( cp, &painter, QRect(0,0,s.width(),s.height() ));
+
QString imageName = QString("mydata://zern%1.png").arg(wf->name);
imageName.replace("-","CCW");
doc->addResource(QTextDocument::ImageResource, QUrl(imageName), QVariant(contour));
results.res.append (imageName);
- imagesHtml.append("  | ");
+
+ imagesHtml.append(QString(" ") + wf->name + "

| ");
+
if (cnt == 2){
cnt = 0;
imagesHtml.append("
");
@@ -2200,20 +2233,20 @@ qDebug() << "circle fit"<< avgRadius << fittedcircle1.r << fittedcircle2.r;
minMaxIdx(wf2->data, &mmin,&mmax);
wf2->min = mmin;
wf2->max = mmax;
- //wf2->workMask = m_wavefronts[0]->workMask.clone();
+
wf2->name = QString("Average Stand zernike based");
ContourPlot *cp1 = new ContourPlot();
- //cp1->m_zRangeMode = "Min/Max";
+
cp1->setSurface(wf2);
- cp1->resize(Width, Height);
+ cp1->resize(Width, .8 * Height);
cp1->replot();
- QImage contour2(500, 500, QImage::Format_ARGB32 );
+ QImage contour2(Width, Width, QImage::Format_ARGB32 );
contour2.fill( QColor( Qt::white ).rgb() );
QPainter painter2( &contour2 );
renderer.setDiscardFlag(QwtPlotRenderer::DiscardLegend, false);
renderer.render( cp1, &painter2, QRect(0,0,Width,Height) );
- QString imageName = "mydata://StandCotourZerns.png";
+ QString imageName = "mydata://StandContourZerns.png";
doc->addResource(QTextDocument::ImageResource, QUrl(imageName), QVariant(contour2));
wf2->data = wf2->workData = standavg;
@@ -2232,7 +2265,7 @@ qDebug() << "circle fit"<< avgRadius << fittedcircle1.r << fittedcircle2.r;
contour2.fill( QColor( Qt::white ).rgb() );
renderer.render( cp1, &painter2, QRect(0,0,Width,Height) );
cp1->m_zRangeMode = "Auto"; // restore contour plot to auto scaling.
- imageName = QString("mydata://StandCotourMat.png");
+ imageName = QString("mydata://StandContourMat.png");
doc->addResource(QTextDocument::ImageResource, QUrl(imageName), QVariant(contour2));
@@ -2271,11 +2304,6 @@ qDebug() << "circle fit"<< avgRadius << fittedcircle1.r << fittedcircle2.r;
mirrorXastig /= count;
mirrorYastig /= count;
- //QwtPlotMarker *mirrorMeanMark = new QwtPlotMarker();
- //mirrorMeanMark->setValue(QPointF(bestFitAstig.a, bestFitAstig.b));
- //mirrorMeanMark->setSymbol(new QwtSymbol(QwtSymbol::Triangle,QColor(0,255,0,40), QColor(0,0,0), QSize(30,30)));
- //mirrorMeanMark->attach(pl1);
-
QPolygonF stdCircle;
double SE = standStd[0]/sqrt(standastig.rows);
for (double rho = 0; rho <= 2 * M_PI; rho += M_PI/32.){
@@ -2309,15 +2337,16 @@ qDebug() << "circle fit"<< avgRadius << fittedcircle1.r << fittedcircle2.r;
curveAvgMirror->setPen(pen);
curveAvgMirror->setSamples(stdCircle);
curveAvgMirror->attach(pl1);
- pl1->resize(500,500);
+ pl1->resize(1.5 * Width,1.5 * Width);
pl1->replot();
- QwtPlotRenderer renderer3;
- QImage contour3(500, 500, QImage::Format_ARGB32 );
+
+ QImage contour3(1.5 * Width, 1.5 * Width , QImage::Format_ARGB32 );
contour3.fill( QColor( Qt::white ).rgb() );
QPainter painter3( &contour3 );
renderer.setDiscardFlag(QwtPlotRenderer::DiscardLegend, false);
- renderer.render( pl1, &painter3, QRect(0,0,500,500) );
+ renderer.render( pl1, &painter3, QRect(0,0,1.5 * Width,1.5 * Width) );
+
imageName = QString("mydata://plot.png");
doc->addResource(QTextDocument::ImageResource, QUrl(imageName), QVariant(contour3));
results.res.append (imageName);
@@ -2336,18 +2365,38 @@ qDebug() << "circle fit"<< avgRadius << fittedcircle1.r << fittedcircle2.r;
"The stand removal was good. Idealy the STD (standard deviation) should be"
" less than .1 which means less than .1 wave pv on the surface of the mirror"
"
The colored plus signs are what is calculated for test stand induced astig."
- "at each rotation angle.
"
+ "at each rotation angle.
The plot below is a polar plot of each rotations test stand astig."
+ "The ideal would be they are all the same magnitude and angle. If any one is much different than the rest then the astig removal may not be good.");
+ astigPolargraph *polar = new astigPolargraph(samples);
+ polar->hideHoverHelp();
+ polar->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
+ polar->resize(Width * 2, 2 * Width);
+ QImage polarImage(2 * Width, 2 * Width , QImage::Format_ARGB32 );
+ polarImage.fill( QColor( Qt::white ).rgb() );
+ QPainter painterPolar( &polarImage );
+
+
+ polar->render( &painterPolar);
+ delete polar;
+ imageName = QString("mydata://polarplot.png");
+ doc->addResource(QTextDocument::ImageResource, QUrl(imageName), QVariant(polarImage));
+ results.res.append (imageName);
+ html.append(" 
");
+
+ html.append(" |  |
"
+ "The contours above are the average system induced forces derived from the average of all rotations.
"
+ "The left contour is based on the zernike values and the contour on the right is based on the wavefront.
");
- ""
- "The contours above are the average system induced forces derived from the average of all rotations.
"
- "The left contour is based on the zernike values and the contour on the right is based on the wavefront.
"
- "The contour plots below are of what is beleived to be test stand only induced errors at each rotation. "
+
+ html.append( "
The contour plots below are of what is beleived to be test stand only induced errors at each rotation. "
"Check that they are similar at each rotation. If not then maybe "
"stand (system) induced error is not same at each rotation then the stand removal is not reliable. "
"However it is unlikely that they will all look exactly the same.
");
+
+
html.append(imagesHtml);
html.append("