Changeset 3163


Ignore:
Timestamp:
Nov 28, 2017 10:06:41 AM (5 years ago)
Author:
vondreele
Message:

fix typo in Tb neutron scattering factors; extra space
fix lst output of neutron resonant form factors - computations were correct
implement import of mcif files.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r3157 r3163  
    860860            isotope = bldata[0]
    861861            mass = bldata[1]['Mass']
    862             if 'SL' in bldata[1]:
     862            if 'BW-LS' in bldata[1]:
     863                bres = bldata[1]['BW-LS']
     864                blen = 0
     865            else:
    863866                blen = bldata[1]['SL'][0]
    864867                bres = []
    865             else:
    866                 blen = 0
    867                 bres = bldata[1]['BW-LS']
    868868            line = ' %8s%11s %10.3f %8.3f'%(Ename.ljust(8),isotope.center(11),mass,blen)
    869869            for item in bres:
  • trunk/atmdata.py

    r2133 r3163  
    525525        'BW-LS':[  0.683,      88.78, 4684.9, 28.11, 52.61,0,0,0,0]},     #LS
    526526    'Gd_160':{'Mass':159.927,'SL':[   .915,      0],'SA':         .77},
    527     'Tb_ ':  {'Mass':158.925,'SL':[   .734,      0],'SA':        23.4},
     527    'Tb_':  {'Mass':158.925,'SL':[   .734,      0],'SA':        23.4},
    528528    'Tb_159':{'Mass':158.925,'SL':[   .734,      0],'SA':        23.4},
    529529    'Dy_':   {'Mass': 162.50,'SL':[   1.69,      0],'SA':        994.},
  • trunk/imports/G2phase_CIF.py

    r3137 r3163  
    3838    def __init__(self):
    3939        super(self.__class__,self).__init__( # fancy way to say ImportPhase.__init__
    40             extensionlist=('.CIF','.cif','.txt'),
     40            extensionlist=('.CIF','.cif','.txt','.mcif'),
    4141            strictExtension=False,
    4242            formatName = 'CIF',
     
    128128            E = True
    129129            Super = False
     130            magnetic = False
     131            self.Phase['General']['Type'] = 'nuclear'
    130132            SpGrp = blk.get("_symmetry_space_group_name_H-M",'')
    131133            if not SpGrp:
    132134                SpGrp = blk.get("_space_group_name_H-M_alt",'')
     135            if not SpGrp:
     136                SpGrp = blk.get("_parent_space_group.name_H-M",'')
     137                magnetic = True
     138                self.Phase['General']['Type'] = 'magnetic'
     139                self.Phase['General']['AtomPtrs'] = [3,1,10,12]
    133140            if not SpGrp:
    134141                sspgrp = blk.get("_space_group_ssg_name",'').split('(')
     
    170177            if not blk.get('_atom_site_type_symbol'):
    171178                self.isodistort_warnings += '\natom types are missing. \n Check & revise atom types as needed'
     179            if magnetic:
     180                magatomloop = blk.GetLoop('_atom_site_moment_label')
     181                magatomkeys = [i.lower() for i in magatomloop.keys()]
    172182            if blk.get('_atom_site_aniso_label'):
    173183                anisoloop = blk.GetLoop('_atom_site_aniso_label')
     
    217227                            '_atom_site_aniso_u_13' : 15,
    218228                            '_atom_site_aniso_u_23' : 16, }
     229            G2MagDict = {'_atom_site_moment_label': 0,
     230                         '_atom_site_moment_crystalaxis_x':7,
     231                         '_atom_site_moment_crystalaxis_y':8,
     232                         '_atom_site_moment_crystalaxis_z':9}
    219233
    220234            ranIdlookup = {}
    221235            for aitem in atomloop:
    222                 atomlist = ['','','',0,0,0,1.0,'',0,'I',0.01,0,0,0,0,0,0,0]
     236                if magnetic:
     237                    atomlist = ['','','',0.,0.,0.,1.0,0.,0.,0.,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.,0.]
     238                else:
     239                    atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.,0.]
    223240                atomlist[-1] = ran.randint(0,sys.maxsize) # add a random Id
    224241                while atomlist[-1] in ranIdlookup:
     
    234251                               '_atom_site_adp_type'):   #Iso or Aniso?
    235252                        if val.lower() == 'uani':
    236                             atomlist[9] = 'A'
     253                            if magnetic:
     254                                atomlist[12] = 'A'
     255                            else:
     256                                atomlist[9] = 'A'
    237257                    elif key == '_atom_site_u_iso_or_equiv':
    238258                        uisoval = cif.get_number_with_esd(val)[0]
    239                         if uisoval is not None: atomlist[10] = uisoval
     259                        if uisoval is not None:
     260                            if magnetic:
     261                                atomlist[13] = uisoval                               
     262                            else:   
     263                                atomlist[10] = uisoval
    240264                if not atomlist[1] and atomlist[0]:
    241265                    typ = atomlist[0].rstrip('0123456789-+')
     
    246270                        self.warnings += ' Atom type '+typ+' not recognized; Xe assumed\n'
    247271                if atomlist[0] in anisolabels: # does this atom have aniso values in separate loop?
    248                     atomlist[9] = 'A'  # set the aniso flag
     272                    if magnetic:
     273                        atomlist[12] = 'A'
     274                    else:
     275                        atomlist[9] = 'A'
    249276                    for val,key in zip( # load the values
    250277                            anisoloop.GetKeyedPacket('_atom_site_aniso_label',atomlist[0]),
    251278                            anisokeys):
    252279                        col = G2AtomDict.get(key)
     280                        if magnetic:
     281                            col += 3
    253282                        if col:
    254283                            atomlist[col] = cif.get_number_with_esd(val)[0]
    255                 atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData)[:2]
     284                if magnetic:
     285                    for mitem in magatomloop:
     286                        matom = mitem[G2MagDict.get('_atom_site_moment_label',-1)]
     287                        if atomlist[0] == matom:
     288                            for mval,mkey in zip(mitem,magatomkeys):
     289                                mcol = G2MagDict.get(mkey,-1)
     290                                if mcol:
     291                                    atomlist[mcol] = cif.get_number_with_esd(mval)[0]
     292                            break                           
     293                    atomlist[10],atomlist[11] = G2spc.SytSym(atomlist[3:6],SGData)[:2]
     294                else:
     295                    atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData)[:2]
    256296                atomlist[1] = G2elem.FixValence(atomlist[1])
    257297                self.Phase['Atoms'].append(atomlist)
     
    316356            self.Phase['General']['Name'] = name.strip()[:20]
    317357            self.Phase['General']['Super'] = Super
     358            if magnetic:
     359                self.Phase['General']['Type'] = 'magnetic'               
    318360            if Super:
    319361                self.Phase['General']['Type'] = 'modulated'
Note: See TracChangeset for help on using the changeset viewer.