Changeset 143
- Timestamp:
- Aug 10, 2007 3:08:57 PM (16 years ago)
- Location:
- sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/CircSectAve.ipf
r116 r143 320 320 Variable lambdaWidth = reals[27] 321 321 String detStr=textRead[9] 322 323 Variable usingLenses = reals[28] //new 2007 322 324 323 325 //Two parameters DDET and APOFF are instrument dependent. Determine … … 341 343 Variable ret1,ret2,ret3 342 344 do 343 getResolution(qval[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,ddr, ret1,ret2,ret3)345 getResolution(qval[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,ddr,usingLenses,ret1,ret2,ret3) 344 346 sigmaq[ii] = ret1 345 347 qbar[ii] = ret2 -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/Includes_v500.ipf
r116 r143 77 77 //// "Set3NSORTFiles" 78 78 "CreateTableToCombine" 79 //// "DoCombineFiles" 79 "DoCombineFiles" 80 "-" 81 "Convert To Lens" 82 "Convert To Pinhole" 80 83 "-" 81 84 "AddALLToLayout" 85 82 86 End -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/MainPanel.ipf
r116 r143 241 241 TabControl MainTab,tabLabel(1)="Reduction",tabLabel(2)="1-D Ops",tabLabel(3)="2-D Ops",tabLabel(4)="Misc Ops" 242 242 TabControl MainTab,value=0 243 // 244 TabControl MainTab labelBack=(65535,58981,27524) 243 245 244 246 //on tab(0) - Raw Data - initially visible … … 249 251 Button MainButton_0c,pos={15,150},size={110,20},proc=TransMainButtonProc,title="Transmission" 250 252 Button MainButton_0c,help={"Shows the \"Patch\" panel which allows calculation of sample transmissions and entering these values into raw data headers"} 251 Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display"252 Button MainButton_0d,help={"Shows the panel for control of the RealTime data display. Only used during data collection"}253 // Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display" 254 // Button MainButton_0d,help={"Shows the panel for control of the RealTime data display. Only used during data collection"} 253 255 254 256 //on tab(1) - Reduction -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/NCNR_DataReadWrite.ipf
r116 r143 1600 1600 return(0) 1601 1601 end 1602 1603 //******************* 1604 //************ 1605 // simple command - line utilities to convert/unconvert the header value 1606 // that flags files as using lenses 1607 // 1608 // stored in reals[28], header byte start @ 300 1609 // 1610 // currently, two values (0 | 1) = (no lens | yes lens) 1611 // 1612 // this is used in getResolution (reads the reals[]) and switches the calculation 1613 //************ 1614 1615 Proc ConvertToLens(RunNumber) 1616 Variable RunNumber 1617 HeaderToLensResolution(RunNumber) 1618 End 1619 1620 Proc ConvertToPinhole(RunNumber) 1621 Variable RunNumber 1622 HeaderToPinholeResolution(RunNumber) 1623 End 1624 1625 // sets the flag to zero in the file (= 0) 1626 Function HeaderToPinholeResolution(num) 1627 Variable num 1628 1629 //Print "UnConvert" 1630 String fullname="" 1631 1632 fullname = FindFileFromRunNumber(num) 1633 Print fullname 1634 //report error or change the file 1635 if(cmpstr(fullname,"")==0) 1636 Print "HeaderToPinhole - file not found" 1637 else 1638 //Print "Unconvert",fullname 1639 WriteVAXReal(fullname,0,300) 1640 Endif 1641 return(0) 1642 End 1643 1644 // sets the flag to zero in the file (= 1) 1645 Function HeaderToLensResolution(num) 1646 Variable num 1647 1648 //Print "UnConvert" 1649 String fullname="" 1650 1651 fullname = FindFileFromRunNumber(num) 1652 Print fullname 1653 //report error or change the file 1654 if(cmpstr(fullname,"")==0) 1655 Print "HeaderToPinhole - file not found" 1656 else 1657 //Print "Unconvert",fullname 1658 WriteVAXReal(fullname,1,300) 1659 Endif 1660 return(0) 1661 End -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf
r121 r143 62 62 // raw data header to indicate the presence of lenses. 63 63 // 64 // - Aug 07 - added input to switch calculation based on lenses (==1 if in) 65 // 64 66 // - called by CircSectAvg.ipf and RectAnnulAvg.ipf 65 67 // … … 67 69 // except DDet and apOff, which are set from globals before passing 68 70 // 69 Function/S getResolution(inQ,lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,SigmaQ,QBar,fSubS) 70 Variable inQ, lambda, lambdaWidth, DDet, apOff, S1, S2, L1, L2, BS, del_r 71 // 72 Function/S getResolution(inQ,lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,SigmaQ,QBar,fSubS) 73 Variable inQ, lambda, lambdaWidth, DDet, apOff, S1, S2, L1, L2, BS, del_r,usingLenses 71 74 Variable &fSubS, &QBar, &SigmaQ //these are the output quantities at the input Q value 72 75 … … 104 107 105 108 v_lambda = lambdaWidth^2/6.0 106 v_b = 0.25*(S1*L2/L1)^2 +0.25*(S2*L2/lp)^2 109 110 if(usingLenses==1) //SRK 2007 111 v_b = 0.25*(S1*L2/L1)^2 +0.25*(2/3)*(lambdaWidth/lambda)^2*(S2*L2/lp)^2 //correction to 2nd term 112 else 113 v_b = 0.25*(S1*L2/L1)^2 +0.25*(S2*L2/lp)^2 //original form 114 endif 115 107 116 v_d = (DDet/2.3548)^2 + del_r^2/12.0 108 117 vz = vz_1 / lambda 109 118 yg = 0.5*g*L2*(L1+L2)/vz^2 110 v_g = 2.0* yg^2*v_lambda119 v_g = 2.0*(2.0*yg^2*v_lambda) //factor of 2 correction, B. Hammouda, 2007 111 120 112 121 r0 = L2*tan(2.0*asin(lambda*inQ/(4.0*Pi) )) -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/NSORT.ipf
r116 r143 1517 1517 1518 1518 ///// 1519 SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events1519 // SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events 1520 1520 1521 1521 end … … 1531 1531 // Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Files to Combine" 1532 1532 Edit Labels, SDD, runNum as "Files to Combine" 1533 //SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events1533 SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events 1534 1534 1535 1535 String name="CombineTable" … … 1623 1623 // 1624 1624 Proc DoCombineFiles() 1625 1626 // Wave lowWave = $"root:myGlobals:CombineTable:Low" 1627 // Wave mediumWave = $"root:myGlobals:CombineTable:Medium" 1628 // Wave highWave = $"root:myGlobals:CombineTable:High" 1629 // Wave/T prefixWave = $"root:myGlobals:CombineTable:Prefix" 1630 // Wave/T saveNameWave = $"root:myGlobals:CombineTable:SaveName" 1625 1626 // pop all of the menus to make sure that they are properly populated 1627 LowQPopMenuProc("",1,"") 1628 MedQPopMenuProc("",1,"") 1629 HighQPopMenuProc("",1,"") 1631 1630 1632 1631 String savedDataFolder = GetDataFolder(1) // save … … 1677 1676 Variable ypix= NumberByKey("MOUSEY",infoStr) 1678 1677 Variable modif= NumberByKey("MODIFIERS",infoStr) 1679 if(modif == 2) //bit 1 set, shift key is down 1678 //print modif 1679 if(modif & 2^1) //bit 1 set, shift key is down 1680 1680 PopupContextualMenu/C=(xpix, ypix) "combine;" 1681 1681 strswitch(S_selection) … … 1699 1699 Function SendSelectionToTable() 1700 1700 1701 DoWindow/F ToCombine1701 DoWindow/F CombineTable 1702 1702 if(V_flag==0) 1703 1703 // Make/O/N=0 $"root:myGlobals:CombineTable:Low" … … 1712 1712 1713 1713 else 1714 Wave low = $"root:myGlobals:CombineTable:Low "1715 Wave medium = $"root:myGlobals:CombineTable:Medium "1716 Wave high = $"root:myGlobals:CombineTable:High "1714 Wave low = $"root:myGlobals:CombineTable:LowRun" 1715 Wave medium = $"root:myGlobals:CombineTable:MediumRun" 1716 Wave high = $"root:myGlobals:CombineTable:HighRun" 1717 1717 Wave/T prefix = $"root:myGlobals:CombineTable:Prefix" 1718 1718 Wave/T saveName = $"root:myGlobals:CombineTable:SaveName" … … 1721 1721 Wave gSDD = $"root:myGlobals:CombineTable:SDD" 1722 1722 Wave gRunNumber = $"root:myGlobals:CombineTable:RunNumber" 1723 Wave/T filenames = $"root:myGlobals:CombineTable:FileNames" 1723 1724 endif 1724 1725 … … 1740 1741 1741 1742 num=numpnts(low) 1742 InsertPoints num, 1, low,medium,high 1743 InsertPoints num, 1, low,medium,high,prefix,SaveName 1743 1744 low[num] = tmpRun[2] 1744 1745 medium[num] = tmpRun[1] 1745 1746 high[num] = tmpRun[0] 1747 prefix[num] = GetPrefixStrFromFile(filenames[ii]) 1748 1749 //prompt for combined name 1750 String saveStr="" 1751 Prompt saveStr,"saved file name" 1752 DoPrompt "Enter the combined file name",saveStr 1753 saveName[num] = saveStr 1746 1754 1747 1755 return(0) 1748 1756 end 1757 1758 //given a filename of a SANS data filename of the form 1759 //TTTTTnnn.SAn_TTT_Txxx 1760 //returns the prefix "TTTTT" as some number of characters 1761 //returns "" as an invalid file prefix 1762 // 1763 // NCNR-specifc, does not really belong here - but it's a beta procedure anyhow... 1764 // 1765 Function/S GetPrefixStrFromFile(item) 1766 String item 1767 String invalid = "" //"" is not a valid run prefix, since it's text 1768 Variable num=-1 1769 1770 //find the "dot" 1771 String runStr="" 1772 Variable pos = strsearch(item,".",0) 1773 if(pos == -1) 1774 //"dot" not found 1775 return (invalid) 1776 else 1777 //found, skip the three characters preceeding it 1778 if (pos <=3) 1779 //not enough characters 1780 return (invalid) 1781 else 1782 runStr = item[0,pos-4] 1783 return (runStr) 1784 Endif 1785 Endif 1786 End -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/RectAnnulAvg.ipf
r116 r143 320 320 Variable lambdaWidth = reals[27] 321 321 String detStr=textRead[9] 322 323 Variable usingLenses = reals[28] //new 2007 322 324 323 325 //Two parameters DDET and APOFF are instrument dependent. Determine … … 341 343 Variable ret1,ret2,ret3 342 344 do 343 getResolution(qval[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,ddr, ret1,ret2,ret3)345 getResolution(qval[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,ddr,usingLenses,ret1,ret2,ret3) 344 346 sigmaq[ii] = ret1 345 347 qbar[ii] = ret2
Note: See TracChangeset
for help on using the changeset viewer.