Changeset 200 for sans/Analysis


Ignore:
Timestamp:
Nov 15, 2007 11:27:16 AM (15 years ago)
Author:
srkline
Message:

Changed 2D model calculations to use a FIXED 25 integration points in an effort to get the number of integration points out of the fitting coefficient wave.

Added "Freeze Model" back to the SANS Models menu

Added the 2D model functions to the list on the model picker

Minor tweaks to the wrapper

Location:
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D/CoreShellCyl2D.ipf

    r198 r200  
    2525         
    2626        // Setup parameter table for model function 
    27         make/O/T/N=15 parameters_CSCyl2D 
    28         Make/O/D/N=15 coef_CSCyl2D 
     27//      make/O/T/N=15 parameters_CSCyl2D 
     28//      Make/O/D/N=15 coef_CSCyl2D 
     29        make/O/T/N=14 parameters_CSCyl2D 
     30        Make/O/D/N=14 coef_CSCyl2D 
    2931         
    3032        coef_CSCyl2D[0] = 1.0 
     
    4244        coef_CSCyl2D[12] = 0.0 
    4345        coef_CSCyl2D[13] = 0.0 
    44         coef_CSCyl2D[14] = 10 
     46        //hard-wire the number of integration points 
     47//      coef_CSCyl2D[14] = 10 
    4548         
    4649        parameters_CSCyl2D[0] = "Scale" 
     
    5861        parameters_CSCyl2D[12] = "Sigma of polydisp in Theta [rad]" 
    5962        parameters_CSCyl2D[13] = "Sigma of polydisp in Phi [rad]" 
    60         parameters_CSCyl2D[14] = "Num of polydisp points" 
     63//      parameters_CSCyl2D[14] = "Num of polydisp points" 
    6164         
    6265        Edit parameters_CSCyl2D,coef_CSCyl2D                                     
     
    103106//       
    104107//#if exists("CoreShellCylinderModel_D") 
    105 //      zw = CoreShellCylinderModel_D(cw,xw,yw) 
     108//      Make/O/D/N=15 CSCyl2D_tmp 
     109//      CSCyl2D_tmp = cw 
     110//      CSCyl2D_tmp[14] = 25 
     111// 
     112//      zw = CoreShellCylinderModel_D(CSCyl2D_tmp,xw,yw) 
     113//       
     114////    zw = CoreShellCylinderModel_D(cw,xw,yw) 
    106115//#else 
    107116//      Abort "You do not have the SANS Analysis XOP installed" 
     
    117126         
    118127#if exists("CoreShellCylinderModel_D")                  //to hide the function if XOP not installed 
    119         zw[p1,p2]= CoreShellCylinderModel_D(cw,xw,yw) 
     128 
     129        Make/O/D/N=15 CSCyl2D_tmp 
     130        CSCyl2D_tmp = cw 
     131        CSCyl2D_tmp[14] = 25 
     132 
     133        zw[p1,p2]= CoreShellCylinderModel_D(CSCyl2D_tmp,xw,yw) 
     134         
    120135#endif 
    121136 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D/Cylinder_2D.ipf

    r198 r200  
    22#pragma IgorVersion=6.0 
    33 
    4 // "simple" version of 2D function 
    54// 
    65// The plotting macro sets up TWO dependencies 
     
    2524        SetDataFolder $("root:"+str) 
    2625         
    27          
    2826        // NOTE THAT THE COEFFICIENTS [N] ARE IN A DIFFERENT ORDER !!! 
    2927        // Setup parameter table for model function 
    30         make/O/T/N=11 parameters_Cyl2D 
    31         Make/O/D/N=11 coef_Cyl2D 
     28//      make/O/T/N=11 parameters_Cyl2D 
     29//      Make/O/D/N=11 coef_Cyl2D 
     30        make/O/T/N=10 parameters_Cyl2D 
     31        Make/O/D/N=10 coef_Cyl2D 
    3232        coef_Cyl2D[0] = 1.0 
    3333        coef_Cyl2D[1] = 20.0 
     
    4040        coef_Cyl2D[8] = 0.0 
    4141        coef_Cyl2D[9] = 0.0 
    42         coef_Cyl2D[10] = 25 
     42         
     43        // currently, the number of integration points is hard-wired to be 25 in Cylinder2D_T 
     44        //coef_Cyl2D[10] = 25 
    4345        // 
    4446        parameters_Cyl2D[0] = "Scale" 
     
    5456        parameters_Cyl2D[7] = "Sigma of polydisp in Radius [A]"         //***** 
    5557         
    56         parameters_Cyl2D[10] = "number of integration points" 
     58//      parameters_Cyl2D[10] = "number of integration points" 
    5759 
    5860        Edit parameters_Cyl2D,coef_Cyl2D                                         
     
    99101//       
    100102//#if exists("CylinderModel_D") 
    101 //      zw = CylinderModel_D(cw,xw,yw) 
     103// 
     104//      Make/O/D/N=11 Cyl2D_tmp                         // there seems to be no speed penalty for doing this... 
     105//      Cyl2D_tmp = cw 
     106//      Cyl2D_tmp[10] = 25                                      // hard-wire the number of integration points 
     107//       
     108//      zw= CylinderModel_D(Cyl2D_tmp,xw,yw) 
     109// 
     110//      //zw = CylinderModel_D(cw,xw,yw) 
    102111//#else 
    103112//      Abort "You do not have the SANS Analysis XOP installed" 
     
    113122         
    114123#if exists("CylinderModel_D")                   //to hide the function if XOP not installed 
    115         zw[p1,p2]= CylinderModel_D(cw,xw,yw) 
     124 
     125        Make/O/D/N=11 Cyl2D_tmp                         // there seems to be no speed penalty for doing this... 
     126        Cyl2D_tmp = cw 
     127        Cyl2D_tmp[10] = 25                                      // hard-wire the number of integration points 
     128         
     129        zw[p1,p2]= CylinderModel_D(Cyl2D_tmp,xw,yw) 
     130 
    116131#endif 
    117132 
     
    134149        variable mt= ThreadGroupCreate(nthreads) 
    135150 
     151//      Variable t1=StopMSTimer(-2) 
     152         
    136153        for(i=0;i<nthreads;i+=1) 
    137154        //      Print (i*npt/nthreads),((i+1)*npt/nthreads-1) 
     
    145162        variable dummy= ThreadGroupRelease(mt) 
    146163         
     164//      Print "elapsed time = ",(StopMSTimer(-2) - t1)/1e6 
     165         
    147166        return(0) 
    148167End 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D/Ellipsoid2D.ipf

    r198 r200  
    22#pragma IgorVersion=6.0 
    33 
     4// 
     5// !!! FOR THE ELLIPSOID, THE ANGLE THETA IS DEFINED FROM ???? 
    46// 
    57// The plotting macro sets up TWO dependencies 
     
    2527         
    2628        // Setup parameter table for model function 
    27         make/O/T/N=12 parameters_Ellip2D 
    28         Make/O/D/N=12 coef_Ellip2D 
     29//      make/O/T/N=12 parameters_Ellip2D 
     30//      Make/O/D/N=12 coef_Ellip2D 
     31        make/O/T/N=11 parameters_Ellip2D 
     32        Make/O/D/N=11 coef_Ellip2D 
    2933         
    3034        coef_Ellip2D[0] = 1.0 
     
    3943        coef_Ellip2D[9] = 0.0 
    4044        coef_Ellip2D[10] = 0.0 
    41         coef_Ellip2D[11] = 10 
     45        // hard-wire the number of integration points 
     46//      coef_Ellip2D[11] = 10 
    4247         
    4348        parameters_Ellip2D[0] = "Scale" 
     
    5257        parameters_Ellip2D[9] = "Sigma of polydisp in Theta [rad]" 
    5358        parameters_Ellip2D[10] = "Sigma of polydisp in Phi [rad]" 
    54         parameters_Ellip2D[11] = "Num of polydisp points" 
     59         
     60//      parameters_Ellip2D[11] = "Num of polydisp points" 
    5561 
    5662         
     
    98104//       
    99105//#if exists("EllipsoidModel_D") 
    100 //      zw = EllipsoidModel_D(cw,xw,yw) 
     106// 
     107//      Make/O/D/N=12 Ellip2D_tmp 
     108//      Ellip2D_tmp = cw 
     109//      Ellip2D_tmp[11] = 25 
     110//       
     111//      zw = EllipsoidModel_D(Ellip2D_tmp,xw,yw) 
     112//       
     113////    zw = EllipsoidModel_D(cw,xw,yw) 
    101114//#else 
    102115//      Abort "You do not have the SANS Analysis XOP installed" 
     
    112125         
    113126#if exists("EllipsoidModel_D")                  //to hide the function if XOP not installed 
    114         zw[p1,p2]= EllipsoidModel_D(cw,xw,yw) 
     127 
     128        Make/O/D/N=12 Ellip2D_tmp 
     129        Ellip2D_tmp = cw 
     130        Ellip2D_tmp[11] = 25 
     131         
     132        zw[p1,p2]= EllipsoidModel_D(Ellip2D_tmp,xw,yw) 
     133         
    115134#endif 
    116135 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D/EllipticalCylinder2D.ipf

    r198 r200  
    2525         
    2626        // Setup parameter table for model function 
    27         make/O/T/N=14 parameters_EllCyl2D 
    28         Make/O/D/N=14 coef_EllCyl2D 
    29                  
     27        //make/O/T/N=14 parameters_EllCyl2D 
     28        //Make/O/D/N=14 coef_EllCyl2D 
     29        make/O/T/N=13 parameters_EllCyl2D 
     30        Make/O/D/N=13 coef_EllCyl2D 
     31         
    3032        coef_EllCyl2D[0] = 1.0 
    3133        coef_EllCyl2D[1] = 20.0 
     
    4143        coef_EllCyl2D[11] = 0.0 
    4244        coef_EllCyl2D[12] = 0.0 
    43         coef_EllCyl2D[13] = 10 
     45         
     46        // now hard-wire the # of integration points 
     47        //coef_EllCyl2D[13] = 25 
    4448                 
    4549        parameters_EllCyl2D[0] = "Scale" 
     
    5660        parameters_EllCyl2D[11] = "Sigma of polydisp in Theta [rad]" 
    5761        parameters_EllCyl2D[12] = "Sigma of polydisp in Phi [rad]" 
    58         parameters_EllCyl2D[13] = "Num of polydisp points" 
     62        //parameters_EllCyl2D[13] = "Num of polydisp points" 
    5963         
    6064        Edit parameters_EllCyl2D,coef_EllCyl2D                                   
     
    101105//       
    102106//#if exists("EllipticalCylinderModel_D") 
    103 //      zw = EllipticalCylinderModel_D(cw,xw,yw) 
     107// 
     108//      Make/O/D/N=14 EllCyl2D_tmp 
     109//      EllCyl2D_tmp = cw 
     110//      EllCyl2D_tmp[13] = 25 
     111//       
     112//      zw = EllipticalCylinderModel_D(EllCyl2D_tmp,xw,yw) 
     113//       
     114////    zw = EllipticalCylinderModel_D(cw,xw,yw) 
    104115//#else 
    105116//      Abort "You do not have the SANS Analysis XOP installed" 
     
    115126         
    116127#if exists("EllipticalCylinderModel_D")                 //to hide the function if XOP not installed 
    117         zw[p1,p2]= EllipticalCylinderModel_D(cw,xw,yw) 
     128 
     129        Make/O/D/N=14 EllCyl2D_tmp 
     130        EllCyl2D_tmp = cw 
     131        EllCyl2D_tmp[13] = 25 
     132         
     133        zw[p1,p2]= EllipticalCylinderModel_D(EllCyl2D_tmp,xw,yw) 
     134         
    118135#endif 
    119136 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/ModelPicker/SANSModelPicker.ipf

    r184 r200  
    117117////paste here... after deleting the old make statement and list 
    118118         
    119   Make/O/T/N=63  SANS_Model_List 
     119  Make/O/T/N=66  SANS_Model_List 
    120120 
    121121  SANS_Model_List[0] = "Beaucage.ipf" 
     
    182182  SANS_Model_List[61] = "Vesicle_UL_and_Struct.ipf" 
    183183  SANS_Model_List[62] = "Cylinder_2D.ipf" 
    184    
     184 
     185  SANS_Model_List[63] = "CoreShellCyl2D.ipf" 
     186  SANS_Model_List[64] = "Ellipsoid2D.ipf" 
     187  SANS_Model_List[65] = "EllipticalCylinder2D.ipf" 
     188 
    185189  ///end paste here 
    186190End 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/PlotUtils2D.ipf

    r198 r200  
    304304End 
    305305 
    306 Macro AdjustColorTables() 
    307  
    308         ModifyGizmo ModifyObject=surface1 property={ srcMode,0} 
    309         ModifyGizmo ModifyObject=surface1 property={ surfaceCTab,Rainbow} 
    310         ModifyGizmo setDisplayList=3, object=surface1 
    311 //      ModifyGizmo SETQUATERNION={0.565517,-0.103105,-0.139134,0.806350} 
    312         ModifyGizmo autoscaling=1 
    313         ModifyGizmo currentGroupObject="" 
    314         ModifyGizmo compile 
    315          
    316 end 
     306// would be nice, but I can't get this to work... 
     307// 
     308//Macro AdjustColorTables() 
     309// 
     310//      ModifyGizmo ModifyObject=surface1 property={ srcMode,0} 
     311//      ModifyGizmo ModifyObject=surface1 property={ surfaceCTab,Rainbow} 
     312//      ModifyGizmo setDisplayList=3, object=surface1 
     313////    ModifyGizmo SETQUATERNION={0.565517,-0.103105,-0.139134,0.806350} 
     314//      ModifyGizmo autoscaling=1 
     315//      ModifyGizmo currentGroupObject="" 
     316//      ModifyGizmo compile 
     317//       
     318//end 
    317319 
    318320Function LogToggle2DButtonProc(ba) : ButtonControl 
     
    734736        String folderStr,funcStr,coefStr,cmdStr="" 
    735737         
     738        Variable killWhat=0             //kill nothing as default 
     739 
    736740        switch( ba.eventCode ) 
    737741                case 2: // mouse up 
     
    766770                        Function_PopMenuProc(pa) 
    767771         
     772                        KillWhat = 2            //kill just the table, leave the 2d visible for now 
     773                        KillTopGraphAndTable(killWhat)          // crude 
     774 
    768775                        break 
    769776        endswitch 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/SumModel/SumSANSModels.ipf

    r168 r200  
    9797        list = RemoveFromList(tmp, list  ,";") 
    9898 
    99         tmp = FunctionList("f*",";","KIND:10")          //point calculations 
     99//      Print list 
     100        tmp = GrepList(FunctionList("f*",";","KIND:10"),"^f")    
     101//      tmp = FunctionList("f*",";","KIND:10")          //point calculations 
     102         
     103//      Print tmp 
     104         
    100105        list = RemoveFromList(tmp, list  ,";") 
    101106         
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/Wrapper.ipf

    r198 r200  
    148148        list = RemoveFromList("WM_Make3DBarChartParametricWave", list) 
    149149        list = RemoveFromList("UpdateQxQy2Mat", list) 
     150        list = RemoveFromList("MakeBSMask", list) 
    150151         
    151152 
     
    290291                        // farm the work out to another function? 
    291292                        Variable num=numpnts($popStr) 
    292                         // make the necessary waves 
    293                         Make/O/D/N=(num) $("epsilon_"+suffix),$("Hold_"+suffix) 
    294                         Make/O/T/N=(num) $("LoLim_"+suffix),$("HiLim_"+suffix) 
    295                          
     293                        // make the necessary waves if they don't exist already 
     294                        if(exists("Hold_"+suffix) == 0) 
     295                                Make/O/D/N=(num) $("epsilon_"+suffix),$("Hold_"+suffix) 
     296                                Make/O/T/N=(num) $("LoLim_"+suffix),$("HiLim_"+suffix) 
     297                        endif 
    296298                        // default epsilon values, sometimes needed for the fit 
    297299                        Wave eps = $("epsilon_"+suffix) 
     
    300302                        WAVE/T LoLim = $("LoLim_"+suffix) 
    301303                        WAVE/T HiLim = $("HiLim_"+suffix) 
    302                         LoLim = ""              //should have nicer way of keeping the previous values 
    303                         HiLim = "" 
    304304                         
    305305                        // clear the table (a subwindow) 
     
    409409        Variable useCursors,useEps,useConstr 
    410410         
     411        Variable killWhat=0             //kill nothing as default 
     412         
    411413        switch( ba.eventCode ) 
    412414                case 2: // mouse up 
     
    426428                                        sprintf cmdStr, "Plot%s(\"%s\",)",funcStr,folderStr             //yes RPA, leave a comma for input 
    427429                                endif 
     430                                killWhat = 1 
    428431                        else 
    429                                 // it's not,                     
     432                                // it's not,    don't kill the graph, just the table             
    430433                                sprintf cmdStr, "Plot%s()",funcStr 
     434                                killWhat = 2 
    431435                        endif 
    432436                         
     
    441445                        Function_PopMenuProc(pa) 
    442446         
     447                        KillTopGraphAndTable(killWhat)          // crude 
     448         
    443449                        break 
    444450        endswitch 
    445451         
    446452        return 0 
     453End 
     454 
     455// passing 0 kills nothing 
     456// passing 1 kills the top graph and table 
     457// passing 2 kills the top table only 
     458// 
     459Function KillTopGraphAndTable(killwhat) 
     460        Variable killWhat 
     461         
     462        String topGraph= WinName(0,1)   //this is the topmost graph      
     463        String topTable= WinName(0,2)   //this is the topmost table 
     464 
     465        if(killWhat == 0) 
     466                return(0) 
     467        endif 
     468         
     469        if(killWhat == 1) 
     470                KillWindow $topGraph 
     471                KillWindow $topTable 
     472        endif 
     473         
     474        if(killWhat == 2) 
     475                KillWindow $topTable 
     476        endif 
     477         
     478        return(0) 
    447479End 
    448480 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/SA_includes_v301.ipf

    r198 r200  
    2424        "Load Model Functions",Execute/P "INSERTINCLUDE \"SANSModelPicker\"";Execute/P "COMPILEPROCEDURES ";Execute/P "ModelPicker_Panel()" 
    2525        "Plot Manager", Show_Plot_Manager() 
     26        "Freeze Model" 
    2627        "Write Model Data" 
    2728        "-" 
Note: See TracChangeset for help on using the changeset viewer.