Ignore:
Timestamp:
Mar 29, 2007 4:02:33 PM (16 years ago)
Author:
srkline
Message:

more file adjustments to clean out NCNR bits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/Marquee.ipf

    r40 r70  
    2424//the x,y values must also be in axis coordinates[0,127] NOT (1,128) detector coords. 
    2525// 
     26// accepts arbitrary detector coordinates. calling function is responsible for  
     27// keeping selection in bounds 
    2628Function SumCountsInBox(x1,x2,y1,y2,type) 
    2729        Variable x1,x2,y1,y2 
     
    5456End 
    5557 
    56 //b BGtoFIX 
    57 // this function is a hard-coded special case of SumCountsInBox (that you copied) 
    58 // - delete this function, and call SumCountsInBox with the appropriate xy range 
    59 Function SumTotalCounts(type) 
    60 //      Variable x1,x2,y1,y2 
    61         String type 
    62          
    63         Variable counts = 0,ii,jj 
    64          
    65         String dest =  "root:"+type 
    66          
    67         //check for logscale data, but don't change the data 
    68         NVAR gIsLogScale = $(dest + ":gIsLogScale") 
    69         if (gIsLogScale) 
    70                 wave w=$(dest + ":linear_data") 
    71         else 
    72                 wave w=$(dest + ":data") 
    73         endif 
    74          
    75         ii=0 
    76         jj=0 
    77         do 
    78                 do 
    79                         counts += w[ii][jj] 
    80                         jj+=1 
    81                 while(jj<=127) 
    82                 jj=0 
    83                 ii+=1 
    84         while(ii<=127) 
    85          
    86         Return (counts) 
    87 End 
    88 //e BGtoFix 
    8958 
    9059//from a marquee selection: 
     
    13099                Execute "InitializeTransPanel()" 
    131100        Endif 
    132          
    133         //need to do error checking for in-bounds selection of marquee (0,127) inclusive 
    134         //reset to valid range or abort? 
    135 //      if((x1<0) || (x1>127)) 
    136 //              Abort "selection out-of-range" 
    137 //      endif 
    138 //      if((x2<0) || (x2>127)) 
    139 //              Abort "selection out-of-range" 
    140 //      endif 
    141 //      if((y1<0) || (y1>127)) 
    142 //              Abort "selection out-of-range" 
    143 //      endif 
    144 //      if((y2<0) || (y2>127)) 
    145 //              Abort "selection out-of-range" 
    146 //      endif 
    147101         
    148102        //write string as keyword-packed string, to use IGOR parsing functions 
     
    239193                 
    240194                KeepSelectionInBounds(left,right,bottom,top) 
    241                  
    242                 //test for selection out-of-bounds 
    243                 //reset to valid range or abort? 
    244 //              if((left<0) || (left>127)) 
    245 //                      Abort "selection out-of-range" 
    246 //              endif 
    247 //              if((right<0) || (right>127)) 
    248 //                      Abort "selection out-of-range" 
    249 //              endif 
    250 //              if((top<0) || (top>127)) 
    251 //                      Abort "selection out-of-range" 
    252 //              endif 
    253 //              if((bottom<0) || (bottom>127)) 
    254 //                      Abort "selection out-of-range" 
    255 //              endif 
    256195                 
    257196                // selection valid now, calculate beamcenter 
     
    326265// measuring the beam center. Note that you need to ADD ONE to fitted x0 and y0 to get detector 
    327266// coordinates rather than the zero-indexed array. 2D fitting does have the benefit of  
    328 // reporting error bars on the xy (if you believe that 2D gaussian is correct            
     267// reporting error bars on the xy (if you believe that 2D gaussian is correct)           
    329268                SetScale/I x qxlo,qxhi,"",data 
    330269                SetScale/I y qylo,qyhi,"",data 
     
    347286                y2=V_top 
    348287                KeepSelectionInBounds(x1,x2,y1,y2) 
    349 //              x1 = (round(V_left) >= 0) ? round(V_left) : 0 
    350 //              x2 = (round(V_right) <= 127) ? round(V_Right) : 127 
    351 //              y1 = (round(V_bottom) >= 0) ? round(V_bottom) : 0 
    352 //              y2 = (round(V_top) <= 127) ? round(V_top) : 127 
    353 //              Print "x1,x2,y1,y2 = ",x1,x2,y1,y2 
    354288 
    355289                //cross correlation coefficent (K6) must be between 0 and 1, need constraints 
     
    357291                temp_constr = {"K6>0","K6<1"} 
    358292                 
    359                 CurveFit/N Gauss2D data[(x1),(x2)][(y1),(y2)] /I=1 /W=data_err /D /R /A=0 /C=temp_constr 
     293                CurveFit/N Gauss2D data[x1,x2][y1,y2] /I=1 /W=data_err /D /R /A=0 /C=temp_constr 
    360294                 
    361295                Killwaves/Z temp_constr 
     
    479413// y2 = top 
    480414// 
     415// accepts any detector size 
    481416Function KeepSelectionInBounds(x1,x2,y1,y2) 
    482417        Variable &x1,&x2,&y1,&y2 
Note: See TracChangeset for help on using the changeset viewer.