V(v).........verbose.......(silent) W(w)........WayPoints P(p)..........profile........(no profile) C(c)..........colourflag 
DTM or NameTextFile if DTM in channel U8+S16+1  stepDTM.............
 FullDTM.............
if NOT DTM text file seatruth/text_file.txt  Textfile FileName.txt contain up to 50 LineName, each with up to 1000 records
 Format for LineName: > LineName 
 Format for depth point: XUTM YUTM ZED WZ
 #Disable any line with a "#" character
 GPS or DGPS: just to make a note of positioning details of sea truth data

coefXY_deltaX_deltaY/coefZR_deltaZR Optional  This is optional and useless: better use a spreadsheet to prepare the textfile
 coefXY_deltaX_deltaY/coefZR_deltaZR
 sea truth data require to be offset and scaled
 these parameters provide offset and scaling factor as required
 X and Y are to be converted to UTM coordinates in kilometers and offsets are applie
 ZR are to be converted to meters and tidecorrected as required
 X =deltaX + X * coefXY
 Y =deltaY + Y * coefXY
 ZR =deltaZR +ZR *coefZR

ZM, ZR or ZT  Textfile format: data for regression
 ZM: text file format is X Y ZR
 Read ZR from textfile
 Model ZC from scratch at each depth point (recommended)
 ZR: text file format is X Y ZR ==> Read ZR from textfile and Read ZC from image
 ZT: text file format is X Y ZR ZC ==> Read both ZR and ZC from textfile

OPTIONS FOR PLOTTING .../WZmin_WZmax/BZmin_BZmax/ZRmin_ZRmax/...  Limited range for regression
 WZm_WZM............regression only for sea truth pixels with WZmin<=WZ<=WZmax
 BZm, BZM..............regression only for sea truth pixels with BZmin<=B <=BZmax
 ZRm_ZRM..............regression only for sea truth pixels with ZRmin<=ZR<=ZRmax

NameLine  Groups: Sea Truth Text File may describe up to 40 groups of depth points, like one/several group(s) of scattered depth points, or a series of depth sounding lines
 Each group may contain up to 1000 depth points
 Group name: In the text file, each group is introduced by a header
 > LineName1 
 > LineName2 
 > LineName3 
 ...
 Records: followed by up to 1000 records with format XUTM YUTM ZR (or XUTM YUTM ZR ZC
 NameLine parameter may be specified as LineName (a line name or a line number)
 ALL: if NameLine is specified by "ALL" in the RegressZZ... argument, then all depth points from whatever LineName(s) shall be used for computing the regression
 *: if NameLine is specified by "*", then all depth points from whatever LineName(s) shall be used for computing the regression
 LineName: else, only depth points that belong to specified LineName shall be used for computing the regression


optional  Plot_16 append Plot_N to burn the seatruth pixels in ChannelSeatruth

APPROACH  First offset and scale the recorded data (use a spreadsheet)
 Assign each recorded point to relevant pixel through georeferencing information provided
 Then
 ZR: either read ZC values from 16S channel imageZG of image.pix file
 ZM: or preferably model each relevant pixel in actual and updated conditions
 Then compute the linear regression of ZC=A + B * ZR
 Text file output: then write a database_regressZZ.txt text file
 PostScript output: then format and execute a GMT script database_regressZZ.sh to display the data and the regression in a database_regressZZ.eps PostScript file

OUTPUT is textfile database_regressZZ.txt 
LINEAR REGRESSION ALGORITHM  compute
 average xm of X values (ZRecorded)
 average ym of Y values (ZComputed)
 A=Sum[(xxm)*(yym)]
 B=Sum[(xxm)*(xxm)]
 C=Sum[(yym)*(yym)]
 a =A/B
 a'=A/C
 regression line y=a * x + b
 regression slope a
 regression bias b=ym  a * xm
 determination coefficient R2=a * a'
 R2=0.059 means very poor correlation
 0<=R2<=1 ==> 1<R<+1
 The sign for R must be chosen manually
 correlation coefficient r=sqrt(R2)

RMS ERROR quoted from IDRISI glossary  The rootmeansquare error is a measure of the variability of measurements about their true values.
 The rms error is estimated by taking a sample of measurements, and comparing them to their true values.
 These differences are then squared and summed.
 The sum is then divided by the number of measurements to achieve a mean square deviation.
 The square root of the mean square deviation is then taken to produce a characteristic error measure in the same units as the original measurements.
 The rms error is directly comparable to the concept of a standard deviation.
