Ignore:
Timestamp:
Aug 29, 2017 12:55:04 PM (5 years ago)
Author:
srkline
Message:

many changes to the VCALC code and a few changes to the main code to get the units consistent, and centimeters everywhere possible. The real space distance array and the non-linear calibrations are still defined and calculated in mm. This can hopefully be changed in the future. Some constants in the data file will need to be updated to cm, such as the T/B setback, which has been confirmed to be 41.0 cm

File:
1 edited

Legend:

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

    r1055 r1062  
    125125 
    126126        Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,nPix_X,nPix_Y 
    127         Variable F_LR_sep,F_TB_sep,F_offset,F_sdd_offset 
     127        Variable F_LR_sep,F_TB_sep,F_offset,F_sdd_setback 
    128128 
    129129        String folderPath = "root:Packages:NIST:VSANS:VCALC" 
     
    136136        F_offset = VCALC_getLateralOffset("FL") 
    137137         
    138         SDD = VCALC_getSDD("FL")                //nominal SDD - need offset for TB 
     138        SDD = VCALC_getSDD("FL")                //nominal SDD [cm] - need offset for TB 
    139139        lam = VCALC_getWavelength() 
    140140 
    141 //separations are in mm -- need to watch the units, convert to cm 
    142         F_LR_sep /= 10 
    143         F_TB_sep /= 10 
     141//separations are in cm --  
     142//      F_LR_sep /= 10 
     143//      F_TB_sep /= 10 
    144144// TODO - I'm treating the separation as the TOTAL width - so the difference 
    145145//      from the "center" to the edge is 1/2 of the separation 
     
    147147// TODO (make the N along the tube length a variable, since this can be reset @ acquisition) 
    148148 
    149         F_sdd_offset = VCALC_getTopBottomSDDOffset("FT")        //T/B are 300 mm farther back  //TODO: make all detector parameters global, not hard-wired 
     149        F_sdd_setback = VCALC_getTopBottomSDDSetback("FT")      //T/B are 41 cm farther back  //TODO: make all detector parameters global, not hard-wired 
    150150 
    151151// detector data to bin 
     
    274274        // global sdd_offset is in (mm), convert to meters here for the Q-calculation 
    275275//      VC_Detector_2Q(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
    276         VC_Detector_2Q_NonLin(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY,"FT") 
     276        VC_Detector_2Q_NonLin(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_setback,lam,pixSizeX,pixSizeY,"FT") 
    277277 
    278278//      Print "xy for FT = ",xCtr,yCtr 
     
    315315        // global sdd_offset is in (mm), convert to meters here for the Q-calculation 
    316316//      VC_Detector_2Q(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
    317         VC_Detector_2Q_NonLin(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY,"FB") 
     317        VC_Detector_2Q_NonLin(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_setback,lam,pixSizeX,pixSizeY,"FB") 
    318318 
    319319//      Print "xy for FB = ",xCtr,yCtr 
     
    347347                LR_sep = V_Value         
    348348        endif            
    349 //separations on panel are in mm -- need to watch the units, convert to cm 
    350         LR_sep /= 10 
     349//separations on panel are in cm -- need to watch the units, convert to cm 
     350//      LR_sep /= 10 
    351351 
    352352//detector data 
     
    570570 
    571571        Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,nPix_X,nPix_Y 
    572         Variable M_LR_sep,M_TB_sep,M_offset, M_sdd_offset 
     572        Variable M_LR_sep,M_TB_sep,M_offset, M_sdd_setback 
    573573 
    574574 
     
    581581        M_offset = VCALC_getLateralOffset("ML") 
    582582         
    583         SDD = VCALC_getSDD("ML")                //nominal SDD - need offset for TB 
     583        SDD = VCALC_getSDD("ML")                //nominal SDD [cm] - need offset for TB 
    584584        lam = VCALC_getWavelength() 
    585585 
    586 //separations are in mm -- need to watch the units, convert to cm 
    587         M_LR_sep /= 10 
    588         M_TB_sep /= 10 
     586//separations are in cm -- need to watch the units, convert to cm 
     587//      M_LR_sep /= 10 
     588//      M_TB_sep /= 10 
    589589// TODO - I'm treating the separation as the TOTAL width - so the difference 
    590590//      from the "center" to the edge is 1/2 of the separation 
    591591 
    592592// TODO (make the N along the tube length a variable, since this can be reset @ acquisition) 
    593         M_sdd_offset = VCALC_getTopBottomSDDOffset("MT")        //T/B are 30 cm farther back  //TODO: make all detector parameters global, not hard-wired 
     593        M_sdd_setback = VCALC_getTopBottomSDDSetback("MT")      //T/B are 41 cm farther back  //TODO: make all detector parameters global, not hard-wired 
    594594 
    595595 
     
    723723        // global sdd_offset is in (mm), convert to meters here for the Q-calculation   
    724724//      VC_Detector_2Q(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
    725         VC_Detector_2Q_NonLin(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY,"MT") 
     725        VC_Detector_2Q_NonLin(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_setback,lam,pixSizeX,pixSizeY,"MT") 
    726726 
    727727//      Print "xy for MT = ",xCtr,yCtr 
     
    764764                // global sdd_offset is in (mm), convert to meters here for the Q-calculation 
    765765//      VC_Detector_2Q(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
    766         VC_Detector_2Q_NonLin(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY,"MB") 
     766        VC_Detector_2Q_NonLin(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_setback,lam,pixSizeX,pixSizeY,"MB") 
    767767 
    768768//      Print "xy for MB = ",xCtr,yCtr 
Note: See TracChangeset for help on using the changeset viewer.