Ignore:
Timestamp:
Jul 25, 2007 3:07:20 PM (16 years ago)
Author:
srkline
Message:

Second round of changes to ipf files to (hopefully) complete the changes to bring all of the model functions to be:

  • this set of changes is for the "2006" set of models
  • AAO
  • new dependencies
  • smearing using structures
  • #if conditional compile for XOPS

-this needs to be FULLY tested for correctness and bugs
-packages are certainly still broken (data folders)

SRK 25 JUL 07

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/LamellarPS.ipf

    r127 r128  
    6363        Edit parameters_LamellarPS, coef_LamellarPS 
    6464        ModifyTable width(parameters_LamellarPS)=160 
    65         ywave_LamellarPS  := LamellarPS(coef_LamellarPS, xwave_LamellarPS) 
     65         
     66        Variable/G root:g_LamellarPS 
     67        g_LamellarPS := LamellarPS(coef_LamellarPS, ywave_LamellarPS, xwave_LamellarPS) 
    6668        Display ywave_LamellarPS vs xwave_LamellarPS 
    6769        ModifyGraph marker=29, msize=2, mode=4 
     
    7779End 
    7880 
    79 //// 
    80 ////this macro sets up all the necessary parameters and waves that are 
    81 ////needed to calculate the  smeared model function. 
    82 //// 
    83 ////no input parameters are necessary, it MUST use the experimental q-values 
    84 //// from the experimental data read in from an AVE/QSIG data file 
    85 ////////////////////////////////////////////////////// 
    86 //Macro PlotSmeared_LamellarPS()                                                                //Lamellar 
    87 //       
    88 //       
    89 //      // if no gQvals wave, data must not have been loaded => abort 
    90 //      If(ResolutionWavesMissing())            //part of GaussUtils 
     81// - sets up a dependency to a wrapper, not the actual SmearedModelFunction 
     82//Proc PlotSmeared_LamellarPS(str)                                                               
     83//      String str 
     84//      Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 
     85//       
     86//      // if any of the resolution waves are missing => abort 
     87//      if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils) 
    9188//              Abort 
    9289//      endif 
     90//       
     91//      SetDataFolder $("root:"+str) 
    9392//       
    9493//      // constants 
     
    102101//      // output smeared intensity wave, dimensions are identical to experimental QSIG values 
    103102//      // make extra copy of experimental q-values for easy plotting 
    104 //      Duplicate/O $gQvals smeared_LamellarPS,smeared_qvals                            // 
     103//      Duplicate/O $(str+"_q") smeared_LamellarPS,smeared_qvals                                // 
    105104//      SetScale d,0,0,"1/cm",smeared_LamellarPS                                                        // 
    106 // 
    107 //      smeared_LamellarPS := LamellarPS_Smeared(smear_coef_LamellarPS,$gQvals)         // SMEARED function name 
    108 //      Display smeared_LamellarPS vs $gQvals                                                                   // 
     105//                                       
     106//      Variable/G gs_LamellarPS=0 
     107//      gs_LamellarPS := fLamellarPS_Smeared(smear_coef_LamellarPS,smeared_LamellarPS,smeared_qvals)    //this wrapper fills the STRUCT 
     108//       
     109//      Display smeared_LamellarPS vs smeared_qvals                                                                     // 
    109110//      ModifyGraph log=1,marker=29,msize=2,mode=4 
    110111//      Label bottom "q (\\S-1\\M)" 
    111112//      Label left "I(q) (cm\\S-1\\M)" 
    112 // 
    113 //End     // end macro  
     113//       
     114//      SetDataFolder root: 
     115//End 
     116 
     117 
     118 
     119 
     120 
     121//AAO version, uses XOP if available 
     122// simply calls the original single point calculation with 
     123// a wave assignment (this will behave nicely if given point ranges) 
     124Function LamellarPS(cw,yw,xw) : FitFunc 
     125        Wave cw,yw,xw 
     126         
     127#if exists("LamellarPSX") 
     128        yw = LamellarPSX(cw,xw) 
     129#else 
     130        yw = fLamellarPS(cw,xw) 
     131#endif 
     132        return(0) 
     133End 
    114134 
    115135// instrument resolution IS included here in S(Q) 
    116 Function LamellarPS(w,x) : FitFunc 
     136Function fLamellarPS(w,x) : FitFunc 
    117137        Wave w 
    118138        Variable x 
     
    191211        Return (inten+bkg) 
    192212End 
    193          
     213 
     214//wrapper to calculate the smeared model as an AAO-Struct 
     215// fills the struct and calls the ususal function with the STRUCT parameter 
     216// 
     217// used only for the dependency, not for fitting 
     218// 
     219//Function fLamellarPS_Smeared(coefW,yW,xW) 
     220//      Wave coefW,yW,xW 
     221//       
     222//      String str = getWavesDataFolder(yW,0) 
     223//      String DF="root:"+str+":" 
     224//       
     225//      WAVE resW = $(DF+str+"_res") 
     226//       
     227//      STRUCT ResSmearAAOStruct fs 
     228//      WAVE fs.coefW = coefW    
     229//      WAVE fs.yW = yW 
     230//      WAVE fs.xW = xW 
     231//      WAVE fs.resW = resW 
     232//       
     233//      Variable err 
     234//      err = LamellarPS_Smeared(fs) 
     235//       
     236//      return (0) 
     237//End 
     238 
    194239//the smeared model calculation 
    195 //Function LamellarPS_Smeared(w,x) :FitFunc 
    196 //      Wave w 
    197 //      Variable x 
    198 //       
    199 //      Variable ans 
    200 //      SVAR sq = gSig_Q 
    201 //      SVAR qb = gQ_bar 
    202 //      SVAR sh = gShadow 
    203 //      SVAR gQ = gQVals 
    204 //       
    205 //      ans = Smear_Model_20(LamellarPS,$sq,$qb,$sh,$gQ,w,x)     
    206 // 
    207 //      return(ans) 
     240//Function LamellarPS_Smeared(s) :FitFunc 
     241//      Struct ResSmearAAOStruct &s 
     242// 
     243////    the name of your unsmeared model (AAO) is the first argument 
     244//      s.yW = Smear_Model_20(LamellarPS,s.coefW,s.xW,s.resW) 
     245// 
     246//      return(0) 
    208247//End 
    209 // 
     248//// 
Note: See TracChangeset for help on using the changeset viewer.