Changeset 1762


Ignore:
Timestamp:
Mar 25, 2015 3:42:15 PM (7 years ago)
Author:
vondreele
Message:

fix exports of reflection csv & txt files to work for CW & TOF data as well as
3 & (3+1) symmetries
fix Det-X --> Det-Y
remove a Yield - caused crash
fix c-unique & a-unique monoclinit cell refinement & display
fix cif readers for phase

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1698 r1762  
    15731573    def ShowBusy(self):
    15741574        wx.BeginBusyCursor()
    1575         wx.Yield() # make it happen now!
     1575#        wx.Yield() # make it happen now!
    15761576
    15771577    def DoneBusy(self):
  • trunk/GSASIIimgGUI.py

    r1667 r1762  
    507507            Names.append('dep')
    508508        Parms = {'dist':['Distance','%.3f',data['distance']],'det-X':['Beam center X','%.3f',data['center'][0]],
    509             'det-Y':['Beam center X','%.3f',data['center'][1]],'tilt':['Tilt angle','%.3f',data['tilt']],
     509            'det-Y':['Beam center Y','%.3f',data['center'][1]],'tilt':['Tilt angle','%.3f',data['tilt']],
    510510            'phi':['Tilt rotation','%.2f',data['rotation']],'dep':['Penetration','%.2f',data['DetDepth']],
    511511            'wave':['Wavelength','%.6f',data['wavelength']]}
  • trunk/GSASIIphsGUI.py

    r1731 r1762  
    373373                [True,True,True,False],[0,1,2,0])],
    374374            [['2/m'+'a'],10,zip([" a = "," b = "," c = "," alpha = "," Vol = "],
    375                 ["%.5f","%.5f","%.5f","%.3f","%.3f"],[True,True,True,True,False],[0,1,2,5,0])],
     375                ["%.5f","%.5f","%.5f","%.3f","%.3f"],[True,True,True,True,False],[0,1,2,3,0])],
    376376            [['2/m'+'b'],10,zip([" a = "," b = "," c = "," beta = "," Vol = "],
    377377                ["%.5f","%.5f","%.5f","%.3f","%.3f"],[True,True,True,True,False],[0,1,2,4,0])],
    378378            [['2/m'+'c'],10,zip([" a = "," b = "," c = "," gamma = "," Vol = "],
    379                 ["%.5f","%.5f","%.5f","%.3f","%.3f"],[True,True,True,True,False],[0,1,2,3,0])],
     379                ["%.5f","%.5f","%.5f","%.3f","%.3f"],[True,True,True,True,False],[0,1,2,5,0])],
    380380            [['-1'],8,zip([" a = "," b = "," c = "," Vol = "," alpha = "," beta = "," gamma = "],
    381381                ["%.5f","%.5f","%.5f","%.3f","%.3f","%.3f","%.3f"],
     
    443443                        Obj.SetValue("%.3f"%(cell[5]))
    444444                elif laue in ['2/m'+'c']:
    445                     cell[5] = cell[6] = 90.
     445                    cell[4] = cell[5] = 90.
    446446                    if ObjId != 3:
    447447                        cell[ObjId+1] = value
  • trunk/GSASIIstrIO.py

    r1682 r1762  
    620620    elif SGData['SGLaue'] in ['2/m',]:
    621621        if SGData['SGUniq'] == 'a':
    622             return [pfx+'A0',pfx+'A1',pfx+'A2',pfx+'A3']
     622            return [pfx+'A0',pfx+'A1',pfx+'A2',pfx+'A5']
    623623        elif SGData['SGUniq'] == 'b':
    624624            return [pfx+'A0',pfx+'A1',pfx+'A2',pfx+'A4']
    625625        else:
    626             return [pfx+'A0',pfx+'A1',pfx+'A2',pfx+'A5']
     626            return [pfx+'A0',pfx+'A1',pfx+'A2',pfx+'A3']
    627627    elif SGData['SGLaue'] in ['mmm',]:
    628628        return [pfx+'A0',pfx+'A1',pfx+'A2']
     
    12591259        if SGData['SGUniq'] == 'a':
    12601260            A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
    1261                 parmDict[pfx+'A3'],0,0]
     1261                0,0,parmDict[pfx+'A5']]
    12621262        elif SGData['SGUniq'] == 'b':
    12631263            A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
     
    12651265        else:
    12661266            A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],
    1267                 0,0,parmDict[pfx+'A5']]
     1267                parmDict[pfx+'A3'],0,0]
    12681268    elif SGData['SGLaue'] in ['mmm',]:
    12691269        A = [parmDict[pfx+'A0'],parmDict[pfx+'A1'],parmDict[pfx+'A2'],0,0,0]
     
    12861286            if SGData['SGUniq'] == 'a':
    12871287                sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
    1288                     sigDict[pfx+'A3'],0,0]
     1288                    0,0,sigDict[pfx+'A5']]
    12891289            elif SGData['SGUniq'] == 'b':
    12901290                sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
     
    12921292            else:
    12931293                sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],
    1294                     0,0,sigDict[pfx+'A5']]
     1294                    sigDict[pfx+'A3'],0,0]
    12951295        elif SGData['SGLaue'] in ['mmm',]:
    12961296            sigA = [sigDict[pfx+'A0'],sigDict[pfx+'A1'],sigDict[pfx+'A2'],0,0,0]
     
    14511451    var = np.diag(sigMat)
    14521452    CS = np.where(var>0.,np.sqrt(var),0.)
    1453     return [CS[0],CS[1],CS[2],CS[5],CS[4],CS[3],sigVol]  #exchange sig(alp) & sig(gam) to get in right order
     1453    return [CS[0],CS[1],CS[2],CS[5],CS[4],CS[3],sigVol]
    14541454   
    14551455def SetPhaseData(parmDict,sigDict,Phases,RBIds,covData,RestraintDict=None,pFile=None):
  • trunk/GSASIIstrMath.py

    r1761 r1762  
    20222022        elif SGData['SGLaue'] in ['2/m',]:
    20232023            if SGData['SGUniq'] == 'a':
    2024                 return [[pfx+'A0',dpdA[0]],[pfx+'A1',dpdA[1]],[pfx+'A2',dpdA[2]],[pfx+'A3',dpdA[3]]]
     2024                return [[pfx+'A0',dpdA[0]],[pfx+'A1',dpdA[1]],[pfx+'A2',dpdA[2]],[pfx+'A5',dpdA[5]]]
    20252025            elif SGData['SGUniq'] == 'b':
    20262026                return [[pfx+'A0',dpdA[0]],[pfx+'A1',dpdA[1]],[pfx+'A2',dpdA[2]],[pfx+'A4',dpdA[4]]]
    20272027            else:
    2028                 return [[pfx+'A0',dpdA[0]],[pfx+'A1',dpdA[1]],[pfx+'A2',dpdA[2]],[pfx+'A5',dpdA[5]]]
     2028                return [[pfx+'A0',dpdA[0]],[pfx+'A1',dpdA[1]],[pfx+'A2',dpdA[2]],[pfx+'A3',dpdA[3]]]
    20292029        elif SGData['SGLaue'] in ['mmm',]:
    20302030            return [[pfx+'A0',dpdA[0]],[pfx+'A1',dpdA[1]],[pfx+'A2',dpdA[2]]]
  • trunk/exports/G2export_csv.py

    r1761 r1762  
    246246        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
    247247            phasDict = histblk['Reflection Lists'][phasenam]
    248             if phasDict['Super']:
    249                 WriteList(self,("h","k","l","m","2-theta","F_obs","F_calc","phase","mult","phase #"))
     248            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
     249            if phasDict.get('Super',False):
     250                WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","phase #"))
    250251                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
    251252                refList = phasDict['RefList']
    252253                for refItem in refList:
    253                     h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
     254                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]
    254255                    self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,i))               
    255256            else:
    256                 WriteList(self,("h","k","l","2-theta","F_obs","F_calc","phase","mult","phase #"))
     257                WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","phase #"))
    257258                fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
    258259                refList = phasDict['RefList']
    259260                for refItem in refList:
    260                     h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:11]
     261                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
    261262                    self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
    262263        self.CloseFile()
     
    289290        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
    290291        histblk = self.Histograms[hist]
    291         WriteList(self,("h","k","l","d-space","F_obs","sig(Fobs)","F_calc","phase","mult"))
    292         fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.2f},{:.4f},{:.2f},{:.2f},{:.0f}"
    293         for (
    294             h,k,l,mult,dsp,Fobs,sigFobs,Fcalc,FobsT,FcalcT,phase,Icorr
    295             ) in histblk['Data']['RefList']:
    296             self.Write(fmt.format(h,k,l,dsp,Fobs,sigFobs,Fcalc,phase,mult))
     292        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
     293            phasDict = histblk['Reflection Lists'][phasenam]
     294            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
     295            if phasDict.get('Super',False):
     296                WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","phase #"))
     297                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     298                refList = phasDict['RefList']
     299                for refItem in refList:
     300                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]
     301                    self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,i))               
     302            else:
     303                WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","phase #"))
     304                fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     305                refList = phasDict['RefList']
     306                for refItem in refList:
     307                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
     308                    self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
    297309        self.CloseFile()
    298310        print(str(hist)+' written to file '+str(self.fullname))                       
  • trunk/exports/G2export_examples.py

    r1261 r1762  
    188188        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
    189189        histblk = self.Histograms[hist]
    190         hklfmt = "{:.0f},{:.0f},{:.0f}"
    191         hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s}"
    192         fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f}"
    193190        for phasenam in histblk['Reflection Lists']:
     191            phasDict = histblk['Reflection Lists'][phasenam]
     192            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
    194193            self.Write('\nPhase '+str(phasenam))
    195194            self.Write(80*'=')
    196             self.Write(hfmt.format("h,k,l","2-theta","F_obs","F_calc","phase","mult"))
    197             self.Write(80*'=')
    198             for (
    199                 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr
    200                 ) in histblk['Reflection Lists'][phasenam]['RefList']:
    201                 self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult))
     195            if phasDict.get('Super',False):
     196                hklfmt = "{:.0f},{:.0f},{:.0f},{:.0f}"
     197                hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s}"
     198                fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f}"
     199                self.Write(hfmt.format("h,k,l,m",tname,"F_obs","F_calc","phase","mult"))
     200                self.Write(80*'=')
     201                refList = phasDict['RefList']
     202                for refItem in refList:
     203                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase = refItem[:12]
     204                    self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult))
     205            else:
     206                hklfmt = "{:.0f},{:.0f},{:.0f}"
     207                hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s}"
     208                fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f}"
     209                self.Write(hfmt.format("h,k,l",tname,"F_obs","F_calc","phase","mult"))
     210                self.Write(80*'=')
     211                refList = phasDict['RefList']
     212                for refItem in refList:
     213                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase = refItem[:11]
     214                    self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult))
    202215        self.CloseFile()
    203216        print(str(hist)+'reflections written to file '+str(self.fullpath))                       
  • trunk/imports/G2phase.py

    r1625 r1762  
    386386        Atoms = []
    387387        Atypes = []
    388         SuperVec = [[[0,0,.1],False,4],[[0,0,.1],False,4],[[0,0,.1],False,4]]
     388        SuperVec = [[0,0,.1],False,4]
    389389        S = file.readline()
    390390        line = 1
  • trunk/imports/G2phase_CIF.py

    r1168 r1762  
    5656            '_cell_length_a','_cell_length_b','_cell_length_c',
    5757            '_cell_angle_alpha','_cell_angle_beta','_cell_angle_gamma',)
     58        cellwaveitems = (
     59            '_cell_wave_vector_seq_id',
     60            '_cell_wave_vector_x','_cell_wave_vector_y','_cell_wave_vector_z')
    5861        reqitems = (
    5962             '_atom_site_fract_x',
     
    129132                blk = cf[str_blklist[selblk]]
    130133                E = True
     134                Super = False
    131135                SpGrp = blk.get("_symmetry_space_group_name_H-M",'')
    132136                if not SpGrp:
    133137                    SpGrp = blk.get("_space_group_name_H-M_alt",'')
     138                if not SpGrp:
     139                    sspgrp = blk.get("_space_group_ssg_name",'').split('(')
     140                    SpGrp = sspgrp[0]
     141                    SuperSg = '('+sspgrp[1].replace('\\','')
     142                    Super = True
     143                    SuperVec = [[0,0,.1],False,4]
    134144                # try normalizing the space group, to see if we can pick the space group out of a table
    135145                SpGrpNorm = G2spc.StandardizeSpcName(SpGrp)
     
    237247                    name = blknm
    238248                self.Phase['General']['Name'] = name.strip()[:20]
     249                self.Phase['General']['Super'] = Super
     250                if Super:
     251                    self.Phase['General']['Type'] = 'modulated'
     252                    self.Phase['General']['SuperVec'] = SuperVec
     253                    self.Phase['General']['SuperSg'] = SuperSg
     254                    self.Phase['General']['SSGData'] = G2spc.SSpcGroup(SGData,SuperSg)[1]
    239255                if not self.isodistort_warnings:
    240256                    if blk.get('_iso_displacivemode_label') or blk.get('_iso_occupancymode_label'):
  • trunk/imports/G2sfact.py

    r1655 r1762  
    7272                # h,k,l,m,dsp,Fo2,sig,Fc2,Fot2,Fct2,phase,...
    7373                self.RefDict['RefList'].append([h,k,l,0,0,Fo**2,2.*Fo*sigFo,0,Fo**2,0,0,0])
    74                 #self.RefDict['FF'].append({}) # now done in OnImportSfact
    7574            self.errors = 'Error after reading reflections (unexpected!)'
    7675            self.RefDict['RefList'] = np.array(self.RefDict['RefList'])
  • trunk/imports/G2sfact_CIF.py

    r1601 r1762  
    317317                    continue # skip over incompletely parsed reflections
    318318                self.RefDict['RefList'].append(ref)
    319                 self.RefDict['FF'].append({})
     319#                self.RefDict['FF'].append({})
    320320            self.RefDict['RefList'] = np.array(self.RefDict['RefList'])
    321321            self.errors = 'Error during reading of dataset parameters'
Note: See TracChangeset for help on using the changeset viewer.