- Timestamp:
- Jul 29, 2019 11:14:26 AM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/LakeDesmearing_JB.ipf
r742 r1188 608 608 Return(0) 609 609 End 610 611 612 // since this data is only smoothed, repeat the three fake resolution columns with the 613 // negative value for the dQv value 614 // 615 // SRK 29 JUL 2019 616 // 617 Function WriteUSANS_Smoothed(fullpath,lo,hi,dialog) 618 String fullpath 619 Variable lo,hi,dialog //=1 will present dialog for name 620 621 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 622 623 String termStr="\r\n" 624 String destStr = USANSFolder+":DSM:" 625 String formatStr = "%15.6g %15.6g %15.6g %15.6g %15.6g %15.6g"+termStr 626 627 Variable refNum,integer,realval 628 NVAR gDQV = root:Packages:NIST:USANS:DSM:gDqv 629 630 //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 631 WAVE Q_smth =$(destStr + "Q_smth") 632 WAVE I_smth=$(destStr + "I_smth") 633 WAVE S_smth=$(destStr + "S_smth") 634 635 //check each wave 636 If(!(WaveExists(Q_smth))) 637 Abort "Q_smth DNExist in WriteUSANS_Smoothed()" 638 Endif 639 If(!(WaveExists(I_smth))) 640 Abort "I_smth DNExist in WriteUSANS_Smoothed()" 641 Endif 642 If(!(WaveExists(S_smth))) 643 Abort "S_smth DNExist in WriteUSANS_Smoothed()" 644 Endif 645 646 // 06 FEB 06 SRK 647 // make dummy waves to hold the "fake" resolution, and write it as the last 3 columns 648 // 649 Duplicate/O Q_smth,res1,res2,res3 650 res1 = -gDQV 651 res2 = -gDQV 652 res3 = -gDQV 653 654 if(dialog) 655 Open/D refnum as fullpath+".smth" //won't actually open the file 656 If(cmpstr(S_filename,"")==0) 657 //user cancel, don't write out a file 658 Close/A 659 Abort "no data file was written" 660 Endif 661 fullpath = S_filename 662 Endif 663 664 //write out partial set? 665 Duplicate/O Q_smth,tq,ti,te 666 ti=I_smth 667 te=S_smth 668 if( (lo!=hi) && (lo<hi)) 669 redimension/N=(hi-lo+1) tq,ti,te,res1,res2,res3 //lo to hi, inclusive 670 tq=Q_smth[p+lo] 671 ti=I_smth[p+lo] 672 te=S_smth[p+lo] 673 endif 674 675 //tailor the output given the type of data written out... 676 String samStr="",dateStr="",str1,str2 677 678 //get the number of spline passes from the wave note 679 String noteStr 680 Variable boxPass,SplinePass 681 noteStr=note(I_smth) 682 BoxPass = NumberByKey("BOX", noteStr, "=", ";") 683 splinePass = NumberByKey("SPLINE", noteStr, "=", ";") 684 685 686 samStr = fullpath 687 dateStr="CREATED: "+date()+" at "+time() 688 // sprintf str1,"Chi^2 = %g PowerLaw m = %4.2f Iterations = %d",chiFinal,m,iter 689 str1 = "smoothed data file, not desmeared" 690 sprintf str2,"%d box smooth passes and %d smoothing spline passes",boxPass,splinePass 691 692 693 //actually open the file 694 Open refNum as fullpath 695 696 fprintf refnum,"%s"+termStr,samStr 697 // fprintf refnum,"%s"+termStr,str1 698 fprintf refnum,"%s"+termStr,str2 699 fprintf refnum,"%s"+termStr,dateStr 700 701 wfprintf refnum, formatStr, tq,ti,te,res1,res2,res3 702 703 Close refnum 704 705 Killwaves/Z ti,tq,te,res1,res2,res3 706 707 Return(0) 708 End 709 610 710 611 711 /// procedures to do the extrapolation to high Q … … 1559 1659 ControlInfo/W=Desmear_Graph DSMControl_3c //SSCheck 1560 1660 if(V_value == 1) 1561 // Interpolate2/T=3/N=(nq)/I=2/F=1/SWAV=S_ext/Y=Yi_SS/X=Yq_SS Q_ext, I_ext //Igor 5 1661 nq_ext = numpnts(Q_ext) 1662 Interpolate2/T=3/N=(nq_ext)/I=2/F=1/SWAV=S_ext/Y=Yi_SS/X=Yq_SS Q_ext, I_ext //Igor 5 1562 1663 // Interpolate/T=3/N=(nq)/I=2/F=1/S=S_ext/Y=Yi_SS/X=Yq_SS I_ext /X=Q_ext //Igor 4 1563 //Igor 41564 String str=""1565 nq_ext = numpnts(Q_ext)1566 str = "Interpolate/T=3/N=("+num2str(nq_ext)+")/I=1/F=("+num2str(sParam)+")/Y=Yi_SS/X=Yq_SS I_ext /X=Q_ext"1567 Execute str1664 // //Igor 4 1665 // String str="" 1666 // nq_ext = numpnts(Q_ext) 1667 // str = "Interpolate/T=3/N=("+num2str(nq_ext)+")/I=1/F=("+num2str(sParam)+")/Y=Yi_SS/X=Yq_SS I_ext /X=Q_ext" 1668 // Execute str 1568 1669 // Print Str 1670 // end Igor 4 1569 1671 // Interpolate2/T=3/N=(nq_ext)/I=1/F=(sParam)/Y=Yi_SS/X=Yq_SS Q_ext, I_ext 1570 // end Igor 4 1672 1571 1673 wave yi_ss = yi_ss // already in the right DF 1572 1674 wave yq_ss = yq_ss … … 1673 1775 // 1674 1776 1675 if (useXMLOutput == 1) 1676 WriteXMLUSANSDesmeared(saveStr,0,0,1) 1677 else 1678 WriteUSANSDesmeared(saveStr,0,0,1) //use the full set (lo=hi=0) and present a dialog 1679 endif 1777 ControlInfo DSM_Tab 1778 Variable curTab = V_Value 1779 1780 switch(curTab) // numeric switch 1781 case 4: // data from the desmeared data tab 1782 if (useXMLOutput == 1) 1783 WriteXMLUSANSDesmeared(saveStr,0,0,1) 1784 else 1785 WriteUSANSDesmeared(saveStr,0,0,1) //use the full set (lo=hi=0) and present a dialog 1786 endif 1787 break 1788 case 3: 1789 WriteUSANS_Smoothed(saveStr,0,0,1) 1790 break 1791 default: 1792 DoAlert 0,"Can only save data from the smooth or desmeared tabs" 1793 endswitch 1794 1795 1680 1796 1681 1797 SetDataFolder root: -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1154 r1188 1132 1132 Button button4,pos={720.00,10.00},size={25.00,20.00},proc=V_AvgPanelHelpButtonProc,title="?" 1133 1133 1134 SetVariable setvar0,pos={ 50,40},size={140,23},title="Annulus q-center (A)"1134 SetVariable setvar0,pos={20,40},size={160,23},title="Annulus q-center (A)" 1135 1135 SetVariable setvar0,limits={0,1,0.001},value=root:Packages:NIST:VSANS:Globals:Mask:gAnnularQCtr 1136 SetVariable setvar1,pos={ 50,70},size={140,23},title="Annulus (+/-) q (A)"1136 SetVariable setvar1,pos={20,70},size={160,23},title="Annulus (+/-) q (A)" 1137 1137 SetVariable setvar1,limits={0,1,0.001},value=root:Packages:NIST:VSANS:Globals:Mask:gAnnularDQ 1138 SetVariable setvar2,pos={ 200,40},size={140,23},title="Sector Angle (deg)"1138 SetVariable setvar2,pos={190,40},size={150,23},title="Sector Angle (deg)" 1139 1139 SetVariable setvar2,limits={-90,90,1},value=root:Packages:NIST:VSANS:Globals:Mask:gSectorAngle 1140 SetVariable setvar3,pos={ 200,70},size={140,23},title="Sector (+/-) (deg)"1140 SetVariable setvar3,pos={190,70},size={150,23},title="Sector (+/-) (deg)" 1141 1141 SetVariable setvar3,limits={0,90,1},value=root:Packages:NIST:VSANS:Globals:Mask:gSectorDQ 1142 1142
Note: See TracChangeset
for help on using the changeset viewer.