Changeset 127 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/SmearedRPA.ipf
- Timestamp:
- Jul 24, 2007 3:23:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/SmearedRPA.ipf
r42 r127 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 2 #pragma IgorVersion = 6.0 3 4 // currently, there is NO XOP version of RPA, since there is an extra input parameter 5 // wave that must be carried into the function. 6 // this can be done with the STRUCT, if extra space is allocated for such 7 // 8 // in addition, the inputvalues, coefvalues_rpa names are not consistent with other models 9 // - it would be nice for users to make all models have a consistent naming scheme 10 // 3 11 // 4 12 Proc PlotRPAForm(num,qmin,qmax,nCASE) … … 63 71 End 64 72 65 Proc PlotSmearedRPAForm(nCASE) 66 //no input parameters necessary, it MUST use the experimental q-values 67 // from the experimental data read in from an AVE/QSIG data file 68 Variable/g gCASE //Global Variable 73 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 74 Proc PlotSmearedRPAForm(str,nCASE) 75 String str 69 76 Variable nCASE 77 Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 70 78 Prompt nCASE, "Choose one of the following cases:",popup "CASE 1: C/D BINARY MIXTURE OF HOMOPOLYMERS;" 71 79 "CASE 2: C-D DIBLOCK COPOLYMER;" … … 78 86 "CASE 9: A-B/C-D MIXTURE OF TWO DIBLOCK COPOLYMERS A-B AND C-D;" 79 87 "CASE 10: A-B-C-D FOUR-BLOCK COPOLYMER" 80 81 // if no gQvals wave, data must not have been loaded => abort 82 if(ResolutionWavesMissing()) 88 89 SetDataFolder $("root:"+str) 90 91 Variable/g gCASE //Global Variable 92 93 // if any of the resolution waves are missing => abort 94 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 83 95 Abort 84 96 endif 85 97 86 98 gCASE = nCASE 87 99 // print gCASE 88 100 101 89 102 IF(gCASE <=2) 90 103 Make/O/D inputvalues={1000,0.5,100,1.e-12,1000,0.5,100,0.e-12} … … 116 129 // output smeared intensity wave, dimensions are identical to experimental QSIG values 117 130 // make extra copy of experimental q-values for easy plotting 118 Duplicate/O $gQvals smeared_rpa,smeared_qvals 119 SetScale d,0,0,"1/cm",smeared_rpa 120 121 smeared_rpa := SmearedRPAForm(smear_coefvalues_rpa,$gQvals) 131 Duplicate/O $(str+"_q") smeared_rpa,smeared_qvals 132 SetScale d,0,0,"1/cm",smeared_rpa 133 134 Variable/G gs_rpa=0 135 gs_rpa := fSmearedRPAForm(smear_coef_rpa,smeared_rpa,smeared_qvals) //this wrapper fills the STRUCT 136 122 137 Display smeared_rpa vs smeared_qvals 123 138 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 125 140 Label left "Intensity (cm\\S-1\\M)" 126 141 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 142 143 SetDataFolder root: 127 144 End 128 145 … … 552 569 553 570 // this is all there is to the smeared calculation! 554 Function SmearedRPAForm(w,x) :FitFunc 555 Wave w 556 Variable x 557 558 Variable ans 559 SVAR sq = gSig_Q 560 SVAR qb = gQ_bar 561 SVAR sh = gShadow 562 SVAR gQ = gQVals 563 564 //the name of your unsmeared model is the first argument 565 ans = Smear_Model_20(RPAForm,$sq,$qb,$sh,$gQ,w,x) 566 567 return(ans) 571 Function SmearedRPAForm(s) :FitFunc 572 573 Struct ResSmearAAOStruct &s 574 575 ////the name of your unsmeared model is the first argument 576 s.yW = Smear_Model_20(RPAForm,s.coefW,s.xW,s.resW) 577 578 return(0) 568 579 End 580 581 //wrapper to calculate the smeared model as an AAO-Struct 582 // fills the struct and calls the ususal function with the STRUCT parameter 583 // 584 // used only for the dependency, not for fitting 585 // 586 Function fSmearedRPAForm(coefW,yW,xW) 587 Wave coefW,yW,xW 588 589 String str = getWavesDataFolder(yW,0) 590 String DF="root:"+str+":" 591 592 WAVE resW = $(DF+str+"_res") 593 594 STRUCT ResSmearAAOStruct fs 595 WAVE fs.coefW = coefW 596 WAVE fs.yW = yW 597 WAVE fs.xW = xW 598 WAVE fs.resW = resW 599 600 Variable err 601 err = SmearedRPAForm(fs) 602 603 return (0) 604 End
Note: See TracChangeset
for help on using the changeset viewer.