Changeset 2308


Ignore:
Timestamp:
Jun 5, 2016 12:57:24 PM (7 years ago)
Author:
vondreele
Message:

add sp.shell model or SASD - Thx to L.A, Avakyan
fix (again) page switching problem with Texture
Change import string for G2img files

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIobj.py

    r2062 r2308  
    13431343        'Diameter' : 'Cylinder/disk diameter',
    13441344        'Thickness' : 'Disk thickness',
     1345        'Shell thickness' : 'Multiplier to get inner(<1) or outer(>1) sphere radius',
    13451346        'Dist' : 'Interparticle distance',
    13461347        'VolFr' : 'Dense scatterer volume fraction',
  • trunk/GSASIIplot.py

    r2307 r2308  
    16221622#    if plottype == 'PWDR':  # avoids a very nasty clash with KILL_FOCUS in SASD TextCtrl?
    16231623#        Page.SetFocus()
    1624     G2frame.G2plotNB.skipPageChange = True      #to keep Stress/Strain data tab visible
     1624#    G2frame.G2plotNB.skipPageChange = True      #to keep Stress/Strain data tab visible
    16251625    G2frame.G2plotNB.status.DestroyChildren()
    16261626    if G2frame.Contour:
     
    17441744                    Plot.set_ylabel(r'$S(Q)=I*Q^{4}$',fontsize=16)
    17451745                else:
    1746                     Plot.set_ylabel(r'$Intensity, cm^{-1}$',fontsize=16)
     1746                    Plot.set_ylabel(r'$Intensity,\ cm^{-1}$',fontsize=16)
    17471747        else:
    17481748            if G2frame.plotStyle['sqrtPlot']:
     
    32353235    Page.Choice = None
    32363236    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     3237    G2frame.G2plotNB.skipPageChange = True
    32373238    G2frame.G2plotNB.status.SetFields(['',''])   
    32383239    G2frame.G2plotNB.status.SetStatusWidths([150,-1])
  • trunk/GSASIIpwdGUI.py

    r2211 r2308  
    40354035        shapes = {'Spheroid':' Aspect ratio: ','Cylinder':' Diameter ','Cylinder AR':' Aspect ratio: ',
    40364036            'Unified sphere':'','Unified rod':' Diameter: ','Unified rod AR':' Aspect ratio: ',
    4037             'Unified disk':' Thickness: '}
     4037            'Unified disk':' Thickness: ', 'Spherical shell': ' Shell thickness'}
    40384038        partsh = wx.ComboBox(G2frame.dataDisplay,value=str(data['Size']['Shape'][0]),choices=shapes.keys(),
    40394039            style=wx.CB_READONLY|wx.CB_DROPDOWN)
     
    40914091            'Unified rod':{'Length':[100.,False]},'Unified rod AR':{'Aspect ratio':[1.0,False]},
    40924092            'Unified disk':{'Thickness':[100.,False]},
    4093             'Unified tube':{'Length':[100.,False],'Thickness':[10.,False]},}
     4093            'Unified tube':{'Length':[100.,False],'Thickness':[10.,False]},
     4094            'Spherical shell':{'Shell thickness':[1.5,False] }, }
    40944095               
    40954096        StructureFactors = {'Dilute':{},'Hard sphere':{'VolFr':[0.1,False],'Dist':[100.,False]},
     
    41004101        ffDistChoices =  ['Sphere','Spheroid','Cylinder','Cylinder diam',
    41014102            'Cylinder AR','Unified sphere','Unified rod','Unified rod AR',
    4102             'Unified disk','Unified tube',]
     4103            'Unified disk','Unified tube','Spherical shell',]
    41034104               
    41044105        ffMonoChoices = ['Sphere','Spheroid','Cylinder','Cylinder AR',]
     
    42494250                    parmSizer.Add(parmSldr,1,wx.EXPAND)
    42504251            if level['Controls']['DistType'] not in ['Bragg']:
    4251                 parmOrder = ['Aspect ratio','Length','Diameter','Thickness','VolFr','Dist','epis','Sticky','Depth','Width']
     4252                parmOrder = ['Aspect ratio','Length','Diameter','Thickness','VolFr','Dist','epis','Sticky','Depth','Width','Shell thickness',]
    42524253                fTypes = ['FF ','SF ']
    42534254                for iarg,Args in enumerate([FFargs,SFargs]):
  • trunk/GSASIIsasd.py

    r1743 r2308  
    7272    return (3./(QR**3))*(np.sin(QR)-(QR*np.cos(QR)))
    7373   
     74def SphericalShellFF(Q,R,args=()):
     75    ''' Compute spherical shell form factor - can use numpy arrays
     76    param float Q: Q value array (usually in A-1)
     77    param float R: sphere radius (Usually in A - must match Q-1 units)
     78    param array args: [float r]: controls the shell thickness: R_inner = min(r*R,R), R_outer = max(r*R,R)
     79    returns float: form factors as array as needed
     80        Contributed by: L.A. Avakyan, Southern Federal University, Russia
     81    '''
     82    r = args[0]
     83    if r < 0: # truncate to positive value
     84        r = 0
     85    if r < 1:  # r controls inner sphere radius
     86        return SphereFF(Q,R) - SphereFF(Q,R*r)
     87    else:      # r controls outer sphere radius
     88        return SphereFF(Q,R*r) - SphereFF(Q,R)
     89
    7490def SpheroidFF(Q,R,args):
    7591    ''' Compute form factor of cylindrically symmetric ellipsoid (spheroid)
     
    226242    '''
    227243    return (4./3.)*np.pi*R**3
     244
     245def SphericalShellVol(R,args):
     246    ''' Compute volume of spherical shell
     247    - numpy array friendly
     248    param float R: sphere radius
     249    param array args: [float r]: controls shell thickness, see SphericalShellFF description
     250    returns float: volume
     251    '''
     252    r = args[0]
     253    if r < 0:
     254        r = 0
     255    if r < 1:
     256        return SphereVol(R) - SphereVol(R*r)
     257    else:
     258        return SphereVol(R*r) - SphereVol(R)
    228259
    229260def SpheroidVol(R,args):
     
    10231054        'Unified rod':[UniRodFF,UniRodVol],'Unified rod AR':[UniRodARFF,UniRodARVol],
    10241055        'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol],
    1025         'Cylinder diam':[CylinderDFF,CylinderDVol]}
     1056        'Cylinder diam':[CylinderDFF,CylinderDVol],
     1057        'Spherical shell': [SphericalShellFF, SphericalShellVol]}
    10261058    Shape = data['Size']['Shape'][0]
    10271059    SlitLen = Sample.get('SlitLen',0.0)
     
    10721104        'Unified rod':[UniRodFF,UniRodVol],'Unified rod AR':[UniRodARFF,UniRodARVol],
    10731105        'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol],
    1074         'Unified tube':[UniTubeFF,UniTubeVol],'Cylinder diam':[CylinderDFF,CylinderDVol]}
     1106        'Unified tube':[UniTubeFF,UniTubeVol],'Cylinder diam':[CylinderDFF,CylinderDVol],
     1107        'Spherical shell':[SphericalShellFF,SphericalShellVol]}
    10751108           
    10761109    sfxns = {'Dilute':DiluteSF,'Hard sphere':HardSpheresSF,'Square well':SquareWellSF,
     
    10801113        'PkInt','PkPos','PkSig','PkGam',]
    10811114       
    1082     FFparmOrder = ['Aspect ratio','Length','Diameter','Thickness']
     1115    FFparmOrder = ['Aspect ratio','Length','Diameter','Thickness','Shell thickness']
    10831116   
    10841117    SFparmOrder = ['Dist','VolFr','epis','Sticky','Depth','Width']
     
    11741207                FFargs = []
    11751208                SFargs = []
    1176                 for item in [cid+'Aspect ratio',cid+'Length',cid+'Thickness',cid+'Diameter']:
     1209                for item in [cid+'Aspect ratio',cid+'Length',cid+'Thickness',cid+'Diameter',cid+'Shell thickness']:
    11771210                    if item in parmDict:
    11781211                        FFargs.append(parmDict[item])
     
    12061239                FFargs = []
    12071240                SFargs = []
    1208                 for item in [cid+'Aspect ratio',cid+'Length',cid+'Thickness',cid+'Diameter',]:
     1241                for item in [cid+'Aspect ratio',cid+'Length',cid+'Thickness',cid+'Diameter',cid+'Shell thickness']:
    12091242                    if item in parmDict:
    12101243                        FFargs.append(parmDict[item])
     
    12831316        'Unified rod':[UniRodFF,UniRodVol],'Unified rod AR':[UniRodARFF,UniRodARVol],
    12841317        'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol],
    1285         'Unified tube':[UniTubeFF,UniTubeVol],'Cylinder diam':[CylinderDFF,CylinderDVol]}
     1318        'Unified tube':[UniTubeFF,UniTubeVol],'Cylinder diam':[CylinderDFF,CylinderDVol],
     1319        'Spherical shell':[SphericalShellFF,SphericalShellVol]}
    12861320    sfxns = {'Dilute':DiluteSF,'Hard sphere':HardSpheresSF,'Square well':SquareWellSF,
    12871321            'Sticky hard sphere':StickyHardSpheresSF,'InterPrecipitate':InterPrecipitateSF,}
     
    13161350                if item in controls.get('SFargs',{}):
    13171351                    SFargs.append(controls['SFargs'][item][0])
    1318             for item in ['Aspect ratio','Length','Thickness','Diameter',]:
     1352            for item in ['Aspect ratio','Length','Thickness','Diameter','Shell thickness']:
    13191353                if item in controls['FFargs']:
    13201354                    FFargs.append(controls['FFargs'][item][0])
     
    13571391                if item in controls.get('SFargs',{}):
    13581392                    SFargs.append(controls['SFargs'][item][0])
    1359             for item in ['Aspect ratio','Length','Thickness','Diameter',]:
     1393            for item in ['Aspect ratio','Length','Thickness','Diameter','Shell thickness']:
    13601394                if item in controls['FFargs']:
    13611395                    FFargs.append(controls['FFargs'][item][0])
Note: See TracChangeset for help on using the changeset viewer.