Changeset 238
 Timestamp:
 Jan 14, 2008 4:25:16 PM (13 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
r222 r238 22 22 Variable/G USANS_N=numpnts($(basestr+"_q")) 23 23 Variable/G USANS_dQv = dQv 24 String/G USANS_basestr = basestr24 String/G root:myGlobals:USANS_basestr = basestr 25 25 26 26 Make/D/O/N=(USANS_N,USANS_N) $(basestr+"_res") … … 34 34 Variable/G USANS_slope_numpnts = 10 35 35 36 Print " Calculating Weighting Matrix for USANS Data " 37 36 38 EnterSlope(basestr) 37 39 40 //Deal with broken Pauseforuser 41 SetDataFolder $("root:"+basestr) 42 38 43 print USANS_m 39 44 … … 61 66 String baseStr 62 67 68 NVAR USANS_m,USANS_slope_numpnts 69 63 70 // Variable slope=4 64 71 … … 71 78 // return slope 72 79 73 NewPanel / K=1/W=(1141,543,1548,910)/N=USANS_Slope as "USANS Slope Extrapolation"80 NewPanel /W=(600,300,1000,700)/N=USANS_Slope as "USANS Slope Extrapolation" 74 81 SetDrawLayer UserBack 75 82 Button button_OK,pos={294,317},size={100,20},title="Accept Slope",font="Geneva" 76 83 Button button_OK,proc=USANS_Slope_ButtonProc 77 Button button_Cancel,pos={233,317},size={55,20},title="Cancel",font="Geneva"78 Button button_Cancel,proc=USANS_Slope_ButtonProc84 //Button button_Cancel,pos={233,317},size={55,20},title="Cancel",font="Geneva" 85 //Button button_Cancel,proc=USANS_Slope_ButtonProc 79 86 SetVariable setvar_numpnts, pos={43,350}, size={150,19}, title="# Points",fSize=13 80 87 SetVariable setvar_numpnts, value= USANS_slope_numpnts … … 86 93 SetActiveSubwindow ## 87 94 88 Print GetDataFolder(1) 95 //Print TraceNameList("USANS_Slope#SlopePlot",";",1) 96 97 USANS_CalculateSlope(basestr,USANS_slope_numpnts) 98 89 99 PauseForUser USANS_Slope 90 Print GetDataFolder(1)91 100 // return slope 92 101 93 102 End 103 104 Function USANS_CalculateSlope(basestr, calcpoints) 105 String basestr 106 Variable calcpoints 107 108 Wave iw = $(basestr+"_i") 109 Wave qw = $(basestr+"_i") 110 Wave sw = $(basestr+"_i") 111 112 Variable num_extr=25 113 NVAR nend = USANS_slope_numpnts 114 // Make extra waves for extrapolation 115 // Taken from DSM_SetExtrWaves 116 117 Make/O/D/N=(num_extr) extr_hqq,extr_hqi 118 extr_hqi=1 //default values 119 120 //set the qrange 121 Variable qmax,num 122 123 num=numpnts(qw) 124 qmax=6*qw[num1] 125 126 extr_hqq = qw[num1] + x * (qmaxqw[num1])/num_extr 127 128 129 // Modifed from DSM_DoExtraploate in LakeDesmearing_JB.ipf 130 // which is part of the USANS Reduction macros 131 132 133 // Wave extr_lqi=extr_lqi 134 // Wave extr_lqq=extr_lqq 135 // Wave extr_hqi=extr_hqi 136 // Wave extr_hqq=extr_hqq 137 Variable/G V_FitMaxIters=300 138 Variable/G V_fitOptions=4 //suppress the iteration window 139 Variable retval 140 num=numpnts(iw) 141 142 Make/O/D P_coef={0,1,4} //input 143 // Make/O/T Constr={"K2<0","K2 > 20"} 144 //(set background to zero and hold fixed) 145 CurveFit/H="100" Power kwCWave=P_coef iw[(num1nend),(num1)] /X=qw /W=sw /D 146 extr_hqi=P_coef[0]+P_coef[1]*extr_hqq^P_coef[2] 147 148 Printf "Smeared Power law exponent = %g\r",P_coef[2] 149 Printf "**** For Desmearing, use a Power law exponent of %5.1f\r",P_coef[2]1 150 151 retVal = P_coef[2]1 152 return(retVal) 153 154 End 155 94 156 95 157 Function USANS_Slope_ButtonProc(ctrlName) : ButtonControl … … 115 177 116 178 Variable i,j 117 SVAR USANS_basestr 179 SVAR USANS_basestr=root:myGlobals:USANS_basestr 180 SetDataFolder $("root:"+USANS_basestr) 181 182 183 118 184 NVAR dQv = USANS_dQv 119 185 … … 138 204 Variable i,j 139 205 140 SVAR USANS_basestr 206 SVAR USANS_basestr=root:myGlobals:USANS_basestr 207 SetDataFolder $("root:"+USANS_basestr) 208 209 210 141 211 NVAR dQv = USANS_dQv 142 212 … … 161 231 Variable i 162 232 163 SVAR USANS_basestr 233 SVAR USANS_basestr=root:myGlobals:USANS_basestr 234 SetDataFolder $("root:"+USANS_basestr) 235 236 164 237 NVAR m = USANS_m 165 238 NVAR N = USANS_N … … 190 263 Variable i 191 264 192 SVAR USANS_basestr 265 SVAR USANS_basestr=root:myGlobals:USANS_basestr 266 SetDataFolder $("root:"+USANS_basestr) 267 193 268 NVAR m = USANS_m 194 269 NVAR qi = USANS_intQpt … … 202 277 203 278 End 204 205 Window USANS_Slope() : Panel206 PauseUpdate; Silent 1 // building window...207 NewPanel /K=1/W=(1141,543,1548,910) as "USANS Slope Extrapolation"208 SetDrawLayer UserBack209 Button button_OK,pos={294,317},size={100,20},title="Accept Slope",font="Geneva"210 Button button_Cancel,pos={233,317},size={55,20},title="Cancel",font="Geneva"211 SetVariable setvar_Slope,pos={43,321},size={100,19},title="Slope",fSize=13212 SetVariable setvar_Slope,limits={inf,inf,0},value= USANS_m213 Display/W=(9,6,402,305)/HOST=#214 RenameWindow #,G0215 SetActiveSubwindow ##216 EndMacro
Note: See TracChangeset
for help on using the changeset viewer.