Changeset 57 for sans/SASCalc/trunk/SASCALC.ipf
 Timestamp:
 Mar 19, 2007 12:16:40 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/SASCalc/trunk/SASCALC.ipf
r54 r57 8 8 // 09 MAR 2007 SRK  now appends text of each frozen configuration for printing 9 9 //  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 10 11 // 11 12 // calculate what qvalues you get based on the instruments settings … … 26 27 //  resolution smeared models 27 28 //  "simulation" of data and error bars given a model and a total number of detector counts 28 //  sequence of colors for frozen plots29 29 //  streamline code (globals needed in panel vs. wave needed for calculation) 30 30 // … … 685 685 686 686 /////////////////////////////////////////////////////////// 687 // 19MAR07 uses correction for beamstop diameter projection to get shadow factor correct 688 // 687 689 Function S_CircularAverageTo1D(type) 688 690 String type … … 927 929 928 930 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 930 933 Variable S1 = reals[23] 931 934 Variable S2 = reals[24] … … 1356 1359 1357 1360 SDD = detDist + s12*(2tableposition()) 1358 rw[18] = SDD/100 // convert to meters 1361 rw[18] = SDD/100 // convert to meters for header 1359 1362 return(SDD) 1360 1363 End … … 1418 1421 End 1419 1422 1420 1423 //returns the projected diameter of the beamstop at the anode plane. 1424 // most noticeable at short SDD 1425 Function 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/(l2lb) //diameter of shadow from parallax 1435 1436 return (bs_p) //return projected diameter in cm 1437 End 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. 1421 1442 Function qMin() 1422 1443 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 1425 1447 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) 1430 1453 End 1431 1454
Note: See TracChangeset
for help on using the changeset viewer.