Ignore:
Timestamp:
Sep 18, 2017 12:08:50 PM (5 years ago)
Author:
srkline
Message:

many minor changes after real VSANS data collected.

additional procedures added to allow easy correction of the incorrect header information from NICE.

Most notable addition is the pinhole resolution added to the calculation and the I(q) output. White beam is also treated (incorrectly) as a gaussian distrivution, but the results of smeared fitting look to be quite good.

Trimming and sorting routines are now (pinhole) resolution aware.

File identification routines have been updated to use the proper definitions of "purpose" and "intent". Both fields are now in the catalog, to allow for better sorting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BeamCenter.ipf

    r1055 r1064  
    561561// the calculation of q-values. 
    562562// 
     563// 
    563564// TODO 
    564565// -- some of this is hard-wired in 
     
    606607end 
    607608 
     609// This sets the scale of the data panels to an approximate detector coordinate system with  
     610// zero at the center, only for display purposes. It is not exact, and has nothing to do with 
     611// the calculation of q-values. 
     612// 
     613// ****For the panel display, the scaling MUST be in PIXELS for the readout and calculations to be correct. 
     614// the read out needs pixels, and the calculations use the pixels as the indexes for the real-space (mm) values 
     615// 
     616//  Since I'll only know the beam center in mm, and I'll need the relative panel positions to convert to pixels, 
     617// can I display the panels in their pixel locations relative to each other, based on a zero center and  
     618// the panel offset values? 
     619// 
     620// 
     621// TODO 
     622// -- some of this is hard-wired in 
     623// -- this is still all in terms of pixels, which still may not be what I want 
     624// -- the x-scale of the T/B panels is artificially compressed to "fake" 4mm per pixel in x-direction 
     625// 
     626// Nominal center is 0,0 
     627// 
     628Function V_RescaleToNominalCenter(folderStr,detStr,xCtr,yCtr) 
     629        String folderStr,detStr 
     630        Variable xCtr,yCtr 
     631         
     632//      xCtr = 0 
     633//      yCtr = 0 
     634         
     635        Wave w = $("root:Packages:NIST:VSANS:"+folderStr+":entry:instrument:detector_"+detStr+":data") 
     636         
     637        Variable nPix = 128 
     638        Variable nTubes = 48 
     639        Variable offset = 0 
     640        Variable pixSizeX,pixSizeY 
     641         
     642        strswitch(detStr)       // string switch 
     643                case "MT":              // top panels 
     644                case "FT": 
     645//                      SetScale/I x -xCtr,npix-xCtr,"",w 
     646                        offset = V_getDet_VerticalOffset(folderStr,detStr)              //in cm 
     647                        pixSizeY = 0.84 
     648                        yCtr = -(offset/pixSizeY)  
     649                         
     650                        SetScale/I x -xCtr/2,(npix-xCtr)/2,"",w         // fake 4mm by compressing the scale 
     651                        SetScale/I y -yCtr,nTubes-yCtr,"",w 
     652                        break                                           // exit from switch 
     653                case "MB":              // bottom panels 
     654                case "FB": 
     655//                      SetScale/I x -xCtr,npix-xCtr,"",w 
     656 
     657                        offset = V_getDet_VerticalOffset(folderStr,detStr)              //in cm 
     658                        pixSizeY = 0.84 
     659                        yCtr = nTubes-(offset/pixSizeY)  
     660                         
     661                        SetScale/I x -xCtr/2,(npix-xCtr)/2,"",w 
     662                        SetScale/I y -yCtr,nTubes-yCtr,"",w 
     663                        break                                           // exit from switch 
     664                         
     665                case "ML":              // left panels 
     666                case "FL": 
     667                        offset = V_getDet_LateralOffset(folderStr,detStr)               //in cm 
     668                        pixSizeX = 0.84 
     669                        xCtr = nTubes-(offset/pixSizeX) 
     670                         
     671                        SetScale/I x -xCtr,nTubes-xCtr,"",w 
     672                        SetScale/I y -yCtr,npix-yCtr,"",w 
     673                        break                                           // exit from switch 
     674                case "MR":              // Right panels 
     675                case "FR": 
     676                        offset = V_getDet_LateralOffset(folderStr,detStr)               //in cm 
     677                        pixSizeX = 0.84 
     678                        xCtr = -(offset/pixSizeX) 
     679                 
     680                        SetScale/I x -xCtr,nTubes-xCtr,"",w 
     681                        SetScale/I y -yCtr,npix-yCtr,"",w 
     682                        break                                           // exit from switch 
     683                                         
     684                default:                                                        // optional default expression executed 
     685                        Print "Error in V_RescaleToBeamCenter()" 
     686        endswitch 
     687         
     688        return(0) 
     689end 
     690 
     691 
    608692// TODO 
    609693// these are "nominal" beam center values in pixels for the default VCALC configuration 
     
    641725                xCtr = V_getDet_beam_center_x_pix(fname,detStr) 
    642726                yCtr = V_getDet_beam_center_y_pix(fname,detStr) 
    643                 V_RescaleToBeamCenter(type,detStr,xCtr,yCtr) 
     727//              V_RescaleToBeamCenter(type,detStr,xCtr,yCtr) 
     728                V_RescaleToNominalCenter(type,detStr,xCtr,yCtr)         // xCtr or yCtr value in direction of offset are dummy values here 
    644729        endfor 
    645730                 
Note: See TracChangeset for help on using the changeset viewer.