Changeset 70 for sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NSORT.ipf
- Timestamp:
- Mar 29, 2007 4:02:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.