Ignore:
Timestamp:
Nov 4, 2009 2:21:47 PM (13 years ago)
Author:
srkline
Message:

XOPs added for CSParallelepiped, not for fractal_polysphere

Removed garbage from function popup list in SumSANSModels (changing the common filter function in PlotUtilsMacro?)

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2006/Parallelepiped_v40.ipf

    r570 r595  
    242242////////////For testing 
    243243 
    244 Macro PP_Rg_and_IZero() 
     244Proc PP_Rg_and_IZero() 
    245245 
    246246        variable rg2,iz 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/Fractal_PolySphere_v40.ipf

    r570 r595  
    99// 
    1010// - basic subunit is a polydisperse (Schulz) sphere - SRK July 2008 
     11// 
     12// no XOP was written for this - it is not necessary 
    1113// 
    1214// Macro for fractal parameters added JGB 2004 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2009/CSParallelepiped_v40.ipf

    r570 r595  
    3030//needed to calculate the model function. 
    3131// 
    32 Proc PlotCSParallpiped(num,qmin,qmax) 
     32Proc PlotCSParallelepiped(num,qmin,qmax) 
    3333        Variable num=100, qmin=.001, qmax=.7 
    3434        Prompt num "Enter number of data points for model: " 
     
    3636        Prompt qmax "Enter maximum q-value (A^1) for model: " 
    3737        // 
    38         Make/O/D/n=(num) xwave_CSParallpiped, ywave_CSParallpiped 
    39         xwave_CSParallpiped =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) 
    40         Make/O/D coef_CSParallpiped = {1,35,75,400,10,10,10,2e-6,4e-6,2e-6,-1e-6,6e-6,0.06}                     //CH#2 
    41         make/o/t parameters_CSParallpiped = {"Scale Factor","Shortest Edge A (A)","B (A)","Longest Edge C (A)","Rim A ()", "Rim B ()","Rim C ()", "SLD A(A^-2)", "SLD B(A^-2)", "SLD C(A^-2)", "SLD P(A^-2)", "SLD Solv(A^-2)", "Incoherent Bgd (cm-1)"}        //CH#3 
    42         Edit parameters_CSParallpiped, coef_CSParallpiped 
    43          
    44         Variable/G root:g_CSParallpiped 
    45         g_CSParallpiped := CSParallpiped(coef_CSParallpiped,ywave_CSParallpiped, xwave_CSParallpiped) 
    46         Display ywave_CSParallpiped vs xwave_CSParallpiped 
     38        Make/O/D/n=(num) xwave_CSPP, ywave_CSPP 
     39        xwave_CSPP =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) 
     40        Make/O/D coef_CSPP = {1,35,75,400,10,10,10,2e-6,4e-6,2e-6,1e-6,6e-6,0.06}                       //CH#2 
     41        make/o/t parameters_CSPP = {"Scale Factor","Shortest Edge A (A)","B (A)","Longest Edge C (A)","Rim A ()", "Rim B ()","Rim C ()", "SLD A(A^-2)", "SLD B(A^-2)", "SLD C(A^-2)", "SLD P(A^-2)", "SLD Solv(A^-2)", "Incoherent Bgd (cm-1)"} //CH#3 
     42        Edit parameters_CSPP, coef_CSPP 
     43         
     44        Variable/G root:g_CSPP 
     45        g_CSPP := CSParallelepiped(coef_CSPP,ywave_CSPP, xwave_CSPP) 
     46        Display ywave_CSPP vs xwave_CSPP 
    4747        ModifyGraph marker=29, msize=2, mode=4 
    4848        ModifyGraph log=1 
     
    5151        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 
    5252         
    53         AddModelToStrings("CSParallpiped","coef_CSParallpiped","parameters_CSParallpiped","CSParallpiped") 
     53        AddModelToStrings("CSParallelepiped","coef_CSPP","parameters_CSPP","CSPP") 
    5454// 
    5555End 
     
    6262// from the experimental data read in from an AVE/QSIG data file 
    6363//////////////////////////////////////////////////// 
    64 Proc PlotSmearedCSParallpiped(str) 
     64Proc PlotSmearedCSParallelepiped(str) 
    6565        String str 
    6666        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) 
     
    7474         
    7575        // Setup parameter table for model function 
    76         Make/O/D smear_coef_CSParallpiped = {1,35,75,400,10,10,10,2e-6,4e-6,2e-6,-1e-6,6e-6,0.06}               //CH#4 
    77         make/o/t smear_parameters_CSParallpiped = {"Scale Factor","Shortest Edge A (A)","B (A)","Longest Edge C (A)","Rim A ()", "Rim B ()","Rim C ()", "SLD A(A^-2)", "SLD B(A^-2)", "SLD C(A^-2)", "SLD P(A^-2)", "SLD Solv(A^-2)", "Incoherent Bgd (cm-1)"} 
    78         Edit smear_parameters_CSParallpiped,smear_coef_CSParallpiped                                    //display parameters in a table 
     76        Make/O/D smear_coef_CSPP = {1,35,75,400,10,10,10,2e-6,4e-6,2e-6,1e-6,6e-6,0.06}         //CH#4 
     77        make/o/t smear_parameters_CSPP = {"Scale Factor","Shortest Edge A (A)","B (A)","Longest Edge C (A)","Rim A ()", "Rim B ()","Rim C ()", "SLD A(A^-2)", "SLD B(A^-2)", "SLD C(A^-2)", "SLD P(A^-2)", "SLD Solv(A^-2)", "Incoherent Bgd (cm-1)"} 
     78        Edit smear_parameters_CSPP,smear_coef_CSPP                                      //display parameters in a table 
    7979         
    8080        // output smeared intensity wave, dimensions are identical to experimental QSIG values 
    8181        // make extra copy of experimental q-values for easy plotting 
    82         Duplicate/O $(str+"_q") smeared_CSParallpiped,smeared_qvals                             // 
    83         SetScale d,0,0,"1/cm",smeared_CSParallpiped                                                     // 
    84  
    85         Variable/G gs_CSParallpiped=0 
    86         gs_CSParallpiped := fSmearedCSParallpiped(smear_coef_CSParallpiped,smeared_CSParallpiped,smeared_qvals) //this wrapper fills the STRUCT 
    87          
    88         Display smeared_CSParallpiped vs smeared_qvals                                                                  // 
     82        Duplicate/O $(str+"_q") smeared_CSPP,smeared_qvals                              // 
     83        SetScale d,0,0,"1/cm",smeared_CSPP                                                      // 
     84 
     85        Variable/G gs_CSPP=0 
     86        gs_CSPP := fSmearedCSParallelepiped(smear_coef_CSPP,smeared_CSPP,smeared_qvals) //this wrapper fills the STRUCT 
     87         
     88        Display smeared_CSPP vs smeared_qvals                                                                   // 
    8989        ModifyGraph log=1,marker=29,msize=2,mode=4 
    9090        Label bottom "q (A\\S-1\\M)" 
     
    9393 
    9494        SetDataFolder root: 
    95         AddModelToStrings("SmearedCSParallpiped","smear_coef_CSParallpiped","smear_parameters_CSParallpiped","CSParallpiped") 
    96 End 
    97  
    98 Function CSParallpiped(cw,yw,xw) : FitFunc 
     95        AddModelToStrings("SmearedCSParallelepiped","smear_coef_CSPP","smear_parameters_CSPP","CSPP") 
     96End 
     97 
     98Function CSParallelepiped(cw,yw,xw) : FitFunc 
    9999        Wave cw,yw,xw 
    100100         
    101 #if exists("CSParallpipedX") 
    102         yw = CSParallpipedX(cw,xw) 
     101#if exists("CSParallelepipedX") 
     102        yw = CSParallelepipedX(cw,xw) 
    103103#else 
    104         yw = fCSParallpiped(cw,xw) 
     104        yw = fCSParallelepiped(cw,xw) 
    105105#endif 
    106106        return(0) 
     
    111111// - a double integral - choose points wisely 
    112112// 
    113 Function fCSParallpiped(w,x) : FitFunc 
     113Function fCSParallelepiped(w,x) : FitFunc 
    114114        Wave w 
    115115        Variable x 
     
    141141        rhoC=w[9]    //rim C SLD 
    142142        rhoP = w[10]   //Parallelpiped core SLD 
    143        rhosolv=w[11]  // Solvent SLD 
    144          bkg = w[12] 
     143   rhosolv=w[11]  // Solvent SLD 
     144   bkg = w[12] 
    145145         
    146146//      mu = bb*x               //scale in terms of B 
     
    268268        retval =( dr0*t1*t2*Vin + drA*(t3-t1)*t2*V1+ drB*t1*(t4-t2)*V2 )*( dr0*t1*t2*Vin + drA*(t3-t1)*t2*V1+ drB*t1*(t4-t2)*V2 )   //  correct FF : square of sum of phase factors 
    269269//      retval =t1*t2* dr0*dr0*Vin*Vin    //*( dr0*t1*t2*Vin )   //test case of original PP with no rims 
    270         return(retVal);  
     270        return(retVal)  
    271271End 
    272272 
    273273 
    274274// this is all there is to the smeared calculation! 
    275 Function fSmearedCSParallpiped(coefW,yW,xW) 
     275Function fSmearedCSParallelepiped(coefW,yW,xW) 
    276276        Wave coefW,yW,xW 
    277277         
     
    288288         
    289289        Variable err 
    290         err = SmearedCSParallpiped(fs) 
     290        err = SmearedCSParallelepiped(fs) 
    291291         
    292292        return (0) 
     
    294294 
    295295// this is all there is to the smeared calculation! 
    296 Function SmearedCSParallpiped(s) :FitFunc 
     296Function SmearedCSParallelepiped(s) :FitFunc 
    297297        Struct ResSmearAAOStruct &s 
    298298 
    299299//      the name of your unsmeared model (AAO) is the first argument 
    300         Smear_Model_20(CSParallpiped,s.coefW,s.xW,s.yW,s.resW) 
     300        Smear_Model_20(CSParallelepiped,s.coefW,s.xW,s.yW,s.resW) 
    301301 
    302302        return(0) 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/SumModel/SumSANSModels_v40.ipf

    r570 r595  
    123123Function/S SumModelPopupList() 
    124124        String list,tmp 
    125         list = FunctionList("!Smear*",";","KIND:10")            //don't show smeared models 
    126          
     125         
     126        //get every user defined curve fit function, remove everything the user doesn't need to see... 
     127        list = User_FunctionPopupList()  
     128         
     129        // must remove Sum_Model 
    127130        list = RemoveFromList("Sum_Model", list  ,";") 
    128          
    129         tmp = FunctionList("*_proto",";","KIND:10")             //prototypes 
     131 
     132//      can remove the smeared models either this way, or using GrepList as below 
     133//      tmp = FunctionList("Smear*",";","KIND:10")              //don't show smeared models 
     134//      list = RemoveFromList(tmp, list  ,";") 
     135 
     136// 
     137////    Print list 
     138        tmp = GrepList(list,"^Smear")                   //don't show the Smeared... models in the popup  
     139        Print tmp        
    130140        list = RemoveFromList(tmp, list  ,";") 
    131  
    132 //      Print list 
    133         tmp = GrepList(FunctionList("f*",";","KIND:10"),"^f")    
    134 //      tmp = FunctionList("f*",";","KIND:10")          //point calculations 
    135          
    136 //      Print tmp 
    137          
    138         list = RemoveFromList(tmp, list  ,";") 
    139          
    140         // this should be a null string with KIND:10 
    141         tmp = FunctionList("*X",";","KIND:10")          //XOPs, also point calculations 
    142         list = RemoveFromList(tmp, list  ,";") 
    143          
    144         // remove some odds and ends... 
    145         tmp = "UpdateQxQy2Mat;" 
    146         tmp += "MakeBSMask;" 
    147         list = RemoveFromList(tmp, list  ,";") 
     141//       
    148142         
    149143        return(list) 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r570 r595  
    961961        tmp = "Integrand_SC_Inner;Integrand_SC_Outer;SC_Integrand;SphCyl;SphCyl_Inner;SphCyl_Outer;" 
    962962        list = RemoveFromList(tmp, list  ,";") 
    963  
     963        tmp = "CSPP_Outer;CSPP_Inner;PP_Outer;PP_Inner;" 
     964        list = RemoveFromList(tmp, list  ,";") 
    964965 
    965966        tmp = FunctionList("f*",";","NPARAMS:2")                //point calculations 
Note: See TracChangeset for help on using the changeset viewer.