Changeset 945 for sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Timestamp:
- Jul 3, 2014 10:16:55 AM (9 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r940 r945 1989 1989 End 1990 1990 1991 Function/S GetASCDataFileList() 1992 1993 //make sure that path exists 1994 PathInfo catPathName 1995 if (V_flag == 0) 1996 Abort "Folder path does not exist - use Pick Path button on Main Panel" 1997 Endif 1998 1999 String list=IndexedFile(catPathName,-1,"????") 2000 String newList="",item="" 2001 Variable num=ItemsInList(list,";"),ii 2002 for(ii=0;ii<num;ii+=1) 2003 item = StringFromList(ii, list ,";") 2004 if(stringmatch(item,"*.ASC") ) 2005 newlist += item + ";" 2006 endif 2007 endfor 2008 2009 newList = SortList(newList,";",0) 2010 return(newList) 2011 End 2012 2013 2014 1991 2015 // Return the filename that represents the previous or next file. 1992 2016 // Input is current filename and increment. -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Tile_2D.ipf
r916 r945 47 47 Proc Tile_2D() 48 48 PauseUpdate; Silent 1 // building window... 49 NewPanel /W=(849,337,1248,5 53) /K=249 NewPanel /W=(849,337,1248,573) /K=2 50 50 DoWindow/C Tile_2D 51 51 52 ListBox fileList,pos={5,4},size={206,2 06}52 ListBox fileList,pos={5,4},size={206,226} 53 53 ListBox fileList,listWave=root:myGlobals:Tile_2D:fileWave 54 54 ListBox fileList,selWave=root:myGlobals:Tile_2D:selWave,mode= 4 55 Button button0,pos={217,1 31},size={170,20},proc=AddToLayoutButtonProc,title="Add Selected To Layout"55 Button button0,pos={217,161},size={170,20},proc=AddToLayoutButtonProc,title="Add Selected To Layout" 56 56 Button button0,help={"Adds images of the selected files to the layout selected in the popup menu"} 57 Button button1,pos={316, 182},size={50,20},proc=TileDoneButtonProc,title="Done"57 Button button1,pos={316,207},size={50,20},proc=TileDoneButtonProc,title="Done" 58 58 Button button1,help={"Closes the panel, kills the layouts, and kills images from your memory"} 59 59 Button button3,pos={227,6},size={60,20},proc=GetListButtonProc,title="Get List" … … 61 61 Button button4,pos={340,6},size={25,20},proc=ShowTileHelp,title="?" 62 62 Button button4,help={"Show help file for tiling raw data files in a layout"} 63 Button button5,pos={217,1 55},size={170,20},proc=AddAllToLayout,title="Add All To Layout"63 Button button5,pos={217,185},size={170,20},proc=AddAllToLayout,title="Add All To Layout" 64 64 Button button5,help={"Adds images of all raw files, 40 per layout"} 65 CheckBox check0,pos={216, 64},size={71,14},title="Log scaling"65 CheckBox check0,pos={216,94},size={71,14},title="Log scaling" 66 66 CheckBox check0,help={"If checked, the image color will be log scale"},value= 1 67 67 PopupMenu popup0,pos={226,38},size={141,20},title="Layout ?" 68 68 PopupMenu popup0,help={"Sets a new or existing layout as the destination when adding images"} 69 69 PopupMenu popup0,mode=1,popvalue="New Layout",value= #"\"New Layout;\"+WinList(\"*\", \";\",\"WIN:4\")" 70 CheckBox check1,pos={216,86},size={72,14},proc=FixScale_CheckProc,title="Fixed Scale" 70 PopupMenu popup1,pos={226,64},size={141,20},title="Data Type?" 71 PopupMenu popup1,help={"Choose what data type you want ot tile."} 72 PopupMenu popup1,mode=1,popvalue="RAW",value= "RAW;ASC" 73 CheckBox check1,pos={216,116},size={72,14},proc=FixScale_CheckProc,title="Fixed Scale" 71 74 CheckBox check1,value= 0,help={"Sets a fixed z-scale (counts) for all images in the layout. Enter the min and max values"} 72 SetVariable scale_0,pos={216,1 05},size={80,15},title="min"75 SetVariable scale_0,pos={216,140},size={80,15},title="min" 73 76 SetVariable scale_0,limits={-Inf,Inf,0},value= root:myGlobals:Tile_2D:minScale 74 77 SetVariable scale_0,help={"Minimum mapped count value"},disable=1 //initially not visible 75 SetVariable scale_1,pos={300,1 05},size={80,15},title="max"78 SetVariable scale_1,pos={300,140},size={80,15},title="max" 76 79 SetVariable scale_1,limits={-Inf,Inf,0},value=root:myGlobals:Tile_2D:maxScale 77 80 SetVariable scale_1,help={"Maximum mapped count value"},disable=1 //initially not visible … … 106 109 ControlInfo popup0 107 110 String layoutStr=S_Value //create new layout or append to old one 111 112 ControlInfo/W=Tile_2D popup1 113 String DataStr=S_Value //create new layout or append to old one 108 114 109 115 ControlInfo check0 … … 150 156 151 157 do 158 fname=pathStr + FindValidFilename(fileWave[ii]) //in case of VAX version numbers 159 152 160 if(sel[ii] == 1) 153 fname=pathStr + FindValidFilename(fileWave[ii]) //in case of VAX version numbers 154 ReadHeaderAndData(fname) //fname is the full path 155 String/G root:myGlobals:gDataDisplayType="RAW" 156 fRawWindowHook() 157 if(makeLog) 158 err = ConvertFolderToLogScale("RAW") 161 if(stringmatch(fname, "*.ASC")) 162 NewDataFolder/O root:Packages:NIST:ASC 163 Load_NamedASC_File(fname, "ASC") 164 if(makeLog) 165 err = ConvertFolderToLogScale("ASC") 166 endif 167 MakePNGforLayout(minScale,maxScale,"ASC",ind) 168 ind+=1 //a running count of all of the PNG's 169 else 170 ReadHeaderAndData(fname) //fname is the full path 171 String/G root:myGlobals:gDataDisplayType="RAW" 172 fRawWindowHook() 173 if(makeLog) 174 err = ConvertFolderToLogScale("RAW") 175 endif 176 MakePNGforLayout(minScale,maxScale,"RAW",ind) 177 ind+=1 //a running count of all of the PNG's 159 178 endif 160 MakePNGforLayout(minScale,maxScale,"RAW",ind)161 ind+=1 //a running count of all of the PNG's162 179 endif 180 181 163 182 ii+=1 164 183 while(ii<num) … … 174 193 endif 175 194 for(ii=startInd;ii<ind;ii+=1) 176 AppendLayoutObject/F=1/R=(72,40,144,112) picture $( "RAW"+num2str(ii)+"L_PNG")195 AppendLayoutObject/F=1/R=(72,40,144,112) picture $(DataStr+num2str(ii)+"L_PNG") 177 196 // ModifyLayout top($("RAW"+num2str(ii)+"L_PNG"))=(40+mod(30*ii,560)) //separate the graphics (in points) 178 197 // ModifyLayout/I width($("RAW"+num2str(ii)+"L_PNG"))=(wd),height($("RAW"+num2str(ii)+"L_PNG"))=(wd) //(in inches) … … 206 225 // 207 226 for(ii=startInd;ii<ind;ii+=1) 208 ModifyLayout/I width($( "RAW"+num2str(ii)+"L_PNG"))=(wd),height($("RAW"+num2str(ii)+"L_PNG"))=(wd) //(in inches)227 ModifyLayout/I width($(DataStr+num2str(ii)+"L_PNG"))=(wd),height($(DataStr+num2str(ii)+"L_PNG"))=(wd) //(in inches) 209 228 endfor 210 229 … … 234 253 ControlInfo/W=Tile_2D popup0 235 254 String layoutStr=S_Value //create new layout or append to old one 255 256 ControlInfo/W=Tile_2D popup1 257 String DataStr=S_Value //create new layout or append to old one 236 258 237 259 ControlInfo/W=Tile_2D check0 … … 284 306 do 285 307 fname=pathStr + FindValidFilename(fileWave[ii]) //in case of VAX version numbers 286 ReadHeaderAndData(fname) //fname is the full path 287 String/G root:myGlobals:gDataDisplayType="RAW" 288 fRawWindowHook() 289 if(makeLog) 290 err = ConvertFolderToLogScale("RAW") 308 309 310 //Modified for summer student 2014 by mjw 311 //Original is follows 312 // 313 //ReadHeaderAndData(fname) //fname is the full path 314 //String/G root:myGlobals:gDataDisplayType="RAW" 315 //fRawWindowHook() 316 //if(makeLog) 317 // err = ConvertFolderToLogScale("RAW") 318 //endif 319 //MakePNGforLayout(minScale,maxScale,"RAW",ind) 320 //ind+=1 //a running count of all of the PNG's 321 // 322 323 if(stringmatch(fname, "*.ASC")) 324 NewDataFolder/O root:Packages:NIST:ASC 325 Load_NamedASC_File(fname, "ASC") 326 if(makeLog) 327 err = ConvertFolderToLogScale("ASC") 328 endif 329 MakePNGforLayout(minScale,maxScale,"ASC",ind) 330 ind+=1 //a running count of all of the PNG's 331 else 332 ReadHeaderAndData(fname) //fname is the full path 333 String/G root:myGlobals:gDataDisplayType="RAW" 334 fRawWindowHook() 335 if(makeLog) 336 err = ConvertFolderToLogScale("RAW") 337 endif 338 MakePNGforLayout(minScale,maxScale,"RAW",ind) 339 ind+=1 //a running count of all of the PNG's 291 340 endif 292 MakePNGforLayout(minScale,maxScale,"RAW",ind) 293 ind+=1 //a running count of all of the PNG's 294 341 //End Modification 342 295 343 ii+=1 296 344 while(ii<num) … … 330 378 endif 331 379 332 333 334 380 NewLayout 335 381 DoWindow/C $("PNGLayout"+num2str(startInd)) … … 337 383 jj=ii 338 384 do 339 AppendLayoutObject/F=1/R=(72,40,144,112) picture $( "RAW"+num2str(jj)+"L_PNG")340 ModifyLayout/I width($( "RAW"+num2str(jj)+"L_PNG"))=(wd),height($("RAW"+num2str(ii)+"L_PNG"))=(wd) //(in inches)385 AppendLayoutObject/F=1/R=(72,40,144,112) picture $(DataStr+num2str(jj)+"L_PNG") 386 ModifyLayout/I width($(DataStr+num2str(jj)+"L_PNG"))=(wd),height($(DataStr+num2str(ii)+"L_PNG"))=(wd) //(in inches) 341 387 jj+=1 342 388 while( (jj<ii+numPerLayout) && (jj<ind) ) //index in batch, keep from running over total number of PNGs … … 344 390 //now make them square 345 391 for(kk=ii;kk<jj;kk+=1) 346 ModifyLayout/I width($( "RAW"+num2str(kk)+"L_PNG"))=(wd),height($("RAW"+num2str(kk)+"L_PNG"))=(wd) //(in inches)392 ModifyLayout/I width($(DataStr+num2str(kk)+"L_PNG"))=(wd),height($(DataStr+num2str(kk)+"L_PNG"))=(wd) //(in inches) 347 393 endfor 348 394 … … 375 421 Variable num 376 422 377 newList = GetRawDataFileList() 423 ControlInfo/W=Tile_2D popup1 424 String DataStr=S_Value //create new layout or append to old one 425 426 427 if(stringmatch(DataStr,"RAW")) 428 newList = GetRawDataFileList() 429 endif 430 if(stringmatch(DataStr,"ASC")) 431 newList = GetASCDataFileList() 432 endif 378 433 379 434 num=ItemsInList(newlist,";")
Note: See TracChangeset
for help on using the changeset viewer.