- Timestamp:
- Feb 19, 2009 4:41:06 PM (14 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GlobalFit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GlobalFit/GlobalFit2_NCNR_v40.ipf
r476 r477 4912 4912 //the text 4913 4913 // -- modify to put in the coefficient labels... 4914 String dataFileStr,funcStr,nameStr,paramStr,suffix,savDF 4914 String dataFileStr,funcStr,nameStr,paramStr,suffix,savDF,tmpindex 4915 4915 Variable num,ii 4916 4916 savDF = GetDataFolder(1) … … 4923 4923 num=numpnts(pw) 4924 4924 4925 //String/G root:beforeStr=GF_resultStr4925 String/G root:beforeStr=GF_resultStr 4926 4926 //SRK clean up text a bit 4927 4927 GF_resultStr = ReplaceString("data set ",GF_resultStr, "", 1) //case-sensitive 4928 4928 4929 for(ii=0;ii<num;ii+=1) 4929 // loop through backwards so that coef_1 does not replace part of coef_10, coef_11, etc. 4930 for(ii=num-1;ii>=0;ii-=1) 4931 // tmpIndex=num2str(ii) 4932 // print "Coef_"+tmpindex 4930 4933 GF_resultStr = ReplaceString("; Coef_"+num2str(ii), GF_resultStr,"") 4931 4934 endfor 4932 4935 //eSRK 4933 for(ii= 0;ii<num;ii+=1)4936 for(ii=num-1;ii>=0;ii-=1) 4934 4937 GF_resultStr = ReplaceString("Coef_"+num2str(ii), GF_resultStr, pw[ii]) 4935 4938 endfor -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GlobalFit/SimpleGlobalFit_NCNR_v40.ipf
r476 r477 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 2 3 4 // panel meant to make it easier to fit two data sets with a single model 5 // typically (but not necessarily) U+S, resolution smeared 6 // 3 7 // Uses a lot of the functionality from the Wrapper Panel - so be careful 4 8 // if the behavior of that panel changes - especially the popup menus 5 //6 //7 // panel meant to make it easier to fit two data sets with a single model8 // typically (but not necessarily) U+S, resolution smeared9 9 // 10 10 // currently unsupported: 11 11 // mask 12 12 // constraints 13 // epsilon (used? but not user-settable?) 13 // epsilon (used, set behind the scenes but is not user-settable) 14 // 15 // ** some of the other assumptions/behaviors are: 16 // - if a global variable is held by one set, it is (must be) held for the other set 17 // even though I don't automatically check the other box 18 // - global parameter values are set from SET A. values in set B are overwritten during 19 // the fit 20 // - upon initialization of the coefficients, coef_A and coef_B are set to those from the 21 // first data set (A). So the appropriate model must be plotted for set A. It does not 22 // need to be plotted for set B, although if you fit the sets separately, each fit can 23 // be used as a good first guess for the global fitting by cut/pase into the table. 24 // - reports are always generated and automatically saved. Beware overwriting. 25 // - weighting waves are automatically selected, as usual, since I know the data sets 26 // - both data sets should be on the top graph. The fit, when finished, will try to append 27 // the results of the fit on the top graph. 14 28 // 15 29 // SRK FEB 2009 … … 101 115 Button button_0,pos={344,13},size={100,20},title="Do Fit" 102 116 Button button_0 proc=SGF_DoFitButtonProc 117 Button button_1,pos={369,173},size={50,20},proc=SaveCheckStateButtonProc,title="Save" 118 Button button_2,pos={429,173},size={70,20},proc=RestoreCheckStateButtonProc,title="Restore" 103 119 104 120 Edit/W=(14,174,348,495)/HOST=# … … 108 124 109 125 EndMacro 126 127 // save the state of the checkboxes 128 Function SaveCheckStateButtonProc(ba) : ButtonControl 129 STRUCT WMButtonAction &ba 130 131 switch( ba.eventCode ) 132 case 2: // mouse up 133 // click code here 134 Duplicate/O root:Packages:NewGlobalFit:selW, root:Packages:NewGlobalFit:selW_saved 135 break 136 endswitch 137 138 return 0 139 End 140 141 //restore the state of the checkboxes if the number of rows is correct 142 Function RestoreCheckStateButtonProc(ba) : ButtonControl 143 STRUCT WMButtonAction &ba 144 145 switch( ba.eventCode ) 146 case 2: // mouse up 147 // click code here 148 Wave sw_cur = root:Packages:NewGlobalFit:selW 149 Wave sw_sav = root:Packages:NewGlobalFit:selW_saved 150 151 Variable num_cur,num_sav 152 num_cur = DimSize(sw_cur,0) 153 num_sav = DimSize(sw_sav,0) 154 155 if(num_cur == num_sav) 156 sw_cur = sw_sav 157 endif 158 159 break 160 endswitch 161 162 return 0 163 End 164 165 166 110 167 111 168 // show the appropriate coefficient waves
Note: See TracChangeset
for help on using the changeset viewer.