Changeset 70 for sans/SANSReduction/branches
- Timestamp:
- Mar 29, 2007 4:02:33 PM (16 years ago)
- Location:
- sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/FIT_Ops.ipf
r47 r70 170 170 String popStr 171 171 172 String tempStr= filterButtonProc(ctrlName)172 String tempStr=ReducedDataFileList(ctrlName) 173 173 if(strlen(tempStr)==0) 174 174 tempStr = "Pick the data path" … … 723 723 String popStr 724 724 725 String tempStr= filterButtonProc(ctrlName)725 String tempStr=ReducedDataFileList(ctrlName) 726 726 if(strlen(tempStr)==0) 727 727 tempStr = "Pick the data path" … … 739 739 //** not used anymore - simpler file filter is used instead 740 740 // 741 Function/S GetValidFITRPAPopupList()742 743 String list = "none;something;"744 745 PathInfo catPathName746 String path = S_path747 if(V_flag == 0)748 Abort "path does not exist - use Pick Path button"749 Endif750 751 list = IndexedFile(catPathName,-1,"????") //get all files in folder752 753 //trim version numbers from list754 Variable num = ItemsInList(list,";")755 Variable ii,isRAW756 String item = "",listCopy = "", fullName = "",partialName = ""757 758 ii=1759 do760 item = num2str(ii)761 list = RemoveFromList(item,list,";")762 ii+=1763 while (ii<12)764 765 //trim raw data files from list766 listCopy = list //scan through items in copy, change list767 num = ItemsInList(listCopy,";") //get the new number of items in the list768 ii=0769 do770 //build valid fileName771 item = StringFromList(ii,listCopy,";")772 if (strlen(item) !=0 )773 partialName = FindValidFileName(item)774 if(strlen(partialName) !=0) //non-null return from FindValidFileName()775 fullName = path + partialName776 //check if RAW, if so, remove from list777 isRAW = CheckIfRAWData(fullName)778 if(isRAW)779 list = RemoveFromList(item,list,";")780 Endif781 Endif782 Endif783 ii+=1784 While(ii<num)785 786 return list787 End741 //Function/S GetValidFITRPAPopupList() 742 // 743 // String list = "none;something;" 744 // 745 // PathInfo catPathName 746 // String path = S_path 747 // if(V_flag == 0) 748 // Abort "path does not exist - use Pick Path button" 749 // Endif 750 // 751 // list = IndexedFile(catPathName,-1,"????") //get all files in folder 752 // 753 // //trim version numbers from list 754 // Variable num = ItemsInList(list,";") 755 // Variable ii,isRAW 756 // String item = "",listCopy = "", fullName = "",partialName = "" 757 // 758 // ii=1 759 // do 760 // item = num2str(ii) 761 // list = RemoveFromList(item,list,";") 762 // ii+=1 763 // while (ii<12) 764 // 765 // //trim raw data files from list 766 // listCopy = list //scan through items in copy, change list 767 // num = ItemsInList(listCopy,";") //get the new number of items in the list 768 // ii=0 769 // do 770 // //build valid fileName 771 // item = StringFromList(ii,listCopy,";") 772 // if (strlen(item) !=0 ) 773 // partialName = FindValidFileName(item) 774 // if(strlen(partialName) !=0) //non-null return from FindValidFileName() 775 // fullName = path + partialName 776 // //check if RAW, if so, remove from list 777 // isRAW = CheckIfRAWData(fullName) 778 // if(isRAW) 779 // list = RemoveFromList(item,list,";") 780 // Endif 781 // Endif 782 // Endif 783 // ii+=1 784 // While(ii<num) 785 // 786 // return list 787 //End 788 788 789 789 // window recreation macro to draw the fit/rpa panel … … 1036 1036 tempName = FindValidFilename(partialName) 1037 1037 1038 Variable lambdaFromFile=GetLambdaFromReducedData(tempName) 1039 Variable/G root:myGlobals:FITRPA:gLambda = lambdaFromFile 1040 Print "Lambda in file read as:", lambdaFromFile 1041 1038 1042 //prepend path to tempName for read routine 1039 1043 PathInfo catPathName 1040 1041 String junkString1042 Variable lambdaFromFile, fileVar1043 lambdaFromFile = 6.01044 Open/R/P=catPathName fileVar as tempName1045 FReadLine fileVar, junkString1046 FReadLine fileVar, junkString1047 FReadLine fileVar, junkString1048 if(strsearch(LowerStr(junkString),"lambda",0) != -1)1049 FReadLine/N=11 fileVar, junkString1050 FReadLine/N=10 fileVar, junkString1051 lambdaFromFile = str2num(junkString)1052 endif1053 Close fileVar1054 1055 Variable/G root:myGlobals:FITRPA:gLambda = lambdaFromFile1056 1057 Print "Lambda in file read as:", lambdaFromFile1058 1059 1044 tempName = S_path + tempName 1060 1045 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/Marquee.ipf
r40 r70 24 24 //the x,y values must also be in axis coordinates[0,127] NOT (1,128) detector coords. 25 25 // 26 // accepts arbitrary detector coordinates. calling function is responsible for 27 // keeping selection in bounds 26 28 Function SumCountsInBox(x1,x2,y1,y2,type) 27 29 Variable x1,x2,y1,y2 … … 54 56 End 55 57 56 //b BGtoFIX57 // this function is a hard-coded special case of SumCountsInBox (that you copied)58 // - delete this function, and call SumCountsInBox with the appropriate xy range59 Function SumTotalCounts(type)60 // Variable x1,x2,y1,y261 String type62 63 Variable counts = 0,ii,jj64 65 String dest = "root:"+type66 67 //check for logscale data, but don't change the data68 NVAR gIsLogScale = $(dest + ":gIsLogScale")69 if (gIsLogScale)70 wave w=$(dest + ":linear_data")71 else72 wave w=$(dest + ":data")73 endif74 75 ii=076 jj=077 do78 do79 counts += w[ii][jj]80 jj+=181 while(jj<=127)82 jj=083 ii+=184 while(ii<=127)85 86 Return (counts)87 End88 //e BGtoFix89 58 90 59 //from a marquee selection: … … 130 99 Execute "InitializeTransPanel()" 131 100 Endif 132 133 //need to do error checking for in-bounds selection of marquee (0,127) inclusive134 //reset to valid range or abort?135 // if((x1<0) || (x1>127))136 // Abort "selection out-of-range"137 // endif138 // if((x2<0) || (x2>127))139 // Abort "selection out-of-range"140 // endif141 // if((y1<0) || (y1>127))142 // Abort "selection out-of-range"143 // endif144 // if((y2<0) || (y2>127))145 // Abort "selection out-of-range"146 // endif147 101 148 102 //write string as keyword-packed string, to use IGOR parsing functions … … 239 193 240 194 KeepSelectionInBounds(left,right,bottom,top) 241 242 //test for selection out-of-bounds243 //reset to valid range or abort?244 // if((left<0) || (left>127))245 // Abort "selection out-of-range"246 // endif247 // if((right<0) || (right>127))248 // Abort "selection out-of-range"249 // endif250 // if((top<0) || (top>127))251 // Abort "selection out-of-range"252 // endif253 // if((bottom<0) || (bottom>127))254 // Abort "selection out-of-range"255 // endif256 195 257 196 // selection valid now, calculate beamcenter … … 326 265 // measuring the beam center. Note that you need to ADD ONE to fitted x0 and y0 to get detector 327 266 // coordinates rather than the zero-indexed array. 2D fitting does have the benefit of 328 // reporting error bars on the xy (if you believe that 2D gaussian is correct 267 // reporting error bars on the xy (if you believe that 2D gaussian is correct) 329 268 SetScale/I x qxlo,qxhi,"",data 330 269 SetScale/I y qylo,qyhi,"",data … … 347 286 y2=V_top 348 287 KeepSelectionInBounds(x1,x2,y1,y2) 349 // x1 = (round(V_left) >= 0) ? round(V_left) : 0350 // x2 = (round(V_right) <= 127) ? round(V_Right) : 127351 // y1 = (round(V_bottom) >= 0) ? round(V_bottom) : 0352 // y2 = (round(V_top) <= 127) ? round(V_top) : 127353 // Print "x1,x2,y1,y2 = ",x1,x2,y1,y2354 288 355 289 //cross correlation coefficent (K6) must be between 0 and 1, need constraints … … 357 291 temp_constr = {"K6>0","K6<1"} 358 292 359 CurveFit/N Gauss2D data[ (x1),(x2)][(y1),(y2)] /I=1 /W=data_err /D /R /A=0 /C=temp_constr293 CurveFit/N Gauss2D data[x1,x2][y1,y2] /I=1 /W=data_err /D /R /A=0 /C=temp_constr 360 294 361 295 Killwaves/Z temp_constr … … 479 413 // y2 = top 480 414 // 415 // accepts any detector size 481 416 Function KeepSelectionInBounds(x1,x2,y1,y2) 482 417 Variable &x1,&x2,&y1,&y2 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_DataReadWrite.ipf
r69 r70 829 829 // 830 830 831 //returns a string containg the transmision stored in the file that is 832 //currently in the "type" folder (not from the binary header) 833 //returns "none" if the value (in RealsRead) cannot be found 834 // 835 Function/S GetTrans(type) 836 String type 837 838 String name="root:"+type+":realsread" 839 WAVE reals = $name 840 if(waveExists(reals)) 841 return(num2str(reals[4])) 842 else 843 return("none") 844 endif 845 End 846 847 //returns a string containg the sample thickness stored in the file that is 848 //currently in the "type" folder (not from the binary header) 849 //returns "none" if the value (in RealsRead) cannot be found 850 // 851 Function/S GetThick(type) 852 String type 853 854 String name="root:"+type+":realsread" 855 WAVE reals = $name 856 if(waveExists(reals)) 857 return(num2str(reals[5])) 858 else 859 return("none") 860 endif 861 End 831 862 832 863 833 /////***************** … … 936 906 Return(0) 937 907 End 908 909 // read specific bits of information from the header 910 // each of these operations MUST take care of open/close on their own 911 912 Function/S getStringFromHeader(fname,start,num) 913 String fname //full path:name 914 Variable start,num //starting byte and number of characters to read 915 916 String str 917 Variable refnum 918 Open/R refNum as fname 919 FSetPos refNum,start 920 FReadLine/N=(num) refNum,str 921 Close refnum 922 923 return(str) 924 End 925 // file suffix (4 characters @ byte 19) 926 Function/S getSuffix(fname) 927 String fname 928 929 return(getStringFromHeader(fname,19,4)) 930 End 931 932 // sample label (60 characters @ byte 98) 933 Function/S getSampleLabel(fname) 934 String fname 935 936 return(getStringFromHeader(fname,98,60)) 937 End 938 939 // read a single real value with GBLoadWave 940 Function getRealValueFromHeader(fname,start) 941 String fname 942 Variable start 943 944 String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 945 946 GBLoadStr += "/S="+num2str(start)+"/U=1" + "\"" + fname + "\"" 947 Execute GBLoadStr 948 Wave w=$"tempGBWave0" 949 950 return(w[0]) 951 End 952 953 //SDD is at byte 260 954 Function getSDD(fname) 955 String fname 956 957 return(getRealValueFromHeader(fname,260)) 958 end 959 //reads the wavelength from a reduced data file (not very reliable) 960 // - does not work with NSORTed files 961 // - only used in FIT/RPA (which itself is almost NEVER used...) 962 // 963 Function GetLambdaFromReducedData(tempName) 964 String tempName 965 966 String junkString 967 Variable lambdaFromFile, fileVar 968 lambdaFromFile = 6.0 969 Open/R/P=catPathName fileVar as tempName 970 FReadLine fileVar, junkString 971 FReadLine fileVar, junkString 972 FReadLine fileVar, junkString 973 if(strsearch(LowerStr(junkString),"lambda",0) != -1) 974 FReadLine/N=11 fileVar, junkString 975 FReadLine/N=10 fileVar, junkString 976 lambdaFromFile = str2num(junkString) 977 endif 978 Close fileVar 979 980 return(lambdaFromFile) 981 End 982 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf
r69 r70 968 968 End 969 969 970 //function called byt the popups to get a file list of data that can be sorted 971 // this procedure simply removes the raw data files from the string - there 972 //can be lots of other junk present, but this is very fast... 973 // 974 // could also use the alternate procedure of keeping only file with the proper extension 975 // 976 // another possibility is to get a listing of the text files, but is unreliable on 977 // Windows, where the data file must be .txt (and possibly OSX) 978 // 979 Function/S ReducedDataFileList(ctrlName) 980 String ctrlName 981 982 String list="",newList="",item="" 983 Variable num,ii 984 985 //check for the path 986 PathInfo catPathName 987 if(V_Flag==0) 988 DoAlert 0, "Data path does not exist - pick the data path from the button on the main panel" 989 Return("") 990 Endif 991 992 list = IndexedFile(catpathName,-1,"????") 993 num=ItemsInList(list,";") 994 //print "num = ",num 995 for(ii=(num-1);ii>=0;ii-=1) 996 item = StringFromList(ii, list ,";") 997 //simply remove all that are not raw data files (SA1 SA2 SA3) 998 if( !stringmatch(item,"*.SA1*") && !stringmatch(item,"*.SA2*") && !stringmatch(item,"*.SA3*") ) 999 if( !stringmatch(item,".*") && !stringmatch(item,"*.pxp") && !stringmatch(item,"*.DIV")) //eliminate mac "hidden" files, pxp, and div files 1000 newlist += item + ";" 1001 endif 1002 endif 1003 endfor 1004 //remove VAX version numbers 1005 newList = RemoveVersNumsFromList(newList) 1006 //sort 1007 newList = SortList(newList,";",0) 1008 1009 return newlist 1010 End -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NSORT.ipf
r59 r70 759 759 SVAR popList = root:myGlobals:NSORT:gDataPopList 760 760 SVAR popList_3 = root:myGlobals:NSORT:gDataPopList_3 761 popList = filterButtonProc("")762 popList_3 = "none;" + filterButtonProc("")761 popList = ReducedDataFileList("") 762 popList_3 = "none;" + ReducedDataFileList("") 763 763 return(0) 764 764 endif … … 776 776 SVAR popList = root:myGlobals:NSORT:gDataPopList 777 777 SVAR popList_3 = root:myGlobals:NSORT:gDataPopList_3 778 popList = filterButtonProc("")779 popList_3 = "none;" + filterButtonProc("")778 popList = ReducedDataFileList("") 779 popList_3 = "none;" + ReducedDataFileList("") 780 780 781 781 return(0) … … 956 956 957 957 // If(checked) 958 String/G root:myGlobals:NSORT:gDataPopList = filterButtonProc("")958 String/G root:myGlobals:NSORT:gDataPopList = ReducedDataFileList("") 959 959 ControlUpdate popup_1 960 960 // Endif … … 977 977 978 978 // If(checked) 979 String/G root:myGlobals:NSORT:gDataPopList_3 = "none;" + filterButtonProc("")979 String/G root:myGlobals:NSORT:gDataPopList_3 = "none;" + ReducedDataFileList("") 980 980 ControlUpdate popup_2 981 981 if(cmpstr(popStr,"none")==0) … … 1006 1006 // If(checked) 1007 1007 //add the option "none" to the file list (which should already end with a semicolon) 1008 String/G root:myGlobals:NSORT:gDataPopList_3 = "none;" + filterButtonProc("")1008 String/G root:myGlobals:NSORT:gDataPopList_3 = "none;" + ReducedDataFileList("") 1009 1009 1010 1010 ControlUpdate popup_3 … … 1020 1020 End 1021 1021 1022 // function returning a string (list) of semicolon separated filenames1023 // that are not version numbers, and not raw data files1024 // (can't really pare out other files any better - trying to just get ascii I vs. q)1025 // works in folder specified by catPathName, (abort if it doesn't exist)1026 // 1027 // ***** UNUSED ******** - simpler fileFilter is used to simply filter out the raw data1028 // 1029 Function/S GetValidNSORTPopupList()1030 1031 String list = "none;something;"1032 1033 PathInfo catPathName1034 String path = S_path1035 if(V_flag == 0)1036 Abort "path does not exist - use Pick Path button"1037 Endif1038 1039 list = IndexedFile(catPathName,-1,"????") //get all files in folder1040 1041 //trim version numbers from list1042 Variable num = ItemsInList(list,";")1043 Variable ii,isRAW1044 String item = "",listCopy = "", fullName = "",partialName = ""1045 1046 ii=11047 do1048 item = num2str(ii)1049 list = RemoveFromList(item,list,";")1050 ii+=11051 while (ii<12)1052 1053 //trim raw data files from list1054 listCopy = list //scan through items in copy, change list1055 num = ItemsInList(listCopy,";") //get the new number of items in the list1056 ii=01057 do1058 //build valid fileName1059 item = StringFromList(ii,listCopy,";")1060 if (strlen(item) !=0 )1061 partialName = FindValidFileName(item)1062 if(strlen(partialName) !=0) //non-null return from FindValidFileName()1063 fullName = path + partialName1064 //check if RAW, if so, remove from list1065 isRAW = CheckIfRAWData(fullName)1066 if(isRAW)1067 list = RemoveFromList(item,list,";")1068 Endif1069 Endif1070 Endif1071 ii+=11072 While(ii<num)1073 1074 return list1075 End1022 ////function returning a string (list) of semicolon separated filenames 1023 ////that are not version numbers, and not raw data files 1024 ////(can't really pare out other files any better - trying to just get ascii I vs. q) 1025 ////works in folder specified by catPathName, (abort if it doesn't exist) 1026 //// 1027 ////***** UNUSED ******** - simpler fileFilter is used to simply filter out the raw data 1028 //// 1029 //Function/S GetValidNSORTPopupList() 1030 // 1031 // String list = "none;something;" 1032 // 1033 // PathInfo catPathName 1034 // String path = S_path 1035 // if(V_flag == 0) 1036 // Abort "path does not exist - use Pick Path button" 1037 // Endif 1038 // 1039 // list = IndexedFile(catPathName,-1,"????") //get all files in folder 1040 // 1041 // //trim version numbers from list 1042 // Variable num = ItemsInList(list,";") 1043 // Variable ii,isRAW 1044 // String item = "",listCopy = "", fullName = "",partialName = "" 1045 // 1046 // ii=1 1047 // do 1048 // item = num2str(ii) 1049 // list = RemoveFromList(item,list,";") 1050 // ii+=1 1051 // while (ii<12) 1052 // 1053 // //trim raw data files from list 1054 // listCopy = list //scan through items in copy, change list 1055 // num = ItemsInList(listCopy,";") //get the new number of items in the list 1056 // ii=0 1057 // do 1058 // //build valid fileName 1059 // item = StringFromList(ii,listCopy,";") 1060 // if (strlen(item) !=0 ) 1061 // partialName = FindValidFileName(item) 1062 // if(strlen(partialName) !=0) //non-null return from FindValidFileName() 1063 // fullName = path + partialName 1064 // //check if RAW, if so, remove from list 1065 // isRAW = CheckIfRAWData(fullName) 1066 // if(isRAW) 1067 // list = RemoveFromList(item,list,";") 1068 // Endif 1069 // Endif 1070 // Endif 1071 // ii+=1 1072 // While(ii<num) 1073 // 1074 // return list 1075 //End 1076 1076 1077 1077 //be sure to use the "Trim.." datasets that have had the bad points removed … … 1550 1550 End 1551 1551 1552 //function called byt the popups to get a file list of data that can be sorted 1553 // this procedure simply removes the raw data files from the string - there 1554 //can be lots of other junk present, but this is very fast... 1555 // 1556 // could also use the alternate procedure of keeping only file with the proper extension 1557 // 1558 // another possibility is to get a listing of the text files, but is unreliable on 1559 // Windows, where the data file must be .txt (and possibly OSX) 1560 // 1561 Function/S filterButtonProc(ctrlName) 1562 String ctrlName 1563 1564 String list="",newList="",item="" 1565 Variable num,ii 1566 1567 //check for the path 1568 PathInfo catPathName 1569 if(V_Flag==0) 1570 DoAlert 0, "Data path does not exist - pick the data path from the button on the main panel" 1571 Return("") 1572 Endif 1573 1574 list = IndexedFile(catpathName,-1,"????") 1575 num=ItemsInList(list,";") 1576 //print "num = ",num 1577 for(ii=(num-1);ii>=0;ii-=1) 1578 item = StringFromList(ii, list ,";") 1579 //simply remove all that are not raw data files (SA1 SA2 SA3) 1580 if( !stringmatch(item,"*.SA1*") && !stringmatch(item,"*.SA2*") && !stringmatch(item,"*.SA3*") ) 1581 if( !stringmatch(item,".*") && !stringmatch(item,"*.pxp") && !stringmatch(item,"*.DIV")) //eliminate mac "hidden" files, pxp, and div files 1582 newlist += item + ";" 1583 endif 1584 endif 1585 endfor 1586 //remove VAX version numbers 1587 newList = RemoveVersNumsFromList(newList) 1588 //sort 1589 newList = SortList(newList,";",0) 1590 1591 return newlist 1592 End 1552 1593 1553 1594 1554 ///////////////////////////////////////////////////////////// … … 1799 1759 1800 1760 lastPoint = numpnts(GLambda) 1801 1802 Open/R refNum as fname 1803 1761 1804 1762 InsertPoints lastPoint,1,GFilenames 1805 1763 GFilenames[lastPoint]=sname 1806 1764 1807 1765 //read the file suffix 1808 FSetPos refNum,191809 FReadLine/N=4 refNum,suffix1810 1766 InsertPoints lastPoint,1,GSuffix 1811 GSuffix[lastPoint]= suffix1767 GSuffix[lastPoint]=getSuffix(fname) 1812 1768 1813 1769 // read the sample.label text field 1814 FSetPos refNum,98 //will start reading at byte 991815 FReadLine/N=60 refNum,lbl1816 1770 InsertPoints lastPoint,1,GLabels 1817 GLabels[lastPoint]=lbl 1818 1819 Close refNum 1820 1821 //read the reals with GBLoadWave 1822 String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 1823 String strToExecute 1824 1825 //SDD 1826 strToExecute = GBLoadStr + "/S=260/U=1" + "\"" + fname + "\"" 1827 Execute strToExecute 1828 Wave w=$"tempGBWave0" 1829 sdd = w[0] 1771 GLabels[lastPoint]=getSampleLabel(fname) 1772 1773 //read in the SDD 1830 1774 InsertPoints lastPoint,1,GSDD 1831 GSDD[lastPoint]= sdd1775 GSDD[lastPoint]= getSDD(fname) 1832 1776 1833 1777 //the run number (not displayed in the table, but carried along) -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/PlotUtils.ipf
r41 r70 663 663 Endif 664 664 665 String list=IndexedFile(catPathName,-1,"????") 666 String newList="",item="" 667 Variable num=ItemsInList(list,";"),ii 668 newList = list 669 for(ii=0;ii<num;ii+=1) 670 item = StringFromList(ii, list ,";") 671 if( stringmatch(item,"*.sa1*") ) 672 newlist = RemoveFromList(item,newlist,";") 673 endif 674 if( stringmatch(item,"*.sa2*") ) 675 newlist = RemoveFromList(item,newlist,";") 676 endif 677 if( stringmatch(item,"*.sa3*") ) 678 newlist = RemoveFromList(item,newlist,";") 679 endif 680 if( stringmatch(item,".*") ) //remove "hidden" files starting with "." 681 newlist = RemoveFromList(item,newlist,";") 682 endif 683 //print "ii=",ii 684 endfor 685 newList = SortList(newList,";",0) 665 String newList = ReducedDataFileList("") 666 Variable num 667 686 668 num=ItemsInList(newlist,";") 687 669 WAVE/T fileWave=$"root:myGlobals:OneDLoader:fileWave" -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/Schematic.ipf
r41 r70 107 107 //attenuators used in sample measurement 108 108 109 text23 = "SAM Attenuator = "+ num2str($"root:SAM:RealsRead"[3])109 text23 = "SAM Attenuator = "+GetAttenNum("SAM") 110 110 111 111 text11 = "Final 1-D Dataset" … … 438 438 //attenuators used in sample measurement 439 439 440 text23 = "SAM Attenuator = "+ num2str($"root:SAM:RealsRead"[3])440 text23 = "SAM Attenuator = "+GetAttenNum("SAM") 441 441 442 442 text11 = "Final 1-D Dataset" … … 617 617 618 618 End 619 620 621 //returns a string containg the transmision stored in the file that is 622 //currently in the "type" folder (not from the binary header) 623 //returns "none" if the value (in RealsRead) cannot be found 624 // 625 Function/S GetTrans(type) 626 String type 627 628 String name="root:"+type+":realsread" 629 WAVE reals = $name 630 if(waveExists(reals)) 631 return(num2str(reals[4])) 632 else 633 return("none") 634 endif 635 End 636 637 //returns a string containg the sample thickness stored in the file that is 638 //currently in the "type" folder (not from the binary header) 639 //returns "none" if the value (in RealsRead) cannot be found 640 // 641 Function/S GetThick(type) 642 String type 643 644 String name="root:"+type+":realsread" 645 WAVE reals = $name 646 if(waveExists(reals)) 647 return(num2str(reals[5])) 648 else 649 return("none") 650 endif 651 End 652 653 //returns a string containg the sample thickness stored in the file that is 654 //currently in the "type" folder (not from the binary header) 655 //returns "none" if the value (in RealsRead) cannot be found 656 // 657 Function/S GetAttenNum(type) 658 String type 659 660 String name="root:"+type+":realsread" 661 WAVE reals = $name 662 if(waveExists(reals)) 663 return(num2str(reals[3])) 664 else 665 return("none") 666 endif 667 End -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/Transmission.ipf
r69 r70 1195 1195 // For the calculation of the Transmission using only the whole detector 1196 1196 // Used to compute the transmission for the TransmissionFiles table using 1197 // the entire computer. For comparison with the "box" trans1198 // updated: 5/11/2006 b oBryan Greenwald1197 // the entire detector. For comparison with the "box" trans 1198 // updated: 5/11/2006 by Bryan Greenwald 1199 1199 Function CalcWholeTrans(startRow,endRow) 1200 1200 Variable startRow,endRow 1201 1201 // GetSelection table,ScatterFileTable,1 1202 1202 1203 NVAR pixelsX = root:myGlobals:gNPixelsX 1204 NVAR pixelsY = root:myGlobals:gNPixelsY 1205 1203 1206 String filename 1204 1207 Wave/T T_EMP_Filenames = $"root:myGlobals:TransHeaderInfo:T_EMP_Filenames" … … 1269 1272 err = Raw_to_work("SAM") 1270 1273 //sum region in SAM 1271 transCts = Sum TotalCounts("SAM")1274 transCts = SumCountsInBox(0,pixelsX-1,0,pixelsY-1,"SAM") 1272 1275 // get the attenuator, lambda, and sample string (to get the instrument) 1273 1276 WAVE/T samText = $"root:SAM:textRead" … … 1610 1613 End 1611 1614 1612 // b BGtoFix -comment to describe the workings of the function1613 // since it's different than calculating the regular transmission1614 1615 // 1615 1616 // I am not sure what the difference is inthe function of CalcTotalTrans and CalcWholeTrans ? 1616 1617 // do they really do anything different? 1618 // is it a useful calculation at all? 1617 1619 // 1618 1620 Function TotalTrans(ctrlName) : ButtonControl … … 1620 1622 1621 1623 Variable transTableExists 1622 transTableExists = WinType(" ScatterFileTable") // b BGtoFix -checking for the existence of the wrong table1624 transTableExists = WinType("TransFileTable") 1623 1625 if (transTableExists != 0) 1624 1626 GetSelection table,transFileTable,1 … … 1629 1631 CalcWholeTrans(V_StartRow,V_EndRow) 1630 1632 Else 1631 DoAlert 0,"No selection from Scattering Files table" // b BGtoFix - really looking for files from the Trans Table...1633 DoAlert 0,"No selection from Trans Files table" 1632 1634 Endif 1633 1635 Else 1634 DoAlert 0,"No file selected from Scattering Files table or no Scattering Files table available" // b BGtoFix - really looking for files from the Trans Table...1636 DoAlert 0,"No file selected from Trans Files table or no Trans Files table available" 1635 1637 Endif 1636 1638 End
Note: See TracChangeset
for help on using the changeset viewer.