# Changeset 824

Ignore:
Timestamp:
Jul 20, 2011 9:40:32 AM (12 years ago)
Message:

Changed 2-yukawa to have better names for the parameters, a macro to plot g(r), and to return S(q)=1000 if the calculation fails, to be more obvious.

Added a Corrlation matrix function (in Wrapper.ipf), but it's not linked anywhere yet, since I don't know yet how best to display it.

Simplified the function to list .ASC files

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
5 edited

Unmodified
Removed
• ## sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2010/Two_Yukawa_v40.ipf

 r773 xwave_1yuk = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) Make/O/D coef_1yuk = {0.1,50,-1,10} make/o/t parameters_1yuk = {"volume fraction","Radius (A)","scale, K","charge, Z"} make/o/t parameters_1yuk = {"volume fraction","Radius (A)","scale, K","Decay constant, Z"} Edit parameters_1yuk,coef_1yuk Variable/G root:g_1yuk xwave_2yuk = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) Make/O/D coef_2yuk = {0.2,50,6,10,-1,2} make/o/t parameters_2yuk = {"volume fraction","Radius (A)","scale, K1","charge, Z1","scale, K2","charge, Z2"} make/o/t parameters_2yuk = {"volume fraction","Radius (A)","scale, K1","Decay constant, Z1","scale, K2","Decay constant, Z2"} Edit parameters_2yuk,coef_2yuk Variable/G root:g_2yuk End // with the regular 2-yukawa plotted, this uses the coefficients to plot g(r) // // - no dependency is created, it would just slow things down. So you'll // need to re-run this every time. // //              gr is scaled to dimensionless distance, r/diameter // Macro Plot_2Yukawa_Gr() //if the regular 2-yukawa procedure is already plotted // -- then append it to thte graph yourself Duplicate/O ywave_2yuk ywave_2yuk_Igor fTwoYukawa(coef_2yuk,xwave_2yuk,ywave_2yuk_Igor) DoWindow/F Gr_plot if(V_flag==0) Display gr DoWindow/C Gr_plot Modifygraph log=0 SetAxis bottom 0,10 Modifygraph lsize=2 Label left "g(r)";DelayUpdate Label bottom "dimensionless distance (r/diameter)" legend endif End // Function fTwoYukawa(cw,xw,yw) : FitFunc yw = SqTwoYukawa(xw*radius*2, Z1, Z2, K1, K2, phi, a, b, c1, c2, d1, d2) //                      printf("%g      %g\n",q,sq) else yw = 1000               //return a really bogus answer, as Yun suggests endif endif gr[0] = 0 SetScale/P x,0,dr, gr //      Killwaves/Z temp
• ## sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

 r801 return(1) End // displays the covariance matrix for the current data set in the popup // AND whatever was the last fit for that data set. it may not necessarily // be the displayed function... Function DisplayCovarianceMatrix() ControlInfo/W=wrapperpanel popup_0 String folderStr=S_Value SetDataFolder \$("root:"+folderStr) Wave M_Covar=M_Covar Duplicate/O M_Covar, CorMat      // You can use any name instead of CorMat CorMat = M_Covar[p][q]/sqrt(M_Covar[p][p]*M_Covar[q][q]) Edit CorMat SetDataFolder root: return(0) End
• ## sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_FlipperPanel.ipf

 r817 // the cell must already be defined String condStr, cellStr Prompt condStr,"Condition, <12 characters" Prompt condStr,"Condition, <12 characters, NO UNDERSCORES" Prompt cellStr,"Cell",popup,D_CellNameList() DoPrompt "Add new condition",condStr, cellStr Print "Condition String trimmed to ",condStr endif condStr = ReplaceString("_", condStr, "", 0, inf) String popStr