Changeset 509 for sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models
- Timestamp:
- May 18, 2009 5:15:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/Sphere_2D_v40.ipf
r253 r509 32 32 Duplicate/O $(str+"_qy") ywave_sf2D,zwave_sf2D 33 33 34 Variable/G g s_sf2D=035 g s_sf2D := Sphere2D(coef_sf2D,zwave_sf2D,xwave_sf2D,ywave_sf2D) //AAO 2D calculation34 Variable/G g_sf2D=0 35 g_sf2D := Sphere2D(coef_sf2D,zwave_sf2D,xwave_sf2D,ywave_sf2D) //AAO 2D calculation 36 36 37 37 Display ywave_sf2D vs xwave_sf2D … … 51 51 52 52 // not a function evaluation - this simply keeps the matrix for display in sync with the triplet calculation 53 Variable/G g s_sf2Dmat=054 g s_sf2Dmat := UpdateQxQy2Mat(xwave_sf2D,ywave_sf2D,zwave_sf2D,sf2D_lin,sf2D_mat)53 Variable/G g_sf2Dmat=0 54 g_sf2Dmat := UpdateQxQy2Mat(xwave_sf2D,ywave_sf2D,zwave_sf2D,sf2D_lin,sf2D_mat) 55 55 56 56 57 57 SetDataFolder root: 58 58 AddModelToStrings("Sphere2D","coef_sf2D","sf2D") 59 End 60 61 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 62 Proc PlotSmearedSphere2D(str) 63 String str 64 Prompt str,"Pick the data folder containing the 2D data",popup,getAList(4) 65 66 // if any of the resolution waves are missing => abort 67 // if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 68 // Abort 69 // endif 70 71 SetDataFolder $("root:"+str) 72 73 // Setup parameter table for model function 74 Make/O/D smear_coef_sf2D = {1.,60,1e-6,6.3e-6,0.01} 75 make/o/t smear_parameters_sf2D = {"scale","Radius (A)","SLD sphere (A-2)","SLD solvent (A-2)","bkgd (cm-1)"} 76 Edit smear_parameters_sf2D,smear_coef_sf2D 77 78 Duplicate/O $(str+"_qx") smeared_sf2D //1d place for the smeared model 79 SetScale d,0,0,"1/cm",smeared_sf2D 80 81 Variable/G gs_sf2D=0 82 gs_sf2D := fSmearedSphere2D(smear_coef_sf2D,smeared_sf2D) //this wrapper fills the STRUCT 83 84 Display $(str+"_qy") vs $(str+"_qx") 85 modifygraph log=0 86 ModifyGraph mode=3,marker=16,zColor($(str+"_qy"))={smeared_sf2D,*,*,YellowHot,0} 87 ModifyGraph standoff=0 88 ModifyGraph width={Aspect,1} 89 ModifyGraph lowTrip=0.001 90 Label bottom "qx (A\\S-1\\M)" 91 Label left "qy (A\\S-1\\M)" 92 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 93 94 SetDataFolder root: 95 AddModelToStrings("SmearedSphere2D","smear_coef_sf2D","sf2D") 59 96 End 60 97 … … 106 143 return(0) 107 144 End 145 146 147 //threaded version of the function 148 Function Sphere2D_noThread(cw,zw,xw,yw) 149 WAVE cw,zw, xw,yw 150 151 #if exists("Sphere_2DX") //to hide the function if XOP not installed 152 153 zw= Sphere_2DX(cw,xw,yw) 154 155 #endif 156 157 return 0 158 End 159 160 161 Function SmearedSphere2D(s) 162 Struct ResSmear_2D_AAOStruct &s 163 164 Smear_2DModel_5(Sphere2D_noThread,s) 165 return(0) 166 end 167 168 169 Function fSmearedSphere2D(coefW,resultW) 170 Wave coefW,resultW 171 172 String str = getWavesDataFolder(resultW,0) 173 String DF="root:"+str+":" 174 175 WAVE qx = $(DF+str+"_qx") 176 WAVE qy = $(DF+str+"_qy") 177 WAVE qz = $(DF+str+"_qz") 178 WAVE sigQx = $(DF+str+"_sigQx") 179 WAVE sigQy = $(DF+str+"_sigQy") 180 WAVE shad = $(DF+str+"_fs") 181 182 STRUCT ResSmear_2D_AAOStruct s 183 WAVE s.coefW = coefW 184 WAVE s.zw = resultW 185 WAVE s.qx = qx 186 WAVE s.qy = qy 187 WAVE s.qz = qz 188 WAVE s.sigQx = sigQx 189 WAVE s.sigQy = sigQy 190 WAVE s.fs = shad 191 192 Variable err 193 err = SmearedSphere2D(s) 194 195 return (0) 196 End
Note: See TracChangeset
for help on using the changeset viewer.