Changeset 47 for sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/Transmission.ipf
- Timestamp:
- Feb 6, 2007 3:58:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/Transmission.ipf
r40 r47 622 622 //also writes a trans=1 value back to the sample file 623 623 // 624 Function fClearSelectedAssignments(startRow,endRow) 625 Variable startRow,endRow 626 627 // GetSelection table,ScatterFileTable,1 624 // DEC 2006 - now also writes blank suffix to clear trans->empty assignment, and Twhole=1 625 // 626 // target = 1 = ScatterFileTable 627 // target = 2 = TransFileTable 628 Function fClearSelectedAssignments(startRow,endRow,target) 629 Variable startRow,endRow,target 628 630 629 631 Wave/T S_TRANS_Filenames = $"root:myGlobals:TransHeaderInfo:S_TRANS_Filenames" … … 632 634 Wave/T S_GSuffix = $"root:myGlobals:TransHeaderInfo:S_Suffix" 633 635 Wave S_GTransmission = $"root:myGlobals:TransHeaderInfo:S_Transmission" 636 Wave/T T_EMP_Filenames = $"root:myGlobals:TransHeaderInfo:T_EMP_Filenames" 637 Wave/T T_GFilenames = $"root:myGlobals:TransHeaderInfo:T_Filenames" 638 Wave/T T_GSuffix = $"root:myGlobals:TransHeaderInfo:T_Suffix" 639 Wave T_GTransmission = $"root:myGlobals:TransHeaderInfo:T_Transmission" 640 Wave T_GTWhole = $"root:myGlobals:TransHeaderInfo:T_Whole" 641 634 642 635 643 Variable num_s_files, num_t_files, ii, jj 636 Variable refnum 644 Variable refnum,zero=0 637 645 num_t_files = numpnts(T_GFilenames) 638 646 String suffix = " " //4 blank spaces … … 641 649 String filename 642 650 643 // don't do anything with the trans file -> empty beam file correspondence 644 651 // If the selection is from the TransFileTable 652 // - wipe out the box coordinates 653 // - wipe out the suffix 654 // - wipe out the transmission 655 // - wipe out T_whole 656 // - update the waves in the table 657 658 if(target == 2) 659 ii= startRow 660 do 661 filename = pathname + T_GFilenames[ii] 662 663 // write in zeros for the box coordinates 664 Open/A/T="????TEXT" refnum as filename 665 FSetPos refnum,478 666 FBinWrite/F=3/B=3 refNum, zero 667 FBinWrite/F=3/B=3 refNum, zero 668 FBinWrite/F=3/B=3 refNum, zero 669 FBinWrite/F=3/B=3 refNum, zero 670 FStatus refnum //move to the end of the file before closing 671 FSetPos refnum,V_logEOF 672 Close refnum 673 674 // write in a null suffix 675 Open/A/T="????TEXT" refnum as filename 676 FSetPos refnum,404 //suffix start byte is 404 677 FBinWrite refnum, suffix 678 FStatus refnum 679 FSetPos refnum,V_logEOF 680 Close refnum 681 682 //write a trans==1 to the file header of the raw data (open/close done in function) 683 ReWriteReal(filename,1,158) //transmission start byte is 158 684 ReWriteReal(filename,1,392) //WholeTrans start byte is 392 685 686 //then update the table that is displayed 687 T_EMP_Filenames[ii] = "" 688 T_GTransmission[ii] = 1 689 T_GTWhole[ii] = 1 690 691 ii+=1 692 while(ii<=endRow) 693 endif 694 645 695 // // Write suffix of empty beam file into transmission files 646 696 // ii= 0 … … 666 716 // while(ii<num_t_files) 667 717 668 // Write null suffix of transmission files into scattering files 669 ii= startRow 670 do 671 filename = pathname + S_GFilenames[ii] 672 Open/A/T="????TEXT" refnum as filename 673 //FSetPos refnum,91 //wrong position 674 FSetPos refnum,404 675 FBinWrite refnum, suffix 676 FStatus refnum 677 FSetPos refnum,V_logEOF 678 Close refnum 679 680 //write a trans==1 to the file header of the raw data (open/close done in function) 681 ReWriteReal(filename,1,158) //transmission start byte is 158 682 683 //then update the table that is displayed 684 S_TRANS_Filenames[ii] = "" 685 S_GTransmission[ii] = 1 686 687 ii+=1 688 while(ii<=endRow) 718 if(target == 1) 719 // Write null suffix of transmission files into scattering files 720 ii= startRow 721 do 722 filename = pathname + S_GFilenames[ii] 723 Open/A/T="????TEXT" refnum as filename 724 //FSetPos refnum,91 //wrong position 725 FSetPos refnum,404 726 FBinWrite refnum, suffix 727 FStatus refnum 728 FSetPos refnum,V_logEOF 729 Close refnum 730 731 //write a trans==1 to the file header of the raw data (open/close done in function) 732 ReWriteReal(filename,1,158) //transmission start byte is 158 733 734 //then update the table that is displayed 735 S_TRANS_Filenames[ii] = "" 736 S_GTransmission[ii] = 1 737 738 ii+=1 739 while(ii<=endRow) 740 endif 741 689 742 return(0) 690 743 End … … 2134 2187 Function ClearSelectedAssignments() 2135 2188 2136 Variable ii 2137 Variable scatterTableExists 2138 scatterTableExists = WinType("ScatterFileTable") 2139 if (scatterTableExists != 0) 2189 String winStr = WinList("*", ";", "WIN:" ) //returns the target window 2190 Variable scatterTableExists, transTableExists 2191 Print winStr 2192 scatterTableExists = cmpstr(winStr,"ScatterFileTable;") 2193 if (scatterTableExists == 0) 2140 2194 GetSelection table,ScatterFileTable,1 2141 fClearSelectedAssignments(V_startRow,V_endRow )2195 fClearSelectedAssignments(V_startRow,V_endRow,1) 2142 2196 endif 2197 2198 transTableExists = cmpstr(winStr,"TransFileTable;") 2199 if (transTableExists == 0) 2200 GetSelection table,TransFileTable,1 2201 fClearSelectedAssignments(V_startRow,V_endRow,2) 2202 endif 2203 2143 2204 return(0) 2144 2205 End
Note: See TracChangeset
for help on using the changeset viewer.