Changeset 742
 Timestamp:
 Sep 16, 2010 11:30:35 AM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/LakeDesmearing_JB.ipf
r665 r742 90 90 Variable/G gMaxSlowIter = 10000 91 91 92 Variable/G gNptsExtrap = 1 0//points for high q extrapolation92 Variable/G gNptsExtrap = 15 //points for high q extrapolation 93 93 Variable/G gChi2Target = 1 //chi^2 target 94 94 Variable/G gPowerM = 4 … … 744 744 Variable num=numpnts(iw),retVal 745 745 746 747 /////////for the fit 746 748 Make/O/D P_coef={0,1,4} //input 747 // Make/O/T Constr={"K2<0","K2 > 20"}749 Make/O/T Constr={"K2<0","K2 > 8"} 748 750 //(set background to zero and hold fixed) 749 CurveFit/H="100" Power kwCWave=P_coef iw[(num1nend),(num1)] /X=qw /W=sw /D 751 752 // initial guess 753 P_coef[1] = iw[num1]/qw[num1]^P_coef[2] 754 755 CurveFit/H="100" Power kwCWave=P_coef iw[(num1nend),(num1)] /X=qw /W=sw /I=1 /C=constr 750 756 extr_hqi=P_coef[0]+P_coef[1]*extr_hqq^P_coef[2] 751 757 … … 756 762 // CurveFit Power kwCWave=P_coef iw[(num1nend),(num1)] /X=qw /W=sw /D 757 763 // extr_hqi=P_coef[0]+P_coef[1]*extr_hqq^P_coef[2] 764 765 // if(checked && if(not already displayed)) 766 // AppendToGraph extr_hqi vs extr_hqq 767 // ModifyGraph lsize(extr_hqi)=2 768 // endif 758 769 759 770 … … 949 960 endif 950 961 962 if(tab == 2) 963 //calculate the extrapolation when the tab is selected  this refits the data, what we want to avoid 964 // DSM_ExtrapolateButtonProc("") 965 966 // OR 967 // use the coefficients from when it was loaded 968 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 969 WAVE P_coef = $(USANSFolder+":DSM:P_coef") 970 wave Qw = $(USANSFolder+":DSM:Q_exp") 971 972 DSM_SetExtrWaves(Qw) 973 Wave extr_hqi=$(USANSFolder+":DSM:extr_hqi") 974 Wave extr_hqq=$(USANSFolder+":DSM:extr_hqq") 975 extr_hqi=P_coef[0]+P_coef[1]*extr_hqq^P_coef[2] 976 977 AppendExtrapolation() 978 979 endif 980 951 981 return 0 952 982 End … … 1092 1122 String DFStr= CleanupName(fname,0) 1093 1123 1094 Duplicate/O $("root:"+DFStr+":"+qStr) $(USANSFolder+":DSM:Q_exp 1124 Duplicate/O $("root:"+DFStr+":"+qStr) $(USANSFolder+":DSM:Q_exp") 1095 1125 Duplicate/O $("root:"+DFStr+":"+iStr) $(USANSFolder+":DSM:I_exp") 1096 Duplicate/O $("root:"+DFStr+":"+sStr) $(USANSFolder+":DSM:S_exp 1126 Duplicate/O $("root:"+DFStr+":"+sStr) $(USANSFolder+":DSM:S_exp") 1097 1127 wave Q_exp = $(USANSFolder+":DSM:Q_exp") 1098 1128 Wave I_exp = $(USANSFolder+":DSM:I_exp") 1099 1129 Wave S_exp = $(USANSFolder+":DSM:S_exp") 1130 1131 // copy over the high q extrapolation information 1132 Duplicate/O $("root:"+DFStr+":P_coef") $(USANSFolder+":DSM:P_coef") 1133 NVAR slope = $("root:"+DFStr+":USANS_m") 1134 NVAR powerM = $(USANSFolder+":DSM:gPowerM") 1135 powerM = slope 1100 1136 1101 1137 // remove any negative qvalues (and q=0 values!)(and report this)
Note: See TracChangeset
for help on using the changeset viewer.