Changeset 303
- Timestamp:
- Mar 28, 2008 4:03:47 PM (15 years ago)
- Location:
- sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.10
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.10/MaskUtils.ipf
r260 r303 491 491 Variable refnum,ii=0,jj=0,dummy,num=pixelsX 492 492 String fullpath="" 493 Open/D refnum as fullpath //won't actually open the file 494 If(cmpstr(S_filename,"")==0) 493 494 PathInfo/S catPathName 495 fullPath = DoSaveFileDialog("Save data as") //won't actually open the file 496 If(cmpstr(fullPath,"")==0) 495 497 //user cancel, don't write out a file 496 498 Close/A 497 499 Abort "no data file was written" 498 500 Endif 499 fullpath = S_filename500 501 501 502 Make /B/O/N=(pixelsX) byteWave -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.10/NSORT.ipf
r260 r303 235 235 Variable dialog = 1 236 236 if(dialog) 237 Open/D refnum as fullpath //won't actually open the file 238 If(cmpstr(S_filename,"")==0) 237 PathInfo/S catPathName 238 fullPath = DoSaveFileDialog("Save data as") //won't actually open the file 239 If(cmpstr(fullPath,"")==0) 239 240 //user cancel, don't write out a file 240 241 Close/A 241 242 Abort "no data file was written" 242 243 Endif 243 fullpath = S_filename244 244 //Print "dialog fullpath = ",fullpath 245 245 Endif 246 247 // read in the header information from each of the combined files and put this information in the file header 248 String dum,hdr1="none\r\n",hdr2="none\r\n",hdr3="none\r\n" 249 PathInfo catPathName 250 251 // the first file exists, check anyways 252 if(cmpstr(firstFileName,"none") !=0) 253 Open/R refNum as S_Path+firstFileName 254 FReadLine refNum, dum 255 FReadLine refNum, hdr1 //just grab the second line 256 Close refNum 257 endif 258 //second file 259 if(cmpstr(secondFileName,"none") !=0) 260 Open/R refNum as S_Path+secondFileName 261 FReadLine refNum, dum 262 FReadLine refNum, hdr2 //just grab the second line 263 Close refNum 264 endif 265 // third file 266 if(cmpstr(thirdFileName,"none") !=0) 267 Open/R refNum as S_Path+thirdFileName 268 FReadLine refNum, dum 269 FReadLine refNum, hdr3 //just grab the second line 270 Close refNum 271 endif 246 272 247 273 String formatStr = "%15.4g %15.4g %15.4g\r\n" … … 249 275 Open refNum as fullpath 250 276 251 fprintf refnum,"FILE CREATED: %s \r\n",date() 277 fprintf refnum, "COMBINED FILE CREATED: %s \r\n",date() 278 279 fprintf refnum, "FIRST File %s",hdr1 //new, Mar 2008 280 fprintf refnum, "SECOND File %s",hdr2 //new, Mar 2008 281 fprintf refnum, "THIRD File %s",hdr3 //new, Mar 2008 282 252 283 fprintf refNum, "NSORT-ed %s \t + %s\t + %s\r\n",firstFileName, secondFileName,thirdFileName 253 284 fprintf refNum, "normalized to %s\r\n",normTo 254 285 fprintf refNum, "multiplicative factor 1-2 = %12.8g\t multiplicative factor 2-3 = %12.8g\r\n",norm12,norm23 255 fprintf refnum, "The 3 columns are | Q (1/A) | I(Q) (1/cm) | std. dev. I(Q) (1/cm) |\r\n"286 fprintf refnum, "The 3 columns are | Q (1/A) | I(Q) (1/cm) | std. dev. I(Q) (1/cm) |\r\n" 256 287 wfprintf refnum, formatStr, q3,i3,sig3 257 288 … … 319 350 320 351 if(dialog) 321 Open/D refnum as fullpath //won't actually open the file 322 If(cmpstr(S_filename,"")==0) 352 PathInfo/S catPathName 353 fullPath = DoSaveFileDialog("Save data as") //won't actually open the file 354 If(cmpstr(fullPath,"")==0) 323 355 //user cancel, don't write out a file 324 356 Close/A 325 357 Abort "no data file was written" 326 358 Endif 327 fullpath = S_filename328 359 //Print "dialog fullpath = ",fullpath 329 360 Endif 361 362 // read in the header information from each of the combined files and put this information in the file header 363 String dum,hdr1="none\r\n",hdr2="none\r\n",hdr3="none\r\n" 364 PathInfo catPathName 365 366 // the first file exists, check anyways 367 if(cmpstr(firstFileName,"none") !=0) 368 Open/R refNum as S_Path+firstFileName 369 FReadLine refNum, dum 370 FReadLine refNum, hdr1 //just grab the second line 371 Close refNum 372 endif 373 //second file 374 if(cmpstr(secondFileName,"none") !=0) 375 Open/R refNum as S_Path+secondFileName 376 FReadLine refNum, dum 377 FReadLine refNum, hdr2 //just grab the second line 378 Close refNum 379 endif 380 // third file 381 if(cmpstr(thirdFileName,"none") !=0) 382 Open/R refNum as S_Path+thirdFileName 383 FReadLine refNum, dum 384 FReadLine refNum, hdr3 //just grab the second line 385 Close refNum 386 endif 387 330 388 331 389 String formatStr = "%15.4g %15.4g %15.4g %15.4g %15.4g %15.4g\r\n" … … 333 391 Open refNum as fullpath 334 392 335 fprintf refnum,"FILE CREATED: %s \r\n",date() 393 fprintf refnum, "COMBINED FILE CREATED: %s \r\n",date() 394 395 fprintf refnum, "FIRST File %s",hdr1 //new, Mar 2008 396 fprintf refnum, "SECOND File %s",hdr2 //new, Mar 2008 397 fprintf refnum, "THIRD File %s",hdr3 //new, Mar 2008 398 336 399 fprintf refNum, "NSORT-ed %s \t + %s\t + %s\r\n",firstFileName, secondFileName,thirdFileName 337 400 fprintf refNum, "normalized to %s\r\n",normTo 338 401 fprintf refNum, "multiplicative factor 1-2 = %12.8g\t multiplicative factor 2-3 = %12.8g\r\n",norm12,norm23 339 fprintf refnum, "The 6 columns are | Q (1/A) | I(Q) (1/cm) | std. dev. I(Q) (1/cm) | sigmaQ | meanQ | ShadowFactor|\r\n"402 fprintf refnum, "The 6 columns are | Q (1/A) | I(Q) (1/cm) | std. dev. I(Q) (1/cm) | sigmaQ | meanQ | ShadowFactor|\r\n" 340 403 wfprintf refnum, formatStr, q3,i3,sig3,sq3,qb3,fs3 341 404 … … 628 691 // Put here the dialog that says if ANY of the datasets had 3-column data, the results will all have only three columns 629 692 // Set the number of output columns 630 Variable isAThree = 0, isASix = 0 631 String fileStr="" 693 Variable isAThree = 0, isASix = 0,err 694 String fileStr="",tempName 632 695 633 696 NVAR Columns1 = root:myGlobals:NSORT:gColumns1 … … 645 708 646 709 //is there just one data set? if so, then dispatch to a simpler routine, since no normalization is needed 647 ControlInfo popup_2 //if MedQSet is "none", then so is HighQSet710 ControlInfo/W=NSORT_Panel popup_2 //if MedQSet is "none", then so is HighQSet 648 711 fileStr = S_Value 649 712 if(cmpstr(fileStr,"none") == 0) 713 // just like in the rescaling routines, always RELOAD the data !!! 714 //load file1 715 ControlInfo/W=NSORT_Panel popup_1 716 fileStr = S_Value 717 //get a valid file based on this partialName and catPathName 718 tempName = FindValidFilename(fileStr) 719 720 //prepend path to tempName for read routine 721 PathInfo catPathName 722 tempName = S_path + tempName 723 err = LoadDataForNSORT(tempName,1) 724 //////end load file1 725 650 726 //send just the trimmed (LowQ) set to be written out 651 727 WAVE lowq = $"TrimLowQSet_q" 652 728 WAVE lowi = $"TrimLowQSet_i" 653 729 WAVE lows = $"TrimLowQSet_s" 654 WAVE/Z lowsq = $"TrimLowQSet_sq" 730 WAVE/Z lowsq = $"TrimLowQSet_sq" //these may not exist 655 731 WAVE/Z lowqb = $"TrimLowQSet_qb" 656 732 WAVE/Z lowfs = $"TrimLowQSet_fs" 657 733 NVAR scaleFactor= root:myGlobals:NSORT:gScale1_2 734 658 735 // 659 736 lowi *= scaleFactor 660 737 lows *= scaleFactor 661 738 662 ControlInfo popup_1 739 ControlInfo/W=NSORT_Panel PreviewCheck 740 if( V_Value==1 ) //if ==1, just preview and exit 741 return(0) 742 endif 743 744 ControlInfo/W=NSORT_Panel popup_1 663 745 if(isAThree) 664 746 Write3ColNSORTedFile(lowq,lowi,lows,S_Value,"none","none",S_Value,scaleFactor,1) … … 681 763 682 764 //do the normalization and update the global scale factors displayed in the Panel 683 Variableerr = DoAutoScaleFromPanel(checked) // DoAutoScaleFromPanel writes out the datafile765 err = DoAutoScaleFromPanel(checked) // DoAutoScaleFromPanel writes out the datafile 684 766 685 767 // just get the new list - don't actually "pop" the menu, or the selected item will change -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.10/ProDiv.ipf
r260 r303 45 45 tempData *= 4 46 46 47 Open/D refnum as fullpath //won't actually open the file 48 If(cmpstr(S_filename,"")==0) 47 PathInfo/S catPathName 48 fullPath = DoSaveFileDialog("Save data as") //won't actually open the file 49 If(cmpstr(fullPath,"")==0) 49 50 //user cancel, don't write out a file 50 51 Close/A 51 52 Abort "no data file was written" 52 53 Endif 53 fullpath = S_filename54 54 55 55 Make/B/O/N=(hdrBytes) hdrWave -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.10/ProtocolAsPanel.ipf
r260 r303 1863 1863 Wave/T textPath = $textStr 1864 1864 If(WaveExists(textPath) == 1) 1865 newFileName = GetNameFromHeader(textPath[0])1865 newFileName = UpperStr(GetNameFromHeader(textPath[0])) 1866 1866 else 1867 1867 newFileName = "" //if the header is missing? -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.10/WriteQIS.ipf
r300 r303 271 271 if(dialog) 272 272 PathInfo/S catPathName 273 Open/D refnum as fullpath//won't actually open the file274 If(cmpstr( S_filename,"")==0)273 fullPath = DoSaveFileDialog("Save data as") //won't actually open the file 274 If(cmpstr(fullPath,"")==0) 275 275 //user cancel, don't write out a file 276 276 Close/A 277 277 Abort "no data file was written" 278 278 Endif 279 fullpath = S_filename280 279 //Print "dialog fullpath = ",fullpath 281 280 Endif … … 818 817 String outputPath 819 818 820 Open/D/M=msg refNum819 Open/D/M=msg/T="????" refNum 821 820 outputPath = S_fileName 822 821
Note: See TracChangeset
for help on using the changeset viewer.