avg
Calculate average, standard deviation, min, and max for (or over) data sets.
Not to be confused with the average command.
avg <dset0> [<dset1> ...] [torsion] [out <file>] [oversets] [name <name>] [nostdout]
<dsetX>
Data set(s) to calculate the average for.
[torsion]
If the data sets are not already marked periodic (e.g. if read in via ’readdata’), treat them as periodic torsion.
[out <file>]
File to write results to.
[oversets]
If specified, calculate the average over all input sets instead of each input set.
[name <name>]
Output data set name.
[nostdout]
If ’nostdout’ specified do not write averages to STDOUT when ’out’ not specified.
DataSets Created (not oversets):
<name>[avg]
Average of each set.
<name>[sd]
Standard deviation of each set.
<name>[ymin]
Y minimum of each set.
<name>[ymax]
Y maximum of each set.
<name>[yminidx]
Index of minimum Y value.
<name>[ymaxidx]
Index of maximum Y value.
<name>[names]
Name of each set.
DataSets Created (oversets)
<name>
Average over all input sets for each frame.
<name>[SD]
Standard deviation over all input sets for each frame.
Calculate the average, standard deviation, min, and max of given 1D data sets. Alternatively, if oversets is specified the average over each set for each point is calculated; this requires all input sets be the same size.
For example, to read in data from a file named perres.peptide.dat and calculate the averages etc for all the input sets:
readdata perres.peptide.dat avg perres.peptide.dat out output.dat name V
Another example using avg
within a CPPTRAJ run using the runanalysis command:
########################################## noexitonerror parm nowater.topo trajin 1/nowater.nc 1 last 1 trajin 2/nowater.nc 1 last 1 trajin 3/nowater.nc 1 last 1 check @N1,N2,P,OP1,OP2,C1',C2',C3',C4',O3',O4' skipbadframes silent ########################################## nastruct MyData naout data/nastruct.dat resrange 1-24 \ resmap bDA:A \ resmap bLA:A \ resmap aXA:A \ resmap 50G:G run runanalysis avg MyData[shear] out data/na-shear.dat oversets run