Changeset 212


Ignore:
Timestamp:
Nov 28, 2007 5:16:01 PM (15 years ago)
Author:
srkline
Message:

fixed the annoying bug that Kathryn saw when plotting 2D from the work file math panel. Some procedures were looking for root:raw:realsRead, which does not exist, and is the wrong place to look. Procedures now look to the proper data folder.

Location:
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/RawWindowHook.ipf

    r167 r212  
    240240                        //update q, qX, and qY 
    241241                        if(cmpstr(cur_folder,"MSK")!=0) 
    242                                 Variable xctr=reals[16],yctr=reals[17],sdd=reals[18],lam=reals[26] 
    243                                 Variable/G root:myGlobals:gQQ = CalcQval(xaxval+1,yaxval+1,xctr,yctr,sdd,lam) 
    244                                 Variable/G root:myGlobals:gQX = CalcQX(xaxval+1,xctr,sdd,lam) 
    245                                 Variable/G root:myGlobals:gQY = CalcQY(yaxval+1,yctr,sdd,lam) 
     242                                Variable xctr=reals[16],yctr=reals[17],sdd=reals[18],lam=reals[26],pixSize=reals[13] 
     243                                Variable/G root:myGlobals:gQQ = CalcQval(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSize) 
     244                                Variable/G root:myGlobals:gQX = CalcQX(xaxval+1,xctr,sdd,lam,pixSize) 
     245                                Variable/G root:myGlobals:gQY = CalcQY(yaxval+1,yctr,sdd,lam,pixSize) 
    246246                        else 
    247247                                Variable/G root:myGlobals:gQQ = 0 
     
    272272// generalized to read the detector pixel dimension from the file header... 
    273273// 
    274 Function CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam) 
    275         Variable xaxval,yaxval,xctr,yctr,sdd,lam 
     274Function CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSize) 
     275        Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSize 
    276276         
    277277        Variable dx,dy,thetax,thetay,qval,qx,qy 
    278278         
    279         Wave realW=$"root:raw:realsRead" 
    280         Variable pixSizeX = realW[10]/10                //header is in mm, want cm 
    281         Variable pixSizeY = realW[13]/10                //header is in mm, want cm 
     279//      Wave realW=$"root:raw:realsRead" 
     280//      Variable pixSizeX = realW[10]/10                //header is in mm, want cm 
     281//      Variable pixSizeY = realW[13]/10                //header is in mm, want cm 
     282        Variable pixSizeX=pixSize 
     283        Variable pixSizeY=pixSize 
    282284         
    283285        sdd *=100               //convert to cm 
     
    299301// generalized to read the detector pixel dimension from the file header... 
    300302// 
    301 Function CalcQX(xaxval,xctr,sdd,lam) 
    302         Variable xaxval,xctr,sdd,lam 
     303Function CalcQX(xaxval,xctr,sdd,lam,pixSize) 
     304        Variable xaxval,xctr,sdd,lam,pixSize 
    303305        //NOTE: detector locations passed in are pixel = 0.5cm real space on the Ordela detector 
    304306        //sdd is in meters 
    305307        //wavelength is in Angstroms 
    306308         
    307         Wave realW=$"root:raw:realsRead" 
    308         Variable pixSize = realW[10]/10         //header is in mm, want cm 
     309//      Wave realW=$"root:raw:realsRead" 
     310//      Variable pixSize = realW[10]/10         //header is in mm, want cm 
    309311         
    310312        Variable dx,thetax,qx 
     
    324326// generalized to read the detector pixel dimension from the file header... 
    325327// 
    326 Function CalcQY(yaxval,yctr,sdd,lam) 
    327         Variable yaxval,yctr,sdd,lam 
     328Function CalcQY(yaxval,yctr,sdd,lam,pixSize) 
     329        Variable yaxval,yctr,sdd,lam,pixSize 
    328330        //NOTE: detector locations passed in are pixel = 0.5cm real space on the Ordela detector 
    329331        //sdd is in meters 
    330332        //wavelength is in Angstroms 
    331333         
    332         Wave realW=$"root:raw:realsRead" 
    333         Variable pixSize = realW[13]/10         //header is in mm, want cm 
     334//      Wave realW=$"root:raw:realsRead" 
     335//      Variable pixSize = realW[13]/10         //header is in mm, want cm 
    334336                 
    335337        Variable dy,thetay,qy 
     
    362364        WAVE reals=$(curPath + ":realsread") 
    363365        Variable xctr=reals[16],yctr=reals[17],sdd=reals[18],lam=reals[26] 
     366        Variable pixSize=reals[13]/10           //pixel size in cm to pass 
    364367        Variable maxX,minX,maxY,minY 
    365368         
    366         minX = CalcQX(1,xctr,sdd,lam) 
    367         maxX = CalcQX(pixelsX,xctr,sdd,lam) 
     369        minX = CalcQX(1,xctr,sdd,lam,pixSize) 
     370        maxX = CalcQX(pixelsX,xctr,sdd,lam,pixSize) 
    368371        SetScale/I x minX,maxX,"",qx 
    369372         
    370         minY = CalcQY(1,yctr,sdd,lam) 
    371         maxY = CalcQY(pixelsY,yctr,sdd,lam) 
     373        minY = CalcQY(1,yctr,sdd,lam,pixSize) 
     374        maxY = CalcQY(pixelsY,yctr,sdd,lam,pixSize) 
    372375        qy[0] = minY 
    373376        qy[1] = maxY 
  • sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/WriteQIS.ipf

    r206 r212  
    732732        MyMat2XYZ(data,qx_val,qy_val,z_val)             //x and y are [p][q] indexes, not q-vals yet 
    733733         
    734         qx_val = CalcQx(qx_val+1,rw[16],rw[18],rw[26])          //+1 converts to detector coordinate system 
    735         qy_val = CalcQy(qy_val+1,rw[17],rw[18],rw[26]) 
     734        qx_val = CalcQx(qx_val+1,rw[16],rw[18],rw[26],rw[13])           //+1 converts to detector coordinate system 
     735        qy_val = CalcQy(qy_val+1,rw[17],rw[18],rw[26],rw[13]) 
    736736 
    737737        //not demo-compatible, but approx 8x faster!!    
Note: See TracChangeset for help on using the changeset viewer.