# Changeset 444 for sans/Dev/trunk/NCNR_User_Procedures/Analysis

Ignore:
Timestamp:
Nov 12, 2008 4:45:15 PM (14 years ago)
Message:

Changes to the analysis package to add a few more model functions. Documentation and XOPs are to follow later.

General n-point gaussian quadrature has been added to GaussUtils? by including a Gauss-Laguere point generator from Numerical Recipes. See the Paracrystal models for an example, since they needed more than the 76 point quadrature.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Analysis
Files:
4 edited

Unmodified
Removed
• ## sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/Core_and_NShells_v40.ipf

 r396 //needed to calculate the model function. // Macro PlotOneShell(num,qmin,qmax) Proc PlotOneShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " End Macro PlotTwoShell(num,qmin,qmax) Proc PlotTwoShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " End Macro PlotThreeShell(num,qmin,qmax) Proc PlotThreeShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " Make/O/D/n=(num) xwave_ThreeShell, ywave_ThreeShell xwave_ThreeShell =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) Make/O/D coef_ThreeShell ={1.,60,6.4e-6,10,1e-6,10,2e-6,6.4e-6,0.001} make/o/t parameters_ThreeShell = {"scale","core radius (A)","Core SLD (A-2)","Shell 1 thickness","Shell 1 SLD (A-2)","Shell 2 thickness","Shell 2 SLD (A-2)","Solvent SLD (A-2)","bkg (cm-1)"} Make/O/D coef_ThreeShell ={1.,60,6.4e-6,10,1e-6,10,2e-6,10,3e-6,6.4e-6,0.001} make/o/t parameters_ThreeShell = {"scale","core radius (A)","Core SLD (A-2)","Shell 1 thickness","Shell 1 SLD (A-2)","Shell 2 thickness","Shell 2 SLD (A-2)","Shell 3 thickness","Shell 3 SLD (A-2)","Solvent SLD (A-2)","bkg (cm-1)"} Edit parameters_ThreeShell, coef_ThreeShell End Macro PlotFourShell(num,qmin,qmax) Proc PlotFourShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " //////////////////////////////////////////////////// // - sets up a dependency to a wrapper, not the actual SmearedModelFunction Macro PlotSmearedOneShell(str) Proc PlotSmearedOneShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) End Macro PlotSmearedTwoShell(str) Proc PlotSmearedTwoShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) Macro PlotSmearedThreeShell(str) Proc PlotSmearedThreeShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) End Macro PlotSmearedFourShell(str) Proc PlotSmearedFourShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) return (0) End //wrapper to calculate the smeared model as an AAO-Struct // fills the struct and calls the ususal function with the STRUCT parameter // // used only for the dependency, not for fitting // Function fSmearedTwoShell(coefW,yW,xW) Wave coefW,yW,xW String str = getWavesDataFolder(yW,0) String DF="root:"+str+":" WAVE resW = \$(DF+str+"_res") STRUCT ResSmearAAOStruct fs WAVE fs.coefW = coefW WAVE fs.yW = yW WAVE fs.xW = xW WAVE fs.resW = resW Variable err err = SmearedTwoShell(fs) return (0) End //wrapper to calculate the smeared model as an AAO-Struct // fills the struct and calls the ususal function with the STRUCT parameter // // used only for the dependency, not for fitting // Function fSmearedThreeShell(coefW,yW,xW) Wave coefW,yW,xW String str = getWavesDataFolder(yW,0) String DF="root:"+str+":" WAVE resW = \$(DF+str+"_res") STRUCT ResSmearAAOStruct fs WAVE fs.coefW = coefW WAVE fs.yW = yW WAVE fs.xW = xW WAVE fs.resW = resW Variable err err = SmearedThreeShell(fs) return (0) End //wrapper to calculate the smeared model as an AAO-Struct // fills the struct and calls the ususal function with the STRUCT parameter // // used only for the dependency, not for fitting // Function fSmearedFourShell(coefW,yW,xW) Wave coefW,yW,xW String str = getWavesDataFolder(yW,0) String DF="root:"+str+":" WAVE resW = \$(DF+str+"_res") STRUCT ResSmearAAOStruct fs WAVE fs.coefW = coefW WAVE fs.yW = yW WAVE fs.xW = xW WAVE fs.resW = resW Variable err err = SmearedFourShell(fs) return (0) End
• ## sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/PolyCore_and_NShells_v40.ipf

 r396 //needed to calculate the model function. // Macro PlotPolyPolyOneShell(num,qmin,qmax) Proc PlotPolyOneShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " Prompt qmax "Enter maximum q-value (^-1) for model: " // Make/O/D/n=(num) xwave_PolyPolyOneShell, ywave_PolyPolyOneShell xwave_PolyPolyOneShell =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) Make/O/D coef_PolyPolyOneShell = {1.,60,0.1,6.4e-6,10,1e-6,6.4e-6,0.001} make/o/t parameters_PolyPolyOneShell = {"scale","core radius (A)","Core Polydispersity(0,1)","Core SLD (A-2)","Shell thickness (A)","Shell SLD (A-2)","Solvent SLD (A-2)","bkg (cm-1)"} Edit parameters_PolyPolyOneShell, coef_PolyPolyOneShell Variable/G root:g_PolyPolyOneShell Make/O/D/n=(num) xwave_PolyOneShell, ywave_PolyOneShell xwave_PolyOneShell =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) Make/O/D coef_PolyOneShell = {1.,60,0.1,6.4e-6,10,1e-6,6.4e-6,0.001} make/o/t parameters_PolyOneShell = {"scale","core radius (A)","Core Polydispersity(0,1)","Core SLD (A-2)","Shell thickness (A)","Shell SLD (A-2)","Solvent SLD (A-2)","bkg (cm-1)"} Edit parameters_PolyOneShell, coef_PolyOneShell Variable/G root:g_PolyOneShell g_PolyOneShell := PolyOneShell(coef_PolyOneShell, ywave_PolyOneShell, xwave_PolyOneShell) Display ywave_PolyOneShell vs xwave_PolyOneShell End Macro PlotPolyPolyTwoShell(num,qmin,qmax) Proc PlotPolyTwoShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " End Macro PlotPolyThreeShell(num,qmin,qmax) Proc PlotPolyThreeShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " End Macro PlotPolyFourShell(num,qmin,qmax) Proc PlotPolyFourShell(num,qmin,qmax) Variable num=200, qmin=0.001, qmax=0.7 Prompt num "Enter number of data points for model: " //////////////////////////////////////////////////// // - sets up a dependency to a wrapper, not the actual SmearedModelFunction Macro PlotSmearedPolyOneShell(str) Proc PlotSmearedPolyOneShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) End Macro PlotSmearedPolyTwoShell(str) Proc PlotSmearedPolyTwoShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) Macro PlotSmearedPolyThreeShell(str) Proc PlotSmearedPolyThreeShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) End Macro PlotSmearedPolyFourShell(str) Proc PlotSmearedPolyFourShell(str) String str Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
• ## sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/ModelPicker/SANSModelPicker_v40.ipf

 r406 ////paste here... after deleting the old make statement and list Make/O/T/N=69  SANS_Model_List Make/O/T/N=80  SANS_Model_List SANS_Model_List[0] = "BE_Polyelectrolyte.ipf" SANS_Model_List[64] = "Vesicle_UL_and_Struct.ipf" SANS_Model_List[65] = "Vesicle_UL.ipf" //Beta Models //2008 Models SANS_Model_List[66] = "Core_and_NShells.ipf" SANS_Model_List[67] = "PolyCore_and_NShells.ipf" SANS_Model_List[68] = "Fractal_Polysphere.ipf" SANS_Model_List[69] = "GaussLorentzGel.ipf" SANS_Model_List[70] = "PolyGaussCoil.ipf" SANS_Model_List[71] = "Two_Power_Law.ipf" SANS_Model_List[72] = "BroadPeak.ipf" SANS_Model_List[73] = "CorrelationLengthModel.ipf" SANS_Model_List[74] = "TwoLorentzian.ipf" SANS_Model_List[75] = "PolyGaussShell.ipf" SANS_Model_List[76] = "LamellarParacrystal.ipf" SANS_Model_List[77] = "SC_ParaCrystal.ipf" SANS_Model_List[78] = "BCC_ParaCrystal.ipf" SANS_Model_List[79] = "FCC_ParaCrystal.ipf"
• ## sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

 r434 Variable/G V_FitError=0                         //0=no err, 1=error,(2^1+2^0)=3=singular matrix Variable/G V_FitQuitReason=0            //0=ok,1=maxiter,2=user stop,3=no chisq decrease // don't use the auto-destination with no flag, it doesn't appear to work correctly // dispatch the fit // currently, none of the fit functions are defined as threadsafe, so I don't think that the /NTHR flag really // does anything. The functions themselves can be threaded since they are AAO, and that is probably enough, // since it doesn't make much sense to thread threads. In addition, there is a little-publicized warning // in the WM help file that /C=texWave cannot be used to specify constraints for threadsafe functions! // The textwave would have to be parsed into a constraint matrix first, then passed as /C={cMat,cVec}. // -- just something to watch out for. do //              Variable t0 = stopMStimer(-2)           // corresponding print is at the end of the do-while loop (outside)
Note: See TracChangeset for help on using the changeset viewer.