Changeset 989 for trunk/GSASIIstrIO.py


Ignore:
Timestamp:
Jul 13, 2013 10:21:12 PM (9 years ago)
Author:
toby
Message:

add constraint derivs for single xtal; allow cellFill to work without esds; update docs; fix controls copy bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r981 r989  
    10191019   
    10201020def cellFill(pfx,SGData,parmDict,sigDict):
    1021     'needs a doc string'
     1021    '''Returns the filled-out reciprocal cell (A) terms and their uncertainties
     1022    from the parameter and sig dictionaries.
     1023
     1024    :param str pfx: parameter prefix ("n::", where n is a phase number)
     1025    :param dict SGdata: a symmetry object
     1026    :param dict parmDict: a dictionary of parameters
     1027    :param dict sigDict:  a dictionary of uncertainties on parameters
     1028
     1029    :returns: A,sigA where each is a list of six terms with the A terms
     1030    '''
    10221031    if SGData['SGLaue'] in ['-1',]:
    10231032        A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
    10241033            parmDict[pfx+'A3'],parmDict[pfx+'A4'],parmDict[pfx+'A5']]
    1025         sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
    1026             sigDict[pfx+'A3'],sigDict[pfx+'A4'],sigDict[pfx+'A5']]
    10271034    elif SGData['SGLaue'] in ['2/m',]:
    10281035        if SGData['SGUniq'] == 'a':
    10291036            A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
    10301037                parmDict[pfx+'A3'],0,0]
    1031             sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
    1032                 sigDict[pfx+'A3'],0,0]
    10331038        elif SGData['SGUniq'] == 'b':
    10341039            A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
    10351040                0,parmDict[pfx+'A4'],0]
    1036             sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
    1037                 0,sigDict[pfx+'A4'],0]
    10381041        else:
    10391042            A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
    10401043                0,0,parmDict[pfx+'A5']]
    1041             sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
    1042                 0,0,sigDict[pfx+'A5']]
    10431044    elif SGData['SGLaue'] in ['mmm',]:
    10441045        A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],0,0,0]
    1045         sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],0,0,0]
    10461046    elif SGData['SGLaue'] in ['4/m','4/mmm']:
    10471047        A = [parmDict[pfx+'A0'],parmDict[pfx+'A0'],parmDict[pfx+'A2'],0,0,0]
    1048         sigA = [sigDict[pfx+'A0'],0,sigDict[pfx+'A2'],0,0,0]
    10491048    elif SGData['SGLaue'] in ['6/m','6/mmm','3m1', '31m', '3']:
    10501049        A = [parmDict[pfx+'A0'],parmDict[pfx+'A0'],parmDict[pfx+'A2'],
    10511050            parmDict[pfx+'A0'],0,0]
    1052         sigA = [sigDict[pfx+'A0'],0,sigDict[pfx+'A2'],0,0,0]
    10531051    elif SGData['SGLaue'] in ['3R', '3mR']:
    10541052        A = [parmDict[pfx+'A0'],parmDict[pfx+'A0'],parmDict[pfx+'A0'],
    10551053            parmDict[pfx+'A3'],parmDict[pfx+'A3'],parmDict[pfx+'A3']]
    1056         sigA = [sigDict[pfx+'A0'],0,0,sigDict[pfx+'A3'],0,0]
    10571054    elif SGData['SGLaue'] in ['m3m','m3']:
    10581055        A = [parmDict[pfx+'A0'],parmDict[pfx+'A0'],parmDict[pfx+'A0'],0,0,0]
    1059         sigA = [sigDict[pfx+'A0'],0,0,0,0,0]
     1056
     1057    try:
     1058        if SGData['SGLaue'] in ['-1',]:
     1059            sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
     1060                sigDict[pfx+'A3'],sigDict[pfx+'A4'],sigDict[pfx+'A5']]
     1061        elif SGData['SGLaue'] in ['2/m',]:
     1062            if SGData['SGUniq'] == 'a':
     1063                sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
     1064                    sigDict[pfx+'A3'],0,0]
     1065            elif SGData['SGUniq'] == 'b':
     1066                sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
     1067                    0,sigDict[pfx+'A4'],0]
     1068            else:
     1069                sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
     1070                    0,0,sigDict[pfx+'A5']]
     1071        elif SGData['SGLaue'] in ['mmm',]:
     1072            sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],0,0,0]
     1073        elif SGData['SGLaue'] in ['4/m','4/mmm']:
     1074            sigA = [sigDict[pfx+'A0'],0,sigDict[pfx+'A2'],0,0,0]
     1075        elif SGData['SGLaue'] in ['6/m','6/mmm','3m1', '31m', '3']:
     1076            sigA = [sigDict[pfx+'A0'],0,sigDict[pfx+'A2'],0,0,0]
     1077        elif SGData['SGLaue'] in ['3R', '3mR']:
     1078            sigA = [sigDict[pfx+'A0'],0,0,sigDict[pfx+'A3'],0,0]
     1079        elif SGData['SGLaue'] in ['m3m','m3']:
     1080            sigA = [sigDict[pfx+'A0'],0,0,0,0,0]
     1081    except KeyError:
     1082        sigA = [0,0,0,0,0,0]
     1083
    10601084    return A,sigA
    10611085       
Note: See TracChangeset for help on using the changeset viewer.