#pragma rtGlobals=1 // Use modern global access method. #pragma version=5.0 #pragma IgorVersion=6.1 // // SRK modified 30 JAN07 to include Rotation angle, Temperature, and B-field in the table (at the end) // //************** // Vers 1.2 090401 // // Procedures for creating the Catalog listings of the SANS datafiles in the folder // specified by catPathName. // Header information from each of the dataifles is organized in a table for // easy identification of each file. CatVSTable is the preferred invocation, // although CatVSNotebook and CatNotebook can also be used. // Files in the folder that are not RAW SANS data are appended to the end of the listing. //************** //this main procedure does all the work, obtaining the folder path, //parsing the filenames in the list and (dispatching) to write out the //appropriate information to the notebook window Proc BuildCatVeryShortTable() Variable err PathInfo catPathName if(v_flag==0) err = PickPath() //sets the local path to the data (catPathName) if(err) Abort "no path to data was selected, no catalog can be made - use PickPath button" Endif Endif DoWindow/F CatVSTable Make/O/T/N=0 $"root:myGlobals:CatVSHeaderInfo:Filenames" Make/O/T/N=0 $"root:myGlobals:CatVSHeaderInfo:Suffix" Make/O/T/N=0 $"root:myGlobals:CatVSHeaderInfo:Labels" Make/O/T/N=0 $"root:myGlobals:CatVSHeaderInfo:DateAndTime" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:SDD" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Lambda" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:CntTime" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:TotCnts" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:CntRate" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Transmission" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Thickness" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:XCenter" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:YCenter" //Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:NumGuides" Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:NumAttens" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:RunNumber" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:IsTrans" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:RotAngle" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Temperature" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Field" Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:MCR" //added Mar 2008 // Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower" //activate for ILL, June 2008 If(V_Flag==0) BuildTableWindow() ModifyTable width(:myGlobals:CatVSHeaderInfo:SDD)=40 ModifyTable width(:myGlobals:CatVSHeaderInfo:Lambda)=40 ModifyTable width(:myGlobals:CatVSHeaderInfo:CntTime)=50 ModifyTable width(:myGlobals:CatVSHeaderInfo:TotCnts)=60 ModifyTable width(:myGlobals:CatVSHeaderInfo:CntRate)=60 ModifyTable width(:myGlobals:CatVSHeaderInfo:Transmission)=40 ModifyTable width(:myGlobals:CatVSHeaderInfo:Thickness)=40 ModifyTable width(:myGlobals:CatVSHeaderInfo:XCenter)=40 ModifyTable width(:myGlobals:CatVSHeaderInfo:YCenter)=40 ModifyTable width(:myGlobals:CatVSHeaderInfo:NumAttens)=30 ModifyTable width(:myGlobals:CatVSHeaderInfo:RotAngle)=50 ModifyTable width(:myGlobals:CatVSHeaderInfo:Field)=50 ModifyTable width(:myGlobals:CatVSHeaderInfo:MCR)=50 // ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50 //activate for ILL, June 2008 ModifyTable width(Point)=0 //JUN04, remove point numbers - confuses users since point != run Endif //get a list of all files in the folder, some will be junk version numbers that don't exist String list,partialName,tempName,temp="" list = IndexedFile(catPathName,-1,"????") //get all files in folder Variable numitems,ii,ok //remove version numbers from semicolon-delimited list list = RemoveVersNumsFromList(list) numitems = ItemsInList(list,";") //loop through all of the files in the list, reading CAT/SHORT information if the file is RAW SANS //***version numbers have been removed*** String str,fullName Variable lastPoint ii=0 Make/T/O/N=0 notRAWlist do //get current item in the list partialName = StringFromList(ii, list, ";") //get a valid file based on this partialName and catPathName tempName = FindValidFilename(partialName) If(cmpstr(tempName,"")==0) //a null string was returned //write to notebook that file was not found //if string is not a number, report the error if(str2num(partialName) == NaN) str = "this file was not found: "+partialName+"\r\r" //Notebook CatWin,font="Times",fsize=12,text=str Endif else //prepend path to tempName for read routine PathInfo catPathName FullName = S_path + tempName //make sure the file is really a RAW data file ok = CheckIfRawData(fullName) if (!ok) //write to notebook that file was not a RAW SANS file lastPoint = numpnts(notRAWlist) InsertPoints lastPoint,1,notRAWlist notRAWlist[lastPoint]=tempname else //go write the header information to the Notebook GetHeaderInfoToWave(fullName,tempName) Endif Endif ii+=1 while(ii