Changeset 391 for sans/Dev


Ignore:
Timestamp:
Jun 26, 2008 1:38:32 PM (15 years ago)
Author:
srkline
Message:

Lamellar_PS models now set the epsilon wave properly, and it doesn't get overwritten

Small fic to the wrapper to have better behavior with cursors. This issue is not done yet.

Location:
sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models
Files:
3 edited

Legend:

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

    r379 r391  
    7474        // make epsilon wave appropriate for integer number of lamellar repeats 
    7575        Duplicate/O coef_LamellarPS_HG epsilon_LamellarPS_HG 
    76         epsilon_LamellarPS_HG = 1e-4 
     76        epsilon_LamellarPS_HG = 1e-4*coef_LamellarPS_HG 
    7777        epsilon_LamellarPS_HG[7] = 1            //to make the derivative useful  
    7878        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 
     
    113113        Label bottom "q (A\\S-1\\M)" 
    114114        Label left "I(q) (cm\\S-1\\M)" 
     115         
     116        // make epsilon wave appropriate for integer number of lamellar repeats 
     117        Duplicate/O smear_coef_LamellarPS_HG epsilon_LamellarPS_HG 
     118        epsilon_LamellarPS_HG = 1e-4*smear_coef_LamellarPS_HG 
     119        epsilon_LamellarPS_HG[7] = 1            //to make the derivative useful  
    115120         
    116121        SetDataFolder root: 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/NewModels_2006/LamellarPS_v40.ipf

    r379 r391  
    7474        // make epsilon wave appropriate for integer number of lamellar repeats 
    7575        Duplicate/O coef_LamellarPS epsilon_LamellarPS 
    76         epsilon_LamellarPS = 1e-4 
     76        epsilon_LamellarPS = 1e-4*coef_LamellarPS 
    7777        epsilon_LamellarPS[6] = 1               //to make the derivative useful  
    7878        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 
     
    113113        Label bottom "q (A\\S-1\\M)" 
    114114        Label left "I(q) (cm\\S-1\\M)" 
     115         
     116        // make epsilon wave appropriate for integer number of lamellar repeats 
     117        Duplicate/O smear_coef_LamellarPS epsilon_LamellarPS 
     118        epsilon_LamellarPS = 1e-4*smear_coef_LamellarPS 
     119        epsilon_LamellarPS[6] = 1               //to make the derivative useful  
    115120         
    116121        SetDataFolder root: 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/Wrapper_v40.ipf

    r385 r391  
    377377                                Wave eps = $("epsilon_"+suffix) 
    378378                                Wave coef=$popStr 
    379                                 eps = abs(coef*1e-4) + 1e-10                    //default eps is proportional to the coefficients 
     379                                if(eps[0] == 0)         //if eps already if filled, don't change it 
     380                                        eps = abs(coef*1e-4) + 1e-10                    //default eps is proportional to the coefficients 
     381                                endif 
    380382                        endif 
    381383                        // default epsilon values, sometimes needed for the fit 
     
    451453        switch( pa.eventCode ) 
    452454                case 2: // mouse up 
    453 //                      Variable popNum = pa.popNum 
    454 //                      String funcStr = pa.popStr 
    455 //                      String coefStr = W_CoefPopupList() 
     455                // make sure that the cursors are on/off appropriately 
     456                // check to make sure there really is a "topmost" graph          
     457//                      String topGraph= WinName(0,1)   //this is the topmost graph 
     458//                      if(cmpstr(topGraph,"")==0)      //no graphs, uncheck and exit 
     459//                              CheckBox check_0,value=0 
     460//                      else 
     461//                              String ciStr = CsrInfo(A , topGraph) 
     462//                               
     463//                              ControlInfo/W=wrapperpanel popup_0 
     464//                              String folderStr=S_Value 
     465//                              String traceList = TraceNameList(topGraph, ";", 1 )              
    456466//                       
    457 ////                    Print "coefStr = ",coefStr 
    458 //                       
    459 //                      ControlInfo/W=WrapperPanel popup_0 
    460 //                      String folderStr=S_Value 
    461 //                       
    462 //                      String listStr = W_CoefPopupList() 
    463 //                      Variable num=WhichListItem(coefStr, listStr, ";") 
    464 //                      String str=StringFromList(num, listStr  ,";") 
    465 ////                    print "str = ",str 
    466 //                      //set the item in the coef popup, and pop it 
    467 //                      PopupMenu popup_2 mode=(num+1) 
    468                          
     467//                      endif 
     468                                                 
     469                        // then cascade the function/coefficient popups 
    469470                        Struct WMPopupAction ps 
    470471                        ps.eventCode = 2                //fake mouse up 
     
    779780        endif 
    780781 
     782        // 20JUN if useCursors is true, and there are no cursors on the specified data set, uncheck and set to false 
     783        if(useCursors) 
     784                useCursors = AreCursorsCorrect(folderStr) 
     785        endif 
    781786        //if useCursors, and the data is USANS, need to recalculate the matrix if the range is new 
    782787        Variable pt1,pt2,newN,mPt1,mPt2 
     
    12311236        return 0 
    12321237End 
     1238 
     1239// returns 1 if the specified data is on the top graph && has cursors on it 
     1240// returns 0 and unchecks the box if anything is wrong 
     1241// 
     1242// only call this function if the cursor box is checked, to uncheck it as needed 
     1243// if the box is unchecked, leave it be. 
     1244// 
     1245Function AreCursorsCorrect(folderStr) 
     1246        String folderStr 
     1247         
     1248        String topGraph= WinName(0,1)   //this is the topmost graph 
     1249        if(cmpstr(topGraph,"")==0)      //no graphs, uncheck and exit 
     1250                CheckBox check_0,win=wrapperpanel,value=0 
     1251                return(0) 
     1252        endif 
     1253                 
     1254        String traceAisOn = CsrWave(A , "", 0) 
     1255        if(     strsearch(traceAisOn, folderStr, 0) == -1)              //data and cursors don't match 
     1256                CheckBox check_0,win=wrapperpanel,value=0 
     1257                return(0) 
     1258        endif 
     1259         
     1260        return(1) 
     1261End 
Note: See TracChangeset for help on using the changeset viewer.