Changeset 218


Ignore:
Timestamp:
Dec 4, 2007 3:30:23 PM (15 years ago)
Author:
ajj
Message:

Updates to USANS loading

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

    r171 r218  
    88//Updated to use IGOR features and integrated into SANS Macros by A J Jackson 
    99// 
    10 //Calculation of weights takes a while, but then each recalculation of the smeared model takes no longer 
    11 //than the unsmeared calculation. 
    12 // 
    13 //Should be used when just USANS data is being fitted. Fitting of combined SANS/USANS must 
    14 //still be done by integral method as per S Kline macros. 
    15 //This can be avoided if IGOR Global fit is used - different functions can be fitted to the two data sets 
    16 //with variables tied across the two. There is a loss of simplicity for the user however. 
    17 // 
    18  
    1910// AJJ 
    2011// July 26 2007 - Modified functions to work with new SANS Analysis Macros 
     
    2314//     - pass N to CalcR to avoid globals 
    2415 
     16// 
     17 
    2518Function USANS_CalcWeights(basestr, dQv) 
    2619        String basestr 
     
    3730        Wave weights = $(basestr+"_res") 
    3831 
    39         Variable/G USANS_m = EnterSlope(baseStr) 
     32        //Variable/G USANS_m = EnterSlope(baseStr) 
     33        Variable/G USANS_m = -4 
     34         
     35        EnterSlope(basestr) 
     36 
     37        print USANS_m 
    4038 
    4139        if (USANS_m == 999) 
     
    6361        String baseStr 
    6462         
    65         Variable slope=-4 
    66  
    67         Prompt slope "Enter a slope for the file \""+ baseStr + "\"" 
    68         DoPrompt "Enter Slope", slope 
    69                 If (V_Flag) 
    70                         return (999)                    //return a bogus slope if the user canceled 
    71                 Endif 
    72         print "slope=", slope 
    73         return slope 
    74          
     63//      Variable slope=-4 
     64 
     65//      Prompt slope "Enter a slope for the file \""+ baseStr + "\"" 
     66//      DoPrompt "Enter Slope", slope 
     67//              If (V_Flag) 
     68//                      return (999)                    //return a bogus slope if the user canceled 
     69//              Endif 
     70//      print "slope=", slope 
     71//      return slope 
     72 
     73        NewPanel /K=1/W=(1141,543,1548,910)/N=USANS_Slope as "USANS Slope Extrapolation" 
     74        SetDrawLayer UserBack 
     75        Button button_OK,pos={294,317},size={100,20},title="Accept Slope",font="Geneva" 
     76        Button button_OK,proc=USANS_Slope_ButtonProc 
     77        Button button_Cancel,pos={233,317},size={55,20},title="Cancel",font="Geneva" 
     78        Button button_Cancel,proc=USANS_Slope_ButtonProc 
     79        SetVariable setvar_numpnts, pos={43,330}, size={100,19}, title="# Points",fSize=13 
     80        SetVariable setvar_Slope 
     81        SetVariable setvar_Slope,pos={43,321},size={100,19},title="Slope",fSize=13 
     82        SetVariable setvar_Slope,limits={-inf,inf,0},value= USANS_m 
     83        Display/W=(9,6,402,305)/HOST=USANS_Slope $(basestr+"_i") vs $(basestr+"_q") 
     84        RenameWindow #,SlopePlot 
     85        SetActiveSubwindow ## 
     86         
     87 
     88        PauseForUser  USANS_Slope        
     89//      return slope 
     90         
     91End 
     92 
     93Function USANS_Slope_ButtonProc(ctrlName) : ButtonControl 
     94        String ctrlName 
     95         
     96        NVAR USANS_m 
     97         
     98        strswitch (ctrlName) 
     99                case "button_OK": 
     100                        ControlUpdate/W=USANS_Slope setvar_Slope 
     101                        DoWindow/K USANS_Slope 
     102                        break 
     103                case "button_Cancel": 
     104                        DoWindow/K USANS_Slope 
     105                        USANS_m = 999 
     106                        break 
     107        endswitch 
     108          
     109 
    75110End 
    76111 
     
    165200 
    166201End 
     202 
     203Window USANS_Slope() : Panel 
     204        PauseUpdate; Silent 1           // building window... 
     205        NewPanel /K=1/W=(1141,543,1548,910) as "USANS Slope Extrapolation" 
     206        SetDrawLayer UserBack 
     207        Button button_OK,pos={294,317},size={100,20},title="Accept Slope",font="Geneva" 
     208        Button button_Cancel,pos={233,317},size={55,20},title="Cancel",font="Geneva" 
     209        SetVariable setvar_Slope,pos={43,321},size={100,19},title="Slope",fSize=13 
     210        SetVariable setvar_Slope,limits={-inf,inf,0},value= USANS_m 
     211        Display/W=(9,6,402,305)/HOST=#  
     212        RenameWindow #,G0 
     213        SetActiveSubwindow ## 
     214EndMacro 
Note: See TracChangeset for help on using the changeset viewer.