Changeset 47 for sans/SANSReduction/trunk
- Timestamp:
- Feb 6, 2007 3:58:38 PM (16 years ago)
- Location:
- sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/Buttons.ipf
r41 r47 259 259 //displays next (or previous) file in series of run numbers 260 260 //file is read from disk, if path is set and the file number is present 261 //increment +1, adds 1 to eun number, -1 subtracts one261 //increment +1, adds 1 to run number, -1 subtracts one 262 262 Function LoadPlotAndDisplayRAW(increment) 263 263 Variable increment … … 299 299 Proc maskButtonProc(ctrlName) : ButtonControl 300 300 String ctrlName 301 302 OverlayMask() 301 302 DoWindow/F SANS_Data //do nothing if SANS_Data is not displayed, make it target if it is open 303 if(V_flag==0) 304 return 305 endif 306 307 CheckDisplayed/W=SANS_Data root:MSK:overlay 308 if(V_flag==1) //the overlay is present 309 Button $ctrlName,title="Show Mask",win=SANS_Data 310 OverlayMask(0) //hide the mask 311 else 312 Button $ctrlName,title="Hide Mask",win=SANS_Data 313 OverlayMask(1) //show the mask 314 endif 315 316 303 317 End 304 318 -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/CatVSTable.ipf
r41 r47 2 2 #pragma version=5.0 3 3 #pragma IgorVersion=4.0 4 5 6 // 7 // SRK modified 30 JAN07 to include Rotation angle, Temperature, and B-field in the table (at the end) 8 // 4 9 5 10 //************** … … 47 52 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:RunNumber" 48 53 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:IsTrans" 54 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:RotAngle" 55 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Temperature" 56 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Field" 49 57 50 58 If(V_Flag==0) … … 60 68 ModifyTable width(:myGlobals:CatVSHeaderInfo:YCenter)=40 61 69 ModifyTable width(:myGlobals:CatVSHeaderInfo:NumAttens)=30 70 ModifyTable width(:myGlobals:CatVSHeaderInfo:RotAngle)=50 71 ModifyTable width(:myGlobals:CatVSHeaderInfo:Field)=50 62 72 63 73 ModifyTable width(Point)=0 //JUN04, remove point numbers - confuses users since point != run … … 116 126 KillWaves/Z notRAWlist 117 127 // 128 118 129 End 119 130 … … 152 163 Wave GRunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" 153 164 Wave GIsTrans = $"root:myGlobals:CatVSHeaderInfo:IsTrans" 154 155 Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans 165 Wave GRot = $"root:myGlobals:CatVSHeaderInfo:RotAngle" 166 Wave GTemp = $"root:myGlobals:CatVSHeaderInfo:Temperature" 167 Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 168 169 Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField 156 170 return(0) 157 171 End … … 174 188 //Wave/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:NumGuides" 175 189 Wave/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 176 177 //Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumGuides, NumAtten as "Cat/VShort" 178 Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 190 Wave RotAngle = $"root:myGlobals:CatVSHeaderInfo:RotAngle" 191 Wave Temperature = $"root:myGlobals:CatVSHeaderInfo:Temperature" 192 Wave Field= $"root:myGlobals:CatVSHeaderInfo:Field" 193 194 // original order, magnetic at the end 195 // Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field as "Data File Catalog" 196 // put the magnetic information first 197 Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 179 198 String name="CatVSTable" 180 199 DoWindow/C $name … … 191 210 String textstr,temp,lbl,date_time,suffix 192 211 Variable ctime,lambda,sdd,detcnt,cntrate,refNum,trans,thick,xcenter,ycenter,numatten 193 Variable lastPoint, beamstop 212 Variable lastPoint, beamstop,dum 194 213 195 214 Wave/T GFilenames = $"root:myGlobals:CatVSHeaderInfo:Filenames" … … 210 229 Wave GRunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" 211 230 Wave GIsTrans = $"root:myGlobals:CatVSHeaderInfo:IsTrans" 231 Wave GRot = $"root:myGlobals:CatVSHeaderInfo:RotAngle" 232 Wave GTemp = $"root:myGlobals:CatVSHeaderInfo:Temperature" 233 Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 212 234 213 235 lastPoint = numpnts(GLambda) … … 307 329 InsertPoints lastPoint,1,GLambda 308 330 GLambda[lastPoint]=lambda 331 332 //Rotation Angle 333 strToExecute = GBLoadStr + "/S=170/U=1" + "\"" + fname + "\"" 334 Execute strToExecute 335 dum = w[0] 336 InsertPoints lastPoint,1,GRot 337 GRot[lastPoint]=dum 338 339 //Sample Temperature 340 strToExecute = GBLoadStr + "/S=186/U=1" + "\"" + fname + "\"" 341 Execute strToExecute 342 dum = w[0] 343 InsertPoints lastPoint,1,GTemp 344 GTemp[lastPoint]=dum 345 346 //Sample Field 347 strToExecute = GBLoadStr + "/S=190/U=1" + "\"" + fname + "\"" 348 Execute strToExecute 349 dum = w[0] 350 InsertPoints lastPoint,1,GField 351 GField[lastPoint]=dum 309 352 310 353 //Beamstop position (not reported) -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/CircSectAve.ipf
r41 r47 104 104 // 105 105 //pixels within rcentr of beam center are broken into 9 parts (units of mm) 106 rcentr = 100 106 rcentr = 100 //original 107 // rcentr = 0 107 108 // values for error if unable to estimate value 108 109 //large_num = 1e10 … … 299 300 else 300 301 //large arg, exact correction 301 aveint[ii] *= uval*arg/(1-exp(-uval*arg))302 aveint[ii] /= (1-exp(-uval*arg))/(uval*arg) 302 303 endif 303 304 ii+=1 … … 392 393 //get rid of the default mask, if one was created (it is in the current folder) 393 394 //don't just kill "mask" since it might be pointing to the one in the MSK folder 394 Killwaves/ z$(destPath+":mask")395 Killwaves/Z $(destPath+":mask") 395 396 396 397 //return to root folder (redundant) … … 423 424 //function determines azimuthal angle dphi that a vector connecting 424 425 //center of detector to pixel makes with respect to vector 425 //at chosen azimuthal angle phi -> [cos(phi),sin(phi 0] = [phi_x,phi_y]426 //at chosen azimuthal angle phi -> [cos(phi),sin(phi)] = [phi_x,phi_y] 426 427 //dphi is always positive, varying from 0 to Pi 427 428 // -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/Correct.ipf
r41 r47 1250 1250 1251 1251 If((xshift == 0) && (yshift == 0)) 1252 data_out=data_in 1252 data_out=data_in //no change 1253 noadd_mat = 1 //use all of the data 1253 1254 return(0) 1254 1255 endif -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/FIT_Ops.ipf
r41 r47 562 562 endif 563 563 If (cmpstr("1/I",ystr) == 0) 564 textstr_3 = "I(q=0) = " + num2str(1/W_coef[0]) 564 textstr_3 = "I(q=0) = " + num2str(1/W_coef[0])+ " ± " + num2str(1/(W_coef[0] - W_sigma[0])-1/W_coef[0]) 565 565 break 566 566 endif -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/MaskUtils.ipf
r41 r47 27 27 //SetDataFolder root:MSK 28 28 String fname = PromptForPath("Select Mask file") 29 if(strlen(fname)==0) 30 return 31 endif 29 32 ReadMCID_MASK(fname) 30 33 31 34 //SetDataFolder root:MSK 32 String waveStr = "root:MSK:data" 33 NewImage/F/S=2/K=1 $waveStr 34 ModifyImage '' ctab= {*,*,YellowHot,0} 35 //// SRK SEP06 disable plot of mask data, just show the overlay 36 //// String waveStr = "root:MSK:data" 37 //// NewImage/F/S=2/K=1 $waveStr 38 //// ModifyImage '' ctab= {*,*,YellowHot,0} 39 maskButtonProc("maskButton") 40 // OverlayMask(1) 41 42 35 43 // Display/W=(10,50,400,400); AppendImage $waveStr 36 44 … … 144 152 // points directly to window, doesn't need current display type 145 153 // 146 Function OverlayMask() 147 154 // if state==1, show the mask, if ==0, hide the mask 155 Function OverlayMask(state) 156 Variable state 157 148 158 String maskPath = "root:MSK:data" 149 159 if(WaveExists($maskPath) == 1) … … 156 166 157 167 //check to see if mask overlay is currently displayed 168 DoWindow SANS_Data 169 if(V_flag==0) 170 return(0) 171 endif 172 158 173 CheckDisplayed/W=SANS_Data root:MSK:overlay 159 174 //Print "V_flag = ",V_flag 160 175 161 If(V_Flag == 1) 162 //remove old overlay, if there was one 163 RemoveImage overlay 164 Else 165 //append the new overlay 166 AppendImage/L=left/B=bottom root:MSK:overlay 167 //set the color table to vary from 0 to * (=max data = 1), with blue maximum 168 //Nan's will appear transparent (just a general feature of images) 169 ModifyImage/W=SANS_Data overlay ctab={0,*,BlueRedGreen,0} 176 If(V_Flag == 1) //overlay is present 177 if(state==0) 178 RemoveImage overlay 179 endif //don't need to do anything if we want to keep the mask 180 Else //overlay is not present 181 if(state==1) 182 //append the new overlay 183 AppendImage/L=left/B=bottom root:MSK:overlay 184 //set the color table to vary from 0 to * (=max data = 1), with blue maximum 185 //Nan's will appear transparent (just a general feature of images) 186 ModifyImage/W=SANS_Data overlay ctab={0,*,BlueRedGreen,0} 187 endif //don't do anything if we don't want the overlay 170 188 Endif 171 189 Endif -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/ProtocolAsPanel.ipf
r41 r47 2112 2112 //Proc AskForAbsoluteParams_Quest() 2113 2113 Function AskForAbsoluteParams_Quest() 2114 Variable isNG5=0,loc 2115 2116 Variable err 2114 2115 Variable err, isNG5=0,loc,refnum 2117 2116 //ask user if he wants to use a transmision file for absolute scaling 2118 2117 //or if he wants to enter his own information … … 2160 2159 String filename=tw[0],tempStr 2161 2160 err = GetXYBoxFromFile(filename,x1,x2,y1,y2) //xy's are passed/returned by reference 2162 //Print x1,x2,y1,y22161 Print x1,x2,y1,y2 2163 2162 2164 2163 if( ((x1-x2)==0) || ((y1-y2)==0) ) //need to re-select the box … … 2167 2166 Abort "Box not selected properly - Please re-set the ABS parameters" 2168 2167 Endif 2168 //box is OK, write box values to file (this does the same as SetXYBoxCoords) 2169 String tempName = FindValidFilename(filename) 2170 PathInfo/S catPathName 2171 print S_Path + tempname 2172 Open/A/T="????TEXT" refnum as (S_Path + tempname) 2173 FSetPos refnum,478 2174 FBinWrite/F=3/B=3 refNum, x1 2175 FBinWrite/F=3/B=3 refNum, x2 2176 FBinWrite/F=3/B=3 refNum, y1 2177 FBinWrite/F=3/B=3 refNum, y2 2178 //move to the end of the file before closing 2179 FStatus refnum 2180 FSetPos refnum,V_logEOF 2181 Close refnum 2169 2182 else 2170 2183 //give option to override -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/RectAnnulAvg.ipf
r41 r47 297 297 else 298 298 //large arg, exact correction 299 aveint[ii] *= uval*arg/(1-exp(-uval*arg))299 aveint[ii] /= (1-exp(-uval*arg))/(uval*arg) 300 300 endif 301 301 ii+=1 -
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 -
sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/WorkFileUtils.ipf
r41 r47 399 399 while(ii<pixelsX) 400 400 401 // Make/O/N=(pixelsX,pixelsX) SolidAngle 402 401 403 ii=0 402 404 do … … 411 413 domega = rad/dtdist 412 414 ratio = domega^3 415 // solidAngle[ii][jj] = ratio 413 416 xy = xx[ii]*yy[jj] 414 417 data[ii][jj] *= xy*ratio
Note: See TracChangeset
for help on using the changeset viewer.