- Timestamp:
- Mar 16, 2010 5:50:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/HFIR_DataReadWrite.ipf
r572 r641 50 50 Endif 51 51 52 Variable t1=ticks 52 53 53 54 variable error … … 89 90 KillWaves/Z M_listAttr, nsList,W_xmlcontentnodes 90 91 92 Print "Time to load and display (s) = ",(ticks-t1)/60.15 91 93 Return(0) //Do not change. 92 94 End … … 127 129 //Open/R refNum as fname 128 130 STRING/G errorMsg 129 Variable refNum 131 Variable refNum,t1=ticks 130 132 //print "Loading", filename, "..." 131 133 if (stringmatch(filename,"*.xml") <1) … … 216 218 //data =0 217 219 220 // Print "Time to open (s) = ",(ticks-t1)/60.15 218 221 219 222 //ORNL HFIR SANS DATA 220 223 String tempheadhfir 221 224 tempheadhfir = "" 222 ReadHFIRSansRaw(refNum,curFolder,tempheadhfir) 225 226 ReadHFIRSansRaw(refNum,curFolder,tempheadhfir) 223 227 224 225 226 227 228 229 230 231 232 233 228 i=0 229 do 230 //Take the file name from "actual file name", not from the header: (JC found some cases that those are different.) 231 //This DOLOOP can be removed where the problem is solved.... 232 textw[0]=stringfromlist(i,filename,":") 233 if (stringmatch(textw[0],"*.xml")>0) 234 break 235 endif 236 i +=1 237 while (1) 234 238 235 239 //return the data folder to root … … 605 609 return 0 //Not a xml file. Do nothing... 606 610 endif 607 611 608 612 //ORNL HFIR SANS strings meta DATA 609 613 vresult=ReadVFromHHead(refNum,wantedterm,unit) 610 614 611 615 //return the data folder to root 612 616 //SetDataFolder root: … … 641 645 String fname 642 646 643 return(getRealValueFromHeader(fname,"attenuation","percent")) //in unit o dpercents647 return(getRealValueFromHeader(fname,"attenuation","percent")) //in unit of percents 644 648 end 645 649 … … 989 993 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 990 994 Function ReadHFIRSansRaw(refNum,curFolder,tempheadhfir) 991 992 995 Variable refNum 996 String curFolder,tempheadhfir 993 997 994 995 998 String curPath="root:Packages:NIST:"+curFolder 999 SetDataFolder curPath 996 1000 Make/O/N=23 $(curPath+":IntegersRead") 997 1001 Make/O/N=52 $(curPath+":RealsRead") … … 1005 1009 Variable pixnumx=0,pixnumy=0 1006 1010 String val = ""// numerical and text values 1007 Variable value 1011 Variable value,t1=ticks 1008 1012 1009 1013 //Initialize wave values … … 1043 1047 endfor 1044 1048 //endif 1045 1049 // Print "Time to list attributes (s) = ",(ticks-t1)/60.15 1046 1050 1047 1051 XMLelemlist(refNum) 1048 1052 WAVE/T W_ElementList 1053 // Print "Time to list elements (s) = ",(ticks-t1)/60.15 1049 1054 1050 1055 for (ind = 0; ind<DimSize(W_ElementList,0); ind +=1) … … 1179 1184 1180 1185 endfor 1181 1186 1187 // Print "Time to loop over elements (s) = ",(ticks-t1)/60.15 1188 1189 //If the data is a sensitivity scan, normalize so that the average =1. 1190 print curFolder 1191 if (stringmatch(curFolder,"DIV") >0) 1192 WaveStats/Z/Q data 1193 data /= V_avg 1194 endif 1182 1195 //keep a string with the filename in the RAW folder 1183 1196 … … 1213 1226 1214 1227 SetDataFolder curPath 1215 Killwaves/Z nsList,M_listAttr,M_xmlContent,W_ElementList,M_listXPath,W_xmlcontentnodes 1228 1229 // Print "Time to exit reader (s) = ",(ticks-t1)/60.15 1230 1231 // Killwaves/Z nsList,M_listAttr,M_xmlContent,W_ElementList,M_listXPath,W_xmlcontentnodes 1232 return(0) 1233 1216 1234 End 1217 1235
Note: See TracChangeset
for help on using the changeset viewer.