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_FrontView_Deg.ipf

    r955 r1062  
    4141        Variable axisRange 
    4242         
    43 // these offset values are in mm !! 
    44 //in mm !!  distance T/B are behind L/R - not to be confused with lateral offset 
    45         NVAR front_SDDOffset = root:Packages:NIST:VSANS:VCALC:gFront_SDDOffset 
    46         NVAR middle_SDDOffset = root:Packages:NIST:VSANS:VCALC:gMiddle_SDDOffset 
     43// these offset values are in cm !! 
     44//in cm !!  distance T/B are behind L/R - not to be confused with lateral offset 
     45        NVAR front_SDDsetback = root:Packages:NIST:VSANS:VCALC:gFront_SDDsetback 
     46        NVAR middle_SDDsetback = root:Packages:NIST:VSANS:VCALC:gMiddle_SDDsetback 
    4747         
    4848         
     
    9595 
    9696        //start drawing from the back, and work to the front as would be visible 
    97         // ********* all of the dimensions are converted to mm 
     97        // ********* all of the dimensions are in cm 
    9898        Variable tmp_x1,tmp_x2,tmp_y1,tmp_y2 
    9999         
    100100        // back detector +/- degrees 
    101         tmp_x1 = -atan(B_w/2/(B_SDD*1000)) *(180/pi) 
     101        tmp_x1 = -atan(B_w/2/(B_SDD)) *(180/pi) 
    102102        tmp_x2 = -tmp_x1 
    103         tmp_y1 = -atan(B_h/2/(B_SDD*1000)) *(180/pi) 
     103        tmp_y1 = -atan(B_h/2/(B_SDD)) *(180/pi) 
    104104        tmp_y2 = -tmp_y1 
    105105         
     
    113113// TO DO -- add in the additional offset (backwards) to the SDD of the T/B panels 
    114114// TOP 
    115         tmp_x1 = -atan(M_TB_w/2/(M_SDD*1000+middle_SDDOffset))*(180/pi)         // x symmetric y is not 
     115        tmp_x1 = -atan(M_TB_w/2/(M_SDD+middle_SDDsetback))*(180/pi)             // x symmetric y is not 
    116116        tmp_x2 = -tmp_x1 
    117         tmp_y1 = atan(M_TB_sep/2/(M_SDD*1000+middle_SDDOffset))*(180/pi) 
    118         tmp_y2 = atan((M_TB_sep/2+M_TB_h)/(M_SDD*1000+middle_SDDOffset))*(180/pi) 
     117        tmp_y1 = atan(M_TB_sep/2/(M_SDD+middle_SDDsetback))*(180/pi) 
     118        tmp_y2 = atan((M_TB_sep/2+M_TB_h)/(M_SDD+middle_SDDsetback))*(180/pi) 
    119119         
    120120//      Print tmp_x1,tmp_x2,tmp_y1,tmp_y2 
     
    124124                 
    125125// BOTTOM (x unchanged, negate and swap y1,y2) 
    126         tmp_y1 = -atan((M_TB_sep/2+M_TB_h)/(M_SDD*1000+middle_SDDOffset))*(180/pi) 
    127         tmp_y2 = -atan(M_TB_sep/2/(M_SDD*1000+middle_SDDOffset))*(180/pi) 
     126        tmp_y1 = -atan((M_TB_sep/2+M_TB_h)/(M_SDD+middle_SDDsetback))*(180/pi) 
     127        tmp_y2 = -atan(M_TB_sep/2/(M_SDD+middle_SDDsetback))*(180/pi) 
    128128        SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (1,16019,65535) 
    129129        DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1           
    130130         
    131131// LEFT 
    132         tmp_x1 = -atan((M_LR_w+M_LR_sep/2)/(M_SDD*1000))*(180/pi)               // y symmetric x is not 
    133         tmp_x2 = -atan((M_LR_sep/2)/(M_SDD*1000))*(180/pi) 
    134         tmp_y1 = atan(M_LR_h/2/(M_SDD*1000))*(180/pi) 
     132        tmp_x1 = -atan((M_LR_w+M_LR_sep/2)/(M_SDD))*(180/pi)            // y symmetric x is not 
     133        tmp_x2 = -atan((M_LR_sep/2)/(M_SDD))*(180/pi) 
     134        tmp_y1 = atan(M_LR_h/2/(M_SDD))*(180/pi) 
    135135        tmp_y2 = -tmp_y1 
    136136        SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (65535,0,0) 
    137137        DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1                   
    138138// RIGHT (x changes, y the same) 
    139         tmp_x1 = atan((M_LR_sep/2)/(M_SDD*1000))*(180/pi)               // y symmetric x is not 
    140         tmp_x2 = atan((M_LR_w+M_LR_sep/2)/(M_SDD*1000))*(180/pi) 
     139        tmp_x1 = atan((M_LR_sep/2)/(M_SDD))*(180/pi)            // y symmetric x is not 
     140        tmp_x2 = atan((M_LR_w+M_LR_sep/2)/(M_SDD))*(180/pi) 
    141141        SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (65535,0,0) 
    142142        DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1   
     
    148148// TO DO -- add in the additional offset (backwards) to the SDD of the T/B panels 
    149149// TOP 
    150         tmp_x1 = -atan(F_TB_w/2/(F_SDD*1000+front_SDDOffset))*(180/pi)          // x symmetric y is not 
     150        tmp_x1 = -atan(F_TB_w/2/(F_SDD+front_SDDsetback))*(180/pi)              // x symmetric y is not 
    151151        tmp_x2 = -tmp_x1 
    152         tmp_y1 = atan(F_TB_sep/2/(F_SDD*1000+front_SDDOffset))*(180/pi) 
    153         tmp_y2 = atan((F_TB_sep/2+F_TB_h)/(F_SDD*1000+front_SDDOffset))*(180/pi) 
     152        tmp_y1 = atan(F_TB_sep/2/(F_SDD+front_SDDsetback))*(180/pi) 
     153        tmp_y2 = atan((F_TB_sep/2+F_TB_h)/(F_SDD+front_SDDsetback))*(180/pi) 
    154154         
    155155//      Print tmp_x1,tmp_x2,tmp_y1,tmp_y2 
     
    159159                 
    160160// BOTTOM (x unchanged, negate and swap y1,y2) 
    161         tmp_y1 = -atan((F_TB_sep/2+F_TB_h)/(F_SDD*1000+front_SDDOffset))*(180/pi) 
    162         tmp_y2 = -atan(F_TB_sep/2/(F_SDD*1000+front_SDDOffset))*(180/pi) 
     161        tmp_y1 = -atan((F_TB_sep/2+F_TB_h)/(F_SDD+front_SDDsetback))*(180/pi) 
     162        tmp_y2 = -atan(F_TB_sep/2/(F_SDD+front_SDDsetback))*(180/pi) 
    163163        SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (1,52428,26586) 
    164164        DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1           
    165165         
    166166// LEFT 
    167         tmp_x1 = -atan((F_LR_w+F_LR_sep/2)/(F_SDD*1000))*(180/pi)               // y symmetric x is not 
    168         tmp_x2 = -atan((F_LR_sep/2)/(F_SDD*1000))*(180/pi) 
    169         tmp_y1 = atan(F_LR_h/2/(F_SDD*1000))*(180/pi) 
     167        tmp_x1 = -atan((F_LR_w+F_LR_sep/2)/(F_SDD))*(180/pi)            // y symmetric x is not 
     168        tmp_x2 = -atan((F_LR_sep/2)/(F_SDD))*(180/pi) 
     169        tmp_y1 = atan(F_LR_h/2/(F_SDD))*(180/pi) 
    170170        tmp_y2 = -tmp_y1 
    171171        SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (39321,26208,1) 
    172172        DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1                   
    173173// RIGHT (x changes, y the same) 
    174         tmp_x1 = atan((F_LR_sep/2)/(F_SDD*1000))*(180/pi)               // y symmetric x is not 
    175         tmp_x2 = atan((F_LR_w+F_LR_sep/2)/(F_SDD*1000))*(180/pi) 
     174        tmp_x1 = atan((F_LR_sep/2)/(F_SDD))*(180/pi)            // y symmetric x is not 
     175        tmp_x2 = atan((F_LR_w+F_LR_sep/2)/(F_SDD))*(180/pi) 
    176176        SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (39321,26208,1) 
    177177        DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1   
Note: See TracChangeset for help on using the changeset viewer.