Changeset 57


Ignore:
Timestamp:
Mar 19, 2007 12:16:40 PM (15 years ago)
Author:
srkline
Message:

incorporated beamstop diameter projection to the qMin and shadow
factor calculations. very important at short SDD, negligible at long SDD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/SASCalc/trunk/SASCALC.ipf

    r54 r57  
    88// 09 MAR 2007 SRK - now appends text of each frozen configuration for printing 
    99//                                        - colorized frozen traces so that they aren't all red (unfrozen is black) 
     10// 19 MAR 2007 SRK - corrections added for projected BS diameter at anode plane 
    1011// 
    1112// calculate what q-values you get based on the instruments settings 
     
    2627// - resolution smeared models 
    2728// - "simulation" of data and error bars given a model and a total number of detector counts 
    28 // - sequence of colors for frozen plots 
    2929// - streamline code (globals needed in panel vs. wave needed for calculation) 
    3030// 
     
    685685 
    686686/////////////////////////////////////////////////////////// 
     687// 19MAR07 uses correction for beamstop diameter projection to get shadow factor correct 
     688// 
    687689Function S_CircularAverageTo1D(type) 
    688690        String type 
     
    927929 
    928930        Variable L2 = reals[18] 
    929         Variable BS = reals[21] 
     931//      Variable BS = reals[21]         //this the diameter is stored in mm 
     932        Variable BS = beamstopDiamProjection() * 10             //calculated projection in cm *10 = mm 
    930933        Variable S1 = reals[23] 
    931934        Variable S2 = reals[24] 
     
    13561359         
    13571360        SDD = detDist + s12*(2-tableposition()) 
    1358         rw[18] = SDD/100                // convert to meters 
     1361        rw[18] = SDD/100                // convert to meters for header 
    13591362        return(SDD) 
    13601363End 
     
    14181421End 
    14191422 
    1420  
     1423//returns the projected diameter of the beamstop at the anode plane. 
     1424// most noticeable at short SDD 
     1425Function beamstopDiamProjection() 
     1426 
     1427        NVAR L2diff = root:SAS:L2diff 
     1428        Variable a2 = sampleApertureDiam() 
     1429        Variable bs = beamstopDiam() 
     1430        Variable l2, LB, BS_P 
     1431     
     1432        l2 = sampleToDetectorDist() + L2diff 
     1433        LB = 20.1 + 1.61*BS                     //distance in cm from beamstop to anode plane (empirical) 
     1434        BS_P = bs + (bs+a2)*lb/(l2-lb)          //diameter of shadow from parallax 
     1435 
     1436        return (bs_p)           //return projected diameter in cm 
     1437End 
     1438 
     1439// 19MAR07 - using correction from John for an estimate of the shadow of the beamstop 
     1440// at the detection plane. This is a noticeable effect at short SDD, where the projected 
     1441// diameter of the beamstop is much larger than the physical diameter. 
    14211442Function qMin() 
    14221443 
    1423     Variable l2s = sampleToDetectorDist()       //distance from sample to detector 
    1424     Variable bs = beamstopDiam()                //beamstop diameter 
     1444    Variable l2s = sampleToDetectorDist()       //distance from sample to detector in cm 
     1445//    Variable bs = beamstopDiam()              //beamstop diameter in cm 
     1446    Variable bs_p = beamstopDiamProjection()            //projected beamstop diameter in cm 
    14251447    NVAR lambda = root:SAS:gLambda 
    1426     NVAR d_det = root:SAS:d_det 
    1427     NVAR a_pixel = root:SAS:a_pixel 
    1428      
    1429     return( (pi/lambda)*(bs + d_det + a_pixel)/l2s ) 
     1448    NVAR d_det = root:SAS:d_det         //cm 
     1449    NVAR a_pixel = root:SAS:a_pixel     //cm 
     1450 
     1451    return( (pi/lambda)*(bs_p + d_det + a_pixel)/l2s )          //use bs_p rather than bs 
     1452   // return( (pi/lambda)*(bs + d_det + a_pixel)/l2s )          //use bs (incorrect) 
    14301453End 
    14311454 
Note: See TracChangeset for help on using the changeset viewer.