Changeset 162
- Timestamp:
- Sep 13, 2007 5:00:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/USANS_SlitSmearing.ipf
r160 r162 32 32 33 33 Make/D/O/N=(USANS_N,USANS_N) $(basestr+"_res") 34 //Make/O/N=(N,N) W1mat35 //Make/O/N=(N,N) W2mat36 //Make/O/N=(N,N) Rmat34 Make/D/O/N=(USANS_N,USANS_N) W1mat 35 Make/D/O/N=(USANS_N,USANS_N) W2mat 36 Make/D/O/N=(USANS_N,USANS_N) Rmat 37 37 Wave weights = $(basestr+"_res") 38 38 39 39 Variable/G USANS_m = EnterSlope() 40 if(USANS_m == 999) 41 Killwaves/Z $(basestr+"_res") 42 return(1) //error 43 endif 40 44 41 Variable tref = startMSTimer 45 42 print "Calculating W1..." 46 weights = (p <= q ) && (q < USANS_N-1) ? CalcW1(p,q) : 043 W1mat = (p <= q ) && (q <= USANS_N-2) ? CalcW1(p,q) : 0 47 44 print "Calculating W2..." 48 weights += (p+1 <= q ) && (q < USANS_N) ? CalcW2(p,q) : 045 W2mat = (p+1 <= q ) && (q <= USANS_N-1) ? CalcW2(p,q) : 0 49 46 print "Calculating Remainders..." 50 weights += (q == USANS_N-1) ? CalcR(p) : 047 Rmat = (q == USANS_N-1) ? CalcR(p) : 0 51 48 // print "Summing weights..." 52 // Weights = W1mat + W2mat + Rmat49 weights = W1mat + W2mat + Rmat 53 50 print "Done" 54 51 Variable ms = stopMSTimer(tref) … … 64 61 Prompt slope "Enter a slope" 65 62 DoPrompt "Enter Slope", slope 66 If (V_Flag) 67 return (999) //return a bogus slope if the user canceled68 Endif 63 If (V_Flag) 64 return (999) //return a bogus slope if the user canceled 65 Endif 69 66 print "slope=", slope 70 67 return slope … … 122 119 123 120 SVAR USANS_basestr 121 NVAR m = USANS_m 124 122 NVAR N = USANS_N 125 123 NVAR dQv = USANS_dQv … … 127 125 Variable retval 128 126 Wave Qval = $(USANS_basestr+"_q") 127 Wave Ival = $(USANS_basestr+"_i") 129 128 Variable/G USANS_intQpt = Qval[i] 130 129 131 130 Variable lower = sqrt(qval[N-1]^2-qval[i]^2) 132 Variable upper = lower +dQv 131 Variable upper = dQv 132 133 if (i == N) 134 lower = 0 135 endif 133 136 134 137 retval = Integrate1D(Remainder,lower,upper) 138 139 retval *= 1/dQv 135 140 136 141 Return retval
Note: See TracChangeset
for help on using the changeset viewer.