Changeset 239


Ignore:
Timestamp:
Jan 14, 2008 5:37:21 PM (13 years ago)
Author:
ajj
Message:

USANS slit smearing on data load now working. Still a few glitches to work out, but fundamentally functional.

File:
1 edited

Legend:

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

    r238 r239  
    2222        Variable/G USANS_N=numpnts($(basestr+"_q")) 
    2323        Variable/G USANS_dQv = dQv 
    24         String/G root:myGlobals:USANS_basestr = basestr 
     24        String/G root:Packages:NIST:USANS_basestr = basestr 
    2525 
    2626        Make/D/O/N=(USANS_N,USANS_N) $(basestr+"_res") 
     
    3232        //Variable/G USANS_m = EnterSlope(baseStr) 
    3333        Variable/G USANS_m = -4 
    34         Variable/G USANS_slope_numpnts = 10 
     34        Variable/G USANS_slope_numpnts = 25 
    3535         
    3636        Print "---- Calculating Weighting Matrix for USANS Data ----" 
     
    8282        Button button_OK,pos={294,317},size={100,20},title="Accept Slope",font="Geneva" 
    8383        Button button_OK,proc=USANS_Slope_ButtonProc 
    84         //Button button_Cancel,pos={233,317},size={55,20},title="Cancel",font="Geneva" 
    85         //Button button_Cancel,proc=USANS_Slope_ButtonProc 
     84        Button button_SlopeCalc,pos={233,317},size={55,20},title="Calculate Slope",font="Geneva" 
     85        Button button_SlopeCalc,proc=USANS_Slope_ButtonProc 
    8686        SetVariable setvar_numpnts, pos={43,350}, size={150,19}, title="# Points",fSize=13 
    8787        SetVariable setvar_numpnts, value= USANS_slope_numpnts  
     
    9595        //Print TraceNameList("USANS_Slope#SlopePlot",";",1) 
    9696         
    97         USANS_CalculateSlope(basestr,USANS_slope_numpnts) 
     97        //USANS_CalculateSlope(basestr,USANS_slope_numpnts) 
    9898         
    9999        PauseForUser  USANS_Slope        
     
    102102End 
    103103 
    104 Function USANS_CalculateSlope(basestr, calcpoints) 
     104Function USANS_CalculateSlope(basestr, nend) 
    105105        String basestr 
    106         Variable calcpoints 
     106        Variable nend 
    107107         
    108108        Wave iw = $(basestr+"_i") 
    109         Wave qw = $(basestr+"_i") 
    110         Wave sw = $(basestr+"_i") 
     109        Wave qw = $(basestr+"_q") 
     110        Wave sw = $(basestr+"_s") 
    111111 
    112112        Variable num_extr=25 
    113         NVAR nend = USANS_slope_numpnts 
    114113        // Make extra waves for extrapolation  
    115114        // Taken from DSM_SetExtrWaves 
     
    146145                extr_hqi=P_coef[0]+P_coef[1]*extr_hqq^P_coef[2] 
    147146         
     147                AppendToGraph/W=USANS_Slope#SlopePlot extr_hqi vs extr_hqq 
     148         
    148149                Printf "Smeared Power law exponent = %g\r",P_coef[2] 
    149150                Printf "**** For Desmearing, use a Power law exponent of %5.1f\r",P_coef[2]-1 
     
    158159        String ctrlName 
    159160         
    160         NVAR USANS_m 
     161        SVAR basestr =  root:Packages:NIST:USANS_basestr 
     162        NVAR USANS_m, USANS_slope_numpnts 
    161163         
    162164        strswitch (ctrlName) 
     
    165167                        DoWindow/K USANS_Slope 
    166168                        break 
    167                 case "button_Cancel": 
    168                         DoWindow/K USANS_Slope 
    169                         USANS_m = 999 
     169                case "button_SlopeCalc": 
     170                        USANS_m = USANS_CalculateSlope(basestr, USANS_slope_numpnts) 
     171                        ControlUpdate/W=USANS_Slope setvar_Slope 
    170172                        break 
    171173        endswitch 
     
    177179 
    178180        Variable i,j 
    179         SVAR USANS_basestr=root:myGlobals:USANS_basestr  
     181        SVAR USANS_basestr=root:Packages:NIST:USANS_basestr  
    180182        SetDataFolder $("root:"+USANS_basestr) 
    181183 
     
    204206        Variable i,j 
    205207         
    206         SVAR USANS_basestr=root:myGlobals:USANS_basestr  
     208        SVAR USANS_basestr=root:Packages:NIST:USANS_basestr  
    207209        SetDataFolder $("root:"+USANS_basestr) 
    208210 
     
    231233        Variable i 
    232234 
    233         SVAR USANS_basestr=root:myGlobals:USANS_basestr  
     235        SVAR USANS_basestr=root:Packages:NIST:USANS_basestr  
    234236        SetDataFolder $("root:"+USANS_basestr) 
    235237 
     
    263265        Variable i 
    264266         
    265         SVAR USANS_basestr=root:myGlobals:USANS_basestr  
     267        SVAR USANS_basestr=root:Packages:NIST:USANS_basestr  
    266268        SetDataFolder $("root:"+USANS_basestr) 
    267269 
Note: See TracChangeset for help on using the changeset viewer.