Changeset 856


Ignore:
Timestamp:
Feb 22, 2020 2:11:09 PM (20 months ago)
Author:
ilavsky
Message:

Beta version 2.691, Modified Fractals model to add option to use for Mass fractals Unified Fit Form Factor

Location:
trunk/User Procedures
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Irena/IR1_Fractals.ipf

    r804 r856  
    11#pragma TextEncoding = "UTF-8"
    22#pragma rtGlobals = 3   // Use strict wave reference mode and runtime bounds checking
    3 //#pragma rtGlobals=1   // Use modern global access method.
    4 #pragma version=2.10
    5 Constant IRVversionNumber=2.06
     3#pragma version=2.11
     4Constant IRVversionNumber=2.11
     5
    66
    77//*************************************************************************\
     
    1111//*************************************************************************/
    1212
     13//2.11 add option to use Unified Spere form factor instead of Spheroid
    1314//2.10 comibed with IR1_FractalsFiting.ipf, IR1_FractalsInit.ipf, and IR1_FractalsCntrlPanel.ipf
    1415//2.06 added getHelp button calling to www manual
     
    2728//2.02  Modified all controls not to define font and font size to enable proper control by user
    2829
    29 
    30 
    3130//Fractals model using Andrew ALlens theory of combining together mass and surface fractal
    3231//systems.
     
    4746       
    4847        KillWIndow/Z IR1V_ControlPanel
    49         Execute("IR1V_ControlPanel()")
     48        KillWIndow/Z IR1V_LogLogPlotV
     49        KillWindow/Z IR1V_IQ4_Q_PlotV
     50        IR1V_ControlPanelFnct()
    5051        ING2_AddScrollControl()
    5152        IR1_UpdatePanelVersionNumber("IR1V_ControlPanel", IRVversionNumber,1)
     
    8485///******************************************************************************************
    8586
    86 Proc IR1V_ControlPanel()
     87Function IR1V_ControlPanelFnct()
    8788        PauseUpdate; Silent 1           // building window...
    8889        NewPanel /K=1 /W=(2.25,43.25,390,690) as "Fractals model"
     
    130131        Button MarkGraphs,pos={280,620},size={100,20}, proc=IR1V_InputPanelButtonProc,title="Results to graphs", help={"Insert text boxes with results into the graphs for printing"}
    131132        SetVariable SASBackground,pos={10,569},size={190,16},proc=IR1V_PanelSetVarProc,title="SAS Background", help={"SAS background"}
    132         SetVariable SASBackground,limits={-inf,Inf,root:Packages:FractalsModel:SASBackgroundStep},value= root:Packages:FractalsModel:SASBackground
     133        NVAR SASBackgroundStep = root:Packages:FractalsModel:SASBackgroundStep
     134        SetVariable SASBackground,limits={-inf,Inf,SASBackgroundStep},value= root:Packages:FractalsModel:SASBackground
    133135        SetVariable SASBackgroundStep,pos={205,569},size={70,16},title="step",proc=IR1V_PanelSetVarProc, help={"Step for increments in SAS background"}
    134136        SetVariable SASBackgroundStep,limits={0,Inf,0},value= root:Packages:FractalsModel:SASBackgroundStep
     
    146148
    147149        SetVariable MassFr1_Phi,pos={14,295},size={160,16},proc=IR1V_PanelSetVarProc,title="Particle volume   "
    148         SetVariable MassFr1_Phi,limits={0,inf,root:Packages:FractalsModel:MassFr1_PhiStep},value= root:Packages:FractalsModel:MassFr1_Phi, help={"Fractional volume of particles in the system"}
     150        NVAR MassFr1_PhiStep = root:Packages:FractalsModel:MassFr1_PhiStep
     151        SetVariable MassFr1_Phi,limits={0,inf,MassFr1_PhiStep},value= root:Packages:FractalsModel:MassFr1_Phi, help={"Fractional volume of particles in the system"}
    149152        CheckBox MassFr1_FitPhi,pos={200,296},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    150153        CheckBox MassFr1_FitPhi,variable= root:Packages:FractalsModel:MassFr1_FitPhi, help={"Fit particle volume?, find god starting conditions and select fitting limits..."}
     
    154157        SetVariable MassFr1_PhiMax,limits={0,inf,0},value= root:Packages:FractalsModel:MassFr1_PhiMax, help={"High limit for Particle volume fitting"}
    155158
    156         SetVariable MassFr1_Radius,pos={14,320},size={160,16},proc=IR1V_PanelSetVarProc,title="Radius                ", help={"Mean particle Radius"}
    157         SetVariable MassFr1_Radius,limits={0,inf,root:Packages:FractalsModel:MassFr1_RadiusStep},value= root:Packages:FractalsModel:MassFr1_Radius
     159        SetVariable MassFr1_Radius,pos={14,320},size={160,16},proc=IR1V_PanelSetVarProc,title="Radius              ", help={"Mean particle Radius"}
     160        NVAR MassFr1_RadiusStep = root:Packages:FractalsModel:MassFr1_RadiusStep
     161        SetVariable MassFr1_Radius,limits={0,inf,MassFr1_RadiusStep},value= root:Packages:FractalsModel:MassFr1_Radius
    158162        CheckBox MassFr1_FitRadius,pos={200,321},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    159163        CheckBox MassFr1_FitRadius,variable= root:Packages:FractalsModel:MassFr1_FitRadius, help={"Fit Radius? Select properly starting conditions and limits"}
     
    164168
    165169        SetVariable MassFr1_Dv,pos={14,345},size={160,16},proc=IR1V_PanelSetVarProc,title="Dv (fractal dim.)  ", help={"Fractal dimension - for mass fractal between 1 and 3, chanegs slope..."}
    166         SetVariable MassFr1_Dv,limits={1,3,root:Packages:FractalsModel:MassFr1_DvStep},value= root:Packages:FractalsModel:MassFr1_Dv
     170        NVAR MassFr1_DvStep = root:Packages:FractalsModel:MassFr1_DvStep
     171        SetVariable MassFr1_Dv,limits={1,3,MassFr1_DvStep},value= root:Packages:FractalsModel:MassFr1_Dv
    167172        CheckBox MassFr1_FitDv,pos={200,346},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    168173        CheckBox MassFr1_FitDv,variable= root:Packages:FractalsModel:MassFr1_FitDv, help={"Fit the Dv?, select properly the starting conditions and limits before fitting"}
     
    173178
    174179        SetVariable MassFr1_Ksi,pos={14,370},size={160,16},proc=IR1V_PanelSetVarProc,title="Correlation length ", help={"Correlation length of mass fractal, Ksi in the formula"}
    175         SetVariable MassFr1_Ksi,limits={0,inf,root:Packages:FractalsModel:MassFr1_KsiStep},value= root:Packages:FractalsModel:MassFr1_Ksi
     180        NVAR MassFr1_KsiStep = root:Packages:FractalsModel:MassFr1_KsiStep
     181        SetVariable MassFr1_Ksi,limits={0,inf,MassFr1_KsiStep},value= root:Packages:FractalsModel:MassFr1_Ksi
    176182        CheckBox MassFr1_FitKsi,pos={200,371},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    177183        CheckBox MassFr1_FitKsi,variable= root:Packages:FractalsModel:MassFr1_FitKsi, help={"Fit the Correlation length, select good starting conditions and appropriate limits"}
     
    181187        SetVariable MassFr1_KsiMax,limits={0,inf,0},value= root:Packages:FractalsModel:MassFr1_KsiMax, help={"Correlation length high limit"}
    182188
    183 
    184         SetVariable MassFr1_Beta,pos={14,420},size={220,16},proc=IR1V_PanelSetVarProc,title="Particle aspect ratio                    "
     189        CheckBox MassFr1_UseUFFormFactor,pos={20,400},size={200,16},proc=IR1V_InputPanelCheckboxProc,title="Use UF Particle Form factor? "
     190        CheckBox MassFr1_UseUFFormFactor,variable= root:Packages:FractalsModel:MassFr1_UseUFFormFactor, help={"Check to use Unified Fit Form Factor. Beta=1 = Primary particle is sphere."}
     191
     192        SetVariable MassFr1_Beta,pos={14,420},size={320,16},proc=IR1V_PanelSetVarProc,title="Particle aspect ratio                           "
    185193        SetVariable MassFr1_Beta,limits={0.01,100,0.1},value= root:Packages:FractalsModel:MassFr1_Beta, help={"Beta, aspect ratio of particles, should be about 0.5 and 2"}
    186         SetVariable MassFr1_Contrast,pos={14,440},size={220,16},proc=IR1V_PanelSetVarProc,title="Contrast [x 10^20]                      "
     194        SetVariable MassFr1_Contrast,pos={14,440},size={320,16},proc=IR1V_PanelSetVarProc,title="Contrast [x 10^20]                           "
    187195        SetVariable MassFr1_Contrast,limits={0,inf,1},value= root:Packages:FractalsModel:MassFr1_Contrast, help={"Scattering contrast"}
    188         SetVariable MassFr1_Eta,pos={14,460},size={220,16},proc=IR1V_PanelSetVarProc,title="Volume filling                              "
     196        SetVariable MassFr1_Eta,pos={14,460},size={320,16},proc=IR1V_PanelSetVarProc,title="Volume filling                                    "
    189197        SetVariable MassFr1_Eta,limits={0.3,0.8,0.05},value= root:Packages:FractalsModel:MassFr1_Eta, help={"Eta (filling of the volume) about 0.4 to 0.6 "}
    190         SetVariable MassFr1_IntgNumPnts,pos={14,480},size={220,16},proc=IR1V_PanelSetVarProc,title="Internal Integration Num pnts     "
     198        SetVariable MassFr1_IntgNumPnts,pos={14,480},size={320,16},proc=IR1V_PanelSetVarProc,title="Internal Integration Num pnts             "
    191199        SetVariable MassFr1_IntgNumPnts,limits={50,500,50},value= root:Packages:FractalsModel:MassFr1_IntgNumPnts, help={"Number of points for internal integration. About 500 is usual, increase if there are artefacts. "}
    192200
     
    194202
    195203        SetVariable MassFr2_Phi,pos={14,295},size={160,16},proc=IR1V_PanelSetVarProc,title="Particle volume   "
    196         SetVariable MassFr2_Phi,limits={0,inf,root:Packages:FractalsModel:MassFr2_PhiStep},value= root:Packages:FractalsModel:MassFr2_Phi, help={"Volme of particles in the system"}
     204        NVAR MassFr2_PhiStep = root:Packages:FractalsModel:MassFr2_PhiStep
     205        SetVariable MassFr2_Phi,limits={0,inf,MassFr2_PhiStep},value= root:Packages:FractalsModel:MassFr2_Phi, help={"Volme of particles in the system"}
    197206        CheckBox MassFr2_FitPhi,pos={200,296},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    198207        CheckBox MassFr2_FitPhi,variable= root:Packages:FractalsModel:MassFr2_FitPhi, help={"Fit particle volume?, find god starting conditions and select fitting limits..."}
     
    202211        SetVariable MassFr2_PhiMax,limits={0,inf,0},value= root:Packages:FractalsModel:MassFr2_PhiMax, help={"High limit for Particle volume fitting"}
    203212
    204         SetVariable MassFr2_Radius,pos={14,320},size={160,16},proc=IR1V_PanelSetVarProc,title="Mean Radius           ", help={"Mean particle Radius"}
    205         SetVariable MassFr2_Radius,limits={0,inf,root:Packages:FractalsModel:MassFr2_RadiusStep},value= root:Packages:FractalsModel:MassFr2_Radius
     213        SetVariable MassFr2_Radius,pos={14,320},size={160,16},proc=IR1V_PanelSetVarProc,title="Mean Radius         ", help={"Mean particle Radius"}
     214        NVAR MassFr2_RadiusStep = root:Packages:FractalsModel:MassFr2_RadiusStep
     215        SetVariable MassFr2_Radius,limits={0,inf,MassFr2_RadiusStep},value= root:Packages:FractalsModel:MassFr2_Radius
    206216        CheckBox MassFr2_FitRadius,pos={200,321},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    207217        CheckBox MassFr2_FitRadius,variable= root:Packages:FractalsModel:MassFr2_FitRadius, help={"Fit Radius? Select properly starting conditions and limits"}
     
    212222
    213223        SetVariable MassFr2_Dv,pos={14,345},size={160,16},proc=IR1V_PanelSetVarProc,title="Dv (fractal dim.)  ", help={"Fractal dimension for mass fractal between 1 and 3"}
    214         SetVariable MassFr2_Dv,limits={1,3,root:Packages:FractalsModel:MassFr2_DvStep},value= root:Packages:FractalsModel:MassFr2_Dv
     224        NVAR MassFr2_DvStep = root:Packages:FractalsModel:MassFr2_DvStep
     225        SetVariable MassFr2_Dv,limits={1,3,MassFr2_DvStep},value= root:Packages:FractalsModel:MassFr2_Dv
    215226        CheckBox MassFr2_FitDv,pos={200,346},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    216227        CheckBox MassFr2_FitDv,variable= root:Packages:FractalsModel:MassFr2_FitDv, help={"Fit the Dv?, select properly the starting conditions and limits before fitting"}
     
    221232
    222233        SetVariable MassFr2_Ksi,pos={14,370},size={160,16},proc=IR1V_PanelSetVarProc,title="Correlation length ", help={"Correlation length of mass fractal, Ksi in the formula"}
    223         SetVariable MassFr2_Ksi,limits={0,inf,root:Packages:FractalsModel:MassFr2_KsiStep},value= root:Packages:FractalsModel:MassFr2_Ksi
     234        NVAR MassFr2_KsiStep = root:Packages:FractalsModel:MassFr2_KsiStep
     235        SetVariable MassFr2_Ksi,limits={0,inf,MassFr2_KsiStep},value= root:Packages:FractalsModel:MassFr2_Ksi
    224236        CheckBox MassFr2_FitKsi,pos={200,371},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    225237        CheckBox MassFr2_FitKsi,variable= root:Packages:FractalsModel:MassFr2_FitKsi, help={"Fit the correlation length, select good starting conditions and appropriate limits"}
     
    229241        SetVariable MassFr2_KsiMax,limits={0,inf,0},value= root:Packages:FractalsModel:MassFr2_KsiMax, help={"Correlation length high limit"}
    230242
    231 
    232         SetVariable MassFr2_Beta,pos={14,420},size={220,16},proc=IR1V_PanelSetVarProc,title="Particle aspect ratio                    "
     243        CheckBox MassFr2_UseUFFormFactor,pos={20,400},size={200,16},proc=IR1V_InputPanelCheckboxProc,title="Use UF Particle Form factor? "
     244        CheckBox MassFr2_UseUFFormFactor,variable= root:Packages:FractalsModel:MassFr2_UseUFFormFactor, help={"Check to use Unified Fit Form Factor. Beta=1 = Primary particle is sphere."}
     245
     246        SetVariable MassFr2_Beta,pos={14,420},size={320,16},proc=IR1V_PanelSetVarProc,title="Particle aspect ratio                           "
    233247        SetVariable MassFr2_Beta,limits={0.01,100,0.1},value= root:Packages:FractalsModel:MassFr2_Beta, help={"Beta, aspect ratio of particles, should be about 0.5 and 2"}
    234         SetVariable MassFr2_Contrast,pos={14,440},size={220,16},proc=IR1V_PanelSetVarProc,title="Contrast [x 10^20]                      "
     248        SetVariable MassFr2_Contrast,pos={14,440},size={320,16},proc=IR1V_PanelSetVarProc,title="Contrast [x 10^20]                           "
    235249        SetVariable MassFr2_Contrast,limits={0,inf,1},value= root:Packages:FractalsModel:MassFr2_Contrast, help={"Scattering contrast"}
    236         SetVariable MassFr2_Eta,pos={14,460},size={220,16},proc=IR1V_PanelSetVarProc,title="Volume filling                              "
     250        SetVariable MassFr2_Eta,pos={14,460},size={320,16},proc=IR1V_PanelSetVarProc,title="Volume filling                                    "
    237251        SetVariable MassFr2_Eta,limits={0.3,0.8,0.05},value= root:Packages:FractalsModel:MassFr2_Eta, help={"Eta (filling of the volume) about 0.4 to 0.6 "}
    238         SetVariable MassFr2_IntgNumPnts,pos={14,480},size={220,16},proc=IR1V_PanelSetVarProc,title="Internal Integration Num pnts     "
     252        SetVariable MassFr2_IntgNumPnts,pos={14,480},size={320,16},proc=IR1V_PanelSetVarProc,title="Internal Integration Num pnts             "
    239253        SetVariable MassFr2_IntgNumPnts,limits={50,500,50},value= root:Packages:FractalsModel:MassFr2_IntgNumPnts, help={"Number of points for internal integration. About 500 is usual, increase if there are artefacts. "}
    240254
     
    242256        TitleBox SurfFract1_Title, title="   Surface fractal 1 controls    ", frame=1, labelBack=(0,64000,0), pos={16,272},size={128,17},fixedSize=1
    243257
     258        NVAR SurfFr1_SurfaceStep = root:Packages:FractalsModel:SurfFr1_SurfaceStep
     259
    244260        SetVariable SurfFr1_Surface,pos={14,295},size={160,16},proc=IR1V_PanelSetVarProc,title="Smooth surface   "
    245         SetVariable SurfFr1_Surface,limits={0,inf,root:Packages:FractalsModel:SurfFr1_SurfaceStep},value= root:Packages:FractalsModel:SurfFr1_Surface, help={"Smooth surface in this surface fractal"}
     261        SetVariable SurfFr1_Surface,limits={0,inf,SurfFr1_SurfaceStep},value= root:Packages:FractalsModel:SurfFr1_Surface, help={"Smooth surface in this surface fractal"}
    246262        CheckBox SurfFr1_FitSurface,pos={200,296},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    247263        CheckBox SurfFr1_FitSurface,variable= root:Packages:FractalsModel:SurfFr1_FitSurface, help={"Fit smooth surface?, find god starting conditions and select fitting limits..."}
     
    252268
    253269        SetVariable SurfFr1_DS,pos={14,345},size={160,16},proc=IR1V_PanelSetVarProc,title="Ds (fractal dim.)  ", help={"Fractal dimension, 2 to 3 for surface fractals, gives -(6-DS) slope (-3 to -4)"}
    254         SetVariable SurfFr1_DS,limits={2,3,root:Packages:FractalsModel:SurfFr1_DSStep},value= root:Packages:FractalsModel:SurfFr1_DS
     270        NVAR SurfFr1_DSStep = root:Packages:FractalsModel:SurfFr1_DSStep
     271        SetVariable SurfFr1_DS,limits={2,3,SurfFr1_DSStep},value= root:Packages:FractalsModel:SurfFr1_DS
    255272        CheckBox SurfFr1_fitDS,pos={200,346},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    256273        CheckBox SurfFr1_fitDS,variable= root:Packages:FractalsModel:SurfFr1_FitDS, help={"Fit the DS?, select properly the starting conditions and limits before fitting"}
     
    261278
    262279        SetVariable SurfFr1_Ksi,pos={14,370},size={160,16},proc=IR1V_PanelSetVarProc,title="Correlation length  ", help={"Correlation length of surface fractal, Ksi in the formula"}
    263         SetVariable SurfFr1_Ksi,limits={0,inf,root:Packages:FractalsModel:SurfFr1_KsiStep},value= root:Packages:FractalsModel:SurfFr1_Ksi
     280        NVAR SurfFr1_KsiStep = root:Packages:FractalsModel:SurfFr1_KsiStep
     281        SetVariable SurfFr1_Ksi,limits={0,inf,SurfFr1_KsiStep},value= root:Packages:FractalsModel:SurfFr1_Ksi
    264282        CheckBox SurfFr1_FitKsi,pos={200,371},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    265283        CheckBox SurfFr1_FitKsi,variable= root:Packages:FractalsModel:SurfFr1_FitKsi, help={"Fit the Correlation legth, select good starting conditions and appropriate limits"}
     
    270288
    271289        SetVariable SurfFr1_Qc,pos={14,395},size={160,16},proc=IR1V_PanelSetVarProc,title="Qc (Terminal Q)  ", help={"Q max when scattering changes to Porod's law"}
    272         SetVariable SurfFr1_Qc,limits={0,inf,root:Packages:FractalsModel:SurfFr1_QcStep},value= root:Packages:FractalsModel:SurfFr1_Qc
     290        NVAR SurfFr1_QcStep = root:Packages:FractalsModel:SurfFr1_QcStep
     291        SetVariable SurfFr1_Qc,limits={0,inf,SurfFr1_QcStep},value= root:Packages:FractalsModel:SurfFr1_Qc
    273292
    274293        PopupMenu SurfFr1_QcW,pos={14,415},size={180,16},title="Qc width [% of Qc] ", help={"Transition width at Q max when scattering changes to Porod's law"}
    275         PopupMenu SurfFr1_QcW,proc=IR1V_PopMenuProc,value="5;10;15;20;25;", mode=1+whichListItem(num2str(100*root:Packages:FractalsModel:SurfFr1_QcWidth), "5;10;15;20;25;")
     294        NVAR SurfFr1_QcWidth = root:Packages:FractalsModel:SurfFr1_QcWidth
     295        PopupMenu SurfFr1_QcW,proc=IR1V_PopMenuProc,value="5;10;15;20;25;", mode=1+whichListItem(num2str(100*SurfFr1_QcWidth), "5;10;15;20;25;")
    276296
    277297        SetVariable SurfFr1_Contrast,pos={14,450},size={220,16},proc=IR1V_PanelSetVarProc,title="Contrast [x 10^20]              "
     
    282302
    283303        SetVariable SurfFr2_Surface,pos={14,295},size={160,16},proc=IR1V_PanelSetVarProc,title="Smooth surface   "
    284         SetVariable SurfFr2_Surface,limits={0,inf,root:Packages:FractalsModel:SurfFr2_SurfaceStep},value= root:Packages:FractalsModel:SurfFr2_Surface, help={"Smooth surface in this surface fractal"}
     304        NVAR SurfFr2_SurfaceStep = root:Packages:FractalsModel:SurfFr2_SurfaceStep
     305        SetVariable SurfFr2_Surface,limits={0,inf,SurfFr2_SurfaceStep},value= root:Packages:FractalsModel:SurfFr2_Surface, help={"Smooth surface in this surface fractal"}
    285306        CheckBox SurfFr2_FitSurface,pos={200,296},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    286307        CheckBox SurfFr2_FitSurface,variable= root:Packages:FractalsModel:SurfFr2_FitSurface, help={"Fit smooth surface?, find god starting conditions and select fitting limits..."}
     
    291312
    292313        SetVariable SurfFr2_DS,pos={14,345},size={160,16},proc=IR1V_PanelSetVarProc,title="Ds (fractal dim.)  ", help={"Fractal dimension, 2 to 3 for surface fractals, gives -(6-DS) slope (-3 to -4)"}
    293         SetVariable SurfFr2_DS,limits={2,3,root:Packages:FractalsModel:SurfFr2_DSStep},value= root:Packages:FractalsModel:SurfFr2_DS
     314        NVAR SurfFr2_DSStep = root:Packages:FractalsModel:SurfFr2_DSStep
     315        SetVariable SurfFr2_DS,limits={2,3,SurfFr2_DSStep},value= root:Packages:FractalsModel:SurfFr2_DS
    294316        CheckBox SurfFr2_fitDS,pos={200,346},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    295317        CheckBox SurfFr2_fitDS,variable= root:Packages:FractalsModel:SurfFr2_FitDS, help={"Fit the DS?, select properly the starting conditions and limits before fitting"}
     
    300322
    301323        SetVariable SurfFr2_Ksi,pos={14,370},size={160,16},proc=IR1V_PanelSetVarProc,title="Correlation length  ", help={"Correlation length of surface fractal, Ksi in the formula"}
    302         SetVariable SurfFr2_Ksi,limits={0,inf,root:Packages:FractalsModel:SurfFr1_KsiStep},value= root:Packages:FractalsModel:SurfFr2_Ksi
     324        NVAR SurfFr1_KsiStep = root:Packages:FractalsModel:SurfFr1_KsiStep
     325        SetVariable SurfFr2_Ksi,limits={0,inf,SurfFr1_KsiStep},value= root:Packages:FractalsModel:SurfFr2_Ksi
    303326        CheckBox SurfFr2_FitKsi,pos={200,371},size={80,16},proc=IR1V_InputPanelCheckboxProc,title=" "
    304327        CheckBox SurfFr2_FitKsi,variable= root:Packages:FractalsModel:SurfFr2_FitKsi, help={"Fit the Correlation length, select good starting conditions and appropriate limits"}
     
    309332
    310333        SetVariable SurfFr2_Qc,pos={14,395},size={160,16},proc=IR1V_PanelSetVarProc,title="Qc (Terminal Q)  ", help={"Q max when scattering changes to Porod's law"}
    311         SetVariable SurfFr2_Qc,limits={0,inf,root:Packages:FractalsModel:SurfFr2_QcStep},value= root:Packages:FractalsModel:SurfFr2_Qc
     334        NVAR SurfFr2_QcStep = root:Packages:FractalsModel:SurfFr2_QcStep
     335        SetVariable SurfFr2_Qc,limits={0,inf,SurfFr2_QcStep},value= root:Packages:FractalsModel:SurfFr2_Qc
    312336
    313337        PopupMenu SurfFr2_QcW,pos={14,415},size={180,16},title="Qc width [% of Qc] ", help={"Transition width at Q max when scattering changes to Porod's law"}
    314         PopupMenu SurfFr2_QcW,proc=IR1V_PopMenuProc,value="5;10;15;20;25;", mode=1+whichListItem(num2str(100*root:Packages:FractalsModel:SurfFr2_QcWidth), "5;10;15;20;25;")
     338        NVAR SurfFr2_QcWidth = root:Packages:FractalsModel:SurfFr2_QcWidth
     339        PopupMenu SurfFr2_QcW,proc=IR1V_PopMenuProc,value="5;10;15;20;25;", mode=1+whichListItem(num2str(100*SurfFr2_QcWidth), "5;10;15;20;25;")
    315340
    316341        SetVariable SurfFr2_Contrast,pos={14,450},size={220,16},proc=IR1A_PanelSetVarProc,title="Contrast [x 10^20]              "
     
    382407        NVAR UseMassFract2=root:Packages:FractalsModel:UseMassFract2
    383408        NVAR UseSurfFract2=root:Packages:FractalsModel:UseSurfFract2
     409        NVAR MassFr2_UseUFFormFactor=root:Packages:FractalsModel:MassFr2_UseUFFormFactor
     410        NVAR MassFr1_UseUFFormFactor=root:Packages:FractalsModel:MassFr1_UseUFFormFactor
     411
    384412//      Mass fractal 1 controls
    385413       
     
    405433        SetVariable MassFr1_Eta, disable= (tab!=0 || !UseMassFract1)
    406434        SetVariable MassFr1_IntgNumPnts, disable= (tab!=0 || !UseMassFract1)
    407        
     435        CheckBox MassFr1_UseUFFormFactor,  disable= (tab!=0 || !UseMassFract1)
     436        if(MassFr1_UseUFFormFactor)
     437                SetVariable MassFr1_Beta, disable=1
     438        endif   
    408439        TitleBox SurfFract1_Title, disable= (tab!=1 || !UseSurfFract1)
    409440
     
    445476        SetVariable MassFr2_Eta, disable= (tab!=2 || !UseMassFract2)
    446477        SetVariable MassFr2_IntgNumPnts, disable= (tab!=2 || !UseMassFract2)
     478        CheckBox MassFr2_UseUFFormFactor,  disable= (tab!=2 || !UseMassFract2)
     479        if(MassFr2_UseUFFormFactor)
     480                SetVariable MassFr2_Beta, disable=1
     481        endif
    447482       
    448483        TitleBox SurfFract2_Title, disable= (tab!=3 || !UseSurfFract2)
     
    483518        string oldDf=GetDataFolder(1)
    484519        setDataFolder root:Packages:FractalsModel
     520        ControlInfo/W=IR1V_ControlPanel DistTabs
     521        VARIABLE ActiveTab=V_Value
    485522
    486523        if (cmpstr(ctrlName,"UseIndra2Data")==0)
     
    534571        endif
    535572
     573
     574        if (cmpstr(ctrlName,"MassFr2_UseUFFormFactor")==0)
     575                NVAR MassFr2_UseUFFormFactor=root:Packages:FractalsModel:MassFr2_UseUFFormFactor
     576                SetVariable MassFr2_Beta, win=IR1V_ControlPanel,  disable=MassFr2_UseUFFormFactor
     577                IR1V_AutoUpdateIfSelected()
     578        endif
     579
     580        if (cmpstr(ctrlName,"MassFr1_UseUFFormFactor")==0)
     581                NVAR MassFr1_UseUFFormFactor=root:Packages:FractalsModel:MassFr1_UseUFFormFactor
     582                SetVariable MassFr1_Beta, win=IR1V_ControlPanel, disable=MassFr1_UseUFFormFactor
     583                IR1V_AutoUpdateIfSelected()
     584        endif
     585
    536586        if (cmpstr(ctrlName,"DisplayLocalFits")==0)
    537587//              //here we control the data structure checkbox
     
    561611        endif
    562612       
    563         ControlInfo DistTabs
    564         IR1V_TabPanelControl("",V_Value)
     613        IR1V_TabPanelControl("",ActiveTab)
    565614        DoWIndow/F IR1V_ControlPanel
    566615        setDataFolder oldDF
     
    18101859        setDataFolder root:Packages:FractalsModel
    18111860
    1812         NVAR Phi=$("MassFr"+num2str(which)+"_Phi")
    1813         NVAR Radius=$("MassFr"+num2str(which)+"_Radius")
    1814         NVAR Dv=$("MassFr"+num2str(which)+"_Dv")
    1815         NVAR Ksi=$("MassFr"+num2str(which)+"_Ksi")
    1816         NVAR BetaVar=$("MassFr"+num2str(which)+"_Beta")
    1817         NVAR Contrast=$("MassFr"+num2str(which)+"_Contrast")
    1818         NVAR Eta=$("MassFr"+num2str(which)+"_Eta")
     1861        NVAR Phi=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Phi")
     1862        NVAR Radius=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Radius")
     1863        NVAR Dv=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Dv")
     1864        NVAR Ksi=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Ksi")
     1865        NVAR BetaVar=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Beta")
     1866        NVAR Contrast=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Contrast")
     1867        NVAR Eta=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_Eta")
     1868        NVAR UseUFFormFactor=$("root:Packages:FractalsModel:MassFr"+num2str(which)+"_UseUFFormFactor")
    18191869       
    18201870
     
    18321882        variable Bracket
    18331883        Bracket = ( Eta * RC^3 / (BetaVar * Radius^3)) * ((Ksi/RC)^Dv )
    1834         if(BetaVar!=1)
    1835                 tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_CalculateFSquared(which,Qvec)
     1884        if(UseUFFormFactor)                                                             //use Unified fit Form factor for sphere...
     1885                tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_UnifiedSphereFFSquared(which,Qvec)
    18361886        else
    1837                 tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_SphereFFSquared(which,Qvec)
     1887                if(BetaVar!=1)
     1888                        tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_CalculateFSquared(which,Qvec)
     1889                else
     1890                        tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_SphereFFSquared(which,Qvec)
     1891                endif
    18381892        endif
    18391893        //      tempFractFitIntensity*=1e-48                                                                    //this is conversion for Volume of particles from A to cm
     
    18571911
    18581912        return  ((3/(QR*QR*QR))*(sin(QR)-(QR*cos(QR))))^2
     1913end
     1914
     1915
     1916///******************************************************************************************
     1917///******************************************************************************************
     1918///******************************************************************************************
     1919///******************************************************************************************
     1920
     1921Function IR1V_UnifiedSphereFFSquared(which, Qvalue)
     1922        variable Qvalue, which                                                                          //does the math for Unified fit Sphere Form factor function
     1923
     1924        NVAR Radius=$("MassFr"+num2str(which)+"_Radius")
     1925
     1926   Variable G1=1, P1=4, Rg1=sqrt(3/5)*radius
     1927   variable B1=1.62*G1/Rg1^4
     1928   variable QstarVector=qvalue/(erf(qvalue*Rg1/sqrt(6)))^3
     1929   variable result =G1*exp(-qvalue^2*Rg1^2/3)+(B1/QstarVector^P1)
     1930   return (result)                      //normalized to one
    18591931end
    18601932
     
    21762248        ListOfVariables+="MassFr2_PhiMin;MassFr2_PhiMax;MassFr2_PhiStep;MassFr2_RadiusMin;MassFr2_RadiusMax;MassFr2_RadiusStep;"
    21772249        ListOfVariables+="MassFr2_DvMin;MassFr2_DvMax;MassFr2_DvStep;MassFr2_KsiMin;MassFr2_KsiMax;MassFr2_KsiStep;MassFr2_FitMin;MassFr2_FitMax;"
     2250
     2251        ListOfVariables+="MassFr1_UseUFFormFactor;MassFr2_UseUFFormFactor;"
    21782252       
    21792253        ListOfVariables+="SurfFr1_Surface;SurfFr1_Ksi;SurfFr1_DS;SurfFr1_Contrast;"
  • trunk/User Procedures/Irena/IR1_ImportData.ipf

    r807 r856  
    874874                        EndPointsToRemove=binarysearch(TempQvector,TrimDataQMax)
    875875                endif
    876                 if(TrimDataQMin>0)
     876                if(TrimDataQMin>0 && StartPointsToRemove>0)
    877877                        TempQvector[0,StartPointsToRemove]=NaN
    878878                endif
    879                 if(TrimDataQMax>0 && TrimDataQMax<TempQvector[inf])
     879                if(TrimDataQMax>0 && TrimDataQMax<TempQvector[inf] && EndPointsToRemove>0)
    880880                        TempQvector[EndPointsToRemove+1,inf]=NaN
    881881                endif
  • trunk/User Procedures/Irena/Modification history.txt

    r853 r856  
    1111Modification history:
    1212********************************************
     132.691 (beta)
     14Fractals - added optional use of Unified Fit Sphere form factor. This removes high-q Bessel function oscillations which are nto reasonable for most cases.
     15
     16
    13172.69 2/9/2020
    14183D models - added new set of tools : 3DAggregate, 2PhaseSolid and support for import of data from SAXSMorph (POV) and ATSAS (PDB) for visualization
  • trunk/User Procedures/Irena_CalcSavedCompounds

    • Property svn:ignore
      •  

        old new  
        77MoS2.dat
        88WS2.dat
         9Apatite_Ca10PO46OH2.dat
         10Ca3P2O8_TriCalciumPhosphate.dat
         11CaCO3_Calcite.dat
Note: See TracChangeset for help on using the changeset viewer.