#!/bin/csh # $1 is the input file (pin elevation data file) # $2 is the plot subtitle description ("After Chiselling", etc.) # $3 determines what plots are generated (sum up values for multiple plots) # 1 == Weibull plot of actual and model data sets # 2 == Weibull plot of inearized actual and model data sets # 4 == Plot of storage/trapping data set # $4 determines whether the plots are sent to the printer (set to -h if YES) # tmp files used are: shelter.tmp, cum_freq.actual.tmp, cum_freq.model.tmp, weibull.parms.tmp # gr_parm.tmp, linear.actual.tmp, linear.model.tmp # C and k parameters are appended to weibull.parms.out onintr quit set PROG = xvgr # use exponential weighting method on Weibull regressions set WB_WT = W # generate a list of shelter angles (in degrees) shelter -sD < $1 >! shelter.tmp # obtain the cumulative frequency distribution for the sorted shelter angles wbull_regress < shelter.tmp >! cum_freq.actual.tmp # obtain the weibull parameters for the sorted shelter angles (using weighting method) wbull_regress -s${WB_WT} < shelter.tmp >! weibull.parms.tmp # generate a cumulative frequency distribution data set from the original shelter angles set CKPARMS = `awk '{print " -C " $1 " -k " $2}' < weibull.parms.tmp` weibull ${CKPARMS} < shelter.tmp >! cum_freq.model.tmp # obtain info needed by plots later set CK = `awk '{print "(C=" $1 ",k=" $2 ")"}' < weibull.parms.tmp` set SCALE = `awk '{print $1}' < weibull.parms.tmp` if ((${3} & 1) == 1) then # make a temporay multi-data set file for ${PROG} # modify the gr.shelter.parm file for this plot sed -e "s,dataset1,$1," < gr.shelter.parm | \ sed -e "s/dataset2/Model ${CK}/" | \ sed -e "s,subtitle file,subtitle $2," >! gr_parm.tmp ${PROG} -p gr_parm.tmp cum_freq.actual.tmp cum_freq.model.tmp $4 endif # plot linearized data if specified if ((${3} & 2) == 2) then wbull_regress -l${WB_WT} < shelter.tmp >! linear.actual.tmp wbull_cum_freq ${CKPARMS} | dm s1 | wbull_regress -l${WB_WT} >! linear.model.tmp sed -e "s,dataset1,$1," < gr.linear.parm | \ sed -e "s/dataset2/Model ${CK}/" | \ sed -e "s,subtitle file,subtitle $2," >! gr_parm.tmp ${PROG} -p gr_parm.tmp linear.actual.tmp linear.model.tmp $4 endif if ((${3} & 4) == 4) then shelter -tC${SCALE} < $1 >! trapping.actual.tmp reg trapping.actual.tmp .02 .01 .001 >! reg.parms.tmp set c2 = `awk '{print $1}' < reg.parms.tmp` dm "x2" "exp(-(x1^${c2}))" < trapping.actual.tmp | \ regress | sed -e "1,13d" -e "18,19d" -e "16d" | awk '{print $3}' | \ transpose >! reg.parms.tmp set c1 = `awk '{print $1}' < reg.parms.tmp` set c3 = `awk '{print $2}' < reg.parms.tmp` set c4 = `awk '{print $3}' < reg.parms.tmp` echo "${c1} ${c2} ${c3} ${c4}" >! reg.parms.tmp genlntable 0 90 ${c3} ${c1} ${c2} >! trapping.model.tmp sed -e "s;dataset1;$1 ${CK};" < gr.trapping.parm | \ sed -e "s/dataset2/y=a*exp(-(x^b)+c Model (RR: ${c4})/" | \ sed -e "s,subtitle file,subtitle $2," >! gr_parm.tmp ${PROG} -p gr_parm.tmp trapping.actual.tmp trapping.model.tmp $4 endif echo $1 >>! files.out cat weibull.parms.tmp >>! weibull.parms.out if ((${3} & 4) == 4) then cat reg.parms.tmp >>! reg.parms.out endif goto done quit: echo "" echo "Aborting this run" echo "" done: # rm *.tmp