Datafiles usually contain columns of numbers, for example:
# T(K) mu0H(T) M(mb/T) [comment lines start with '#' ] 1 1 0.9 2 1 0.6 3 1 0.4 4 1 0.3 5 1 0.25
The following programs manipulate such data files, for example the program delcol deletes a column from a data file, some general features are:
col .... column expression ... e.g. 'tan(c1x7.52)+c2' here c1,c2,.. refer to column 1,2,... operations are multiplication (x), division(/) addition (+), subtraction(-), power (xx) trigonometric functions tan,cos,sin, asin,atan,acos exp,(natural) log *.* .... filenname
[]=[and prog col parprog1 parprog2 ... [and ...]] coldata ...... column number of data column to be fitted prog ...... program name, e.g. shiftcol col ...... column to which prog should be applied parprog1 ..... parameter of the program prog, which should be fitted filename... filename in order to fit data in column coldata, prog is run many times on the column col with varying parameter set parprog1 ..., the result is scaled to fit best the experimental data. If several programs are combined with option 'and' then the best linear combination of the results is calculated by linear regression to fit coldata. Starting values for the parameters parprog are taken from the commandline. initial Stepwidths are chosen 10percent of parameter value, or may be given by adding them to the parameter with an 's', e.g. 100.3s0.1 If a parameter should not be fitted and kept fix, add an 'f', e.g. 100.3f output: - files can be found in directory results - filename.fit is created with fitted function and parameter values examples: 1) to fit a gaussian to column 2 in datafile expdat (with xvalues in column 1) with starting values 132.3, 0.5 and 10 for position, fwhm and area, respectively: fitcol 2 gausscol 1 132.3 0.5 10 in exp.dat 2) to do the same fit but with a background create a column 3, fill it with constant values and use echo as a fake column manipulation program doing nothing. newcol 3 -c 1.0 exp.dat fitcol 2 gausscol 1 132.3 0.5 10 and rem 3 in exp.dat 3) to do the same with a linear background, put into a column 4 the x values newcol 4 -c 4.0 exp.dat fitcol 2 gausscol 1 132.3 0.5 10 and rem 3 and rem 4 in exp.dat 4) to fit two gaussians with fixed fwhm and stepping in position initially only with 0.1 fitcol 2 gausscol 1 132.3s0.1 0.5f 10 and gausscol 1 100.3s0.1 0.5f 10 and rem 3 and rem 4 in exp.dat
The formula for a gaussian is:
,
output: the y-value is written to stdout and environment variable MCPHASE_YVALUE 1/y-value is written to stdout MCPHASE_YVALUE_INVERSE standarddeviation to stdaout and MCPHASE_STA
output: the variable value is written to stdout and environment variable MCPHASE_GETVARIABLE_VALUE, the name is stored in MCPHASE_GETVARIABLE_NAME mind lines starting with # are ignored (unless these start with #!)
col ...... column containing y_k values followed by n ...... n columns containing x_ik (i=1 to n) filename... filename the program calculates the linear regression, i.e. the best values of coefficients ai such that y_k~sum_i a_i*x_ik for every data line k in the file. The n linear regression equations solved to determin a_i are (i,j=1 ...n): sum_k x_jk y_k = sum_i a_i (sum_k x_ik * x_jk) Output: - sdtoud: best coefficients a_i and standard deviation sta=sum_k (y_k-sum_i a_i*x_ik)^2 - file: new column col+n+1 contining sum_i a_i*x_ik
The rotation is done using the following formula:
![]() |
![]() |
![]() |
|
![]() |
![]() |
![]() |
(153) |
![]() |
(154) |
row : row number column : column number number : text to be placed in file at this position files : one or more filenames example: $0 4 5 3.142 data.dat replaces the number in row 4 and column 5 by 3.142 in file data.dat
![]() |
(155) |