/***/
/* modelXY -data ri.dat -macro diagFit.M -p 0.1 -gc 1 -tol 1.0e-8 \
/*         -var tSize $tSize fSize $fSize thisP0 -90 thisP1 180 xOff 0.5 x0 $loc \
/*         -silent -noverb
/***/

xfw  = abs(pList[0]);
dx   = xRange*sin(pList[1]) + xOff;

float bR[tSize], bI[tSize];

(void) vsSet( bR, tSize, 0.0 );
(void) vsSet( bI, tSize, 0.0 );

(void) vSim1D( bR, bI, tSize, fSize, x0 + dx, xfw, 1.0, thisP0, thisP1 );

(void) vvCopyOff( yList, bR, tSize, 0,     0 );
(void) vvCopyOff( yList, bI, tSize, tSize, 0 );

amp = vvScale( qList, yList, tSize );

(void) vsMult( yList, xyCount, amp );

thisRMS = vvRMSD( qList, yList, xyCount );

if (reportFlag)
{
 (void)printf( "x0: %7.2f dx: % .3f xfw: %9.4f amp: %9.4f p0: %7.2f RMSD: %7.2f\n",
               x0, dx, xfw, amp, thisP0, thisRMS );

 outFD = dOpen( outName, "rwa" );

 (void) dWrite( outFD, yList, wordLen*xyCount );
 (void) dClose( outFD );
};

