Ignore:
Timestamp:
Dec 9, 2017 8:54:59 AM (6 years ago)
Author:
vondreele
Message:

revisions to integrate images so that masks are reused if not changed in integrate all & auto integrate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2phase_CIF.py

    r3172 r3186  
    152152            SpGrp = SpGrp.replace('_','')
    153153            # try normalizing the space group, to see if we can pick the space group out of a table
    154             SpGrpNorm = G2spc.StandardizeSpcName(SpGrp)
    155             if SpGrpNorm:
    156                 E,SGData = G2spc.SpcGroup(SpGrpNorm)
     154            E,SGData = G2spc.SpcGroup(SpGrp)
     155            if E and SpGrp:
     156                SpGrpNorm = G2spc.StandardizeSpcName(SpGrp)
     157                if SpGrpNorm:
     158                    E,SGData = G2spc.SpcGroup(SpGrpNorm)
    157159            # nope, try the space group "out of the Box"
    158             if E and SpGrp:
    159                 E,SGData = G2spc.SpcGroup(SpGrp)
    160160            if E:
    161161                if not SpGrp:
     
    196196                waveloop = blk.GetLoop('_cell_wave_vector_seq_id')
    197197                waveDict = dict(waveloop.items())
    198                 SuperVec = [[float(waveDict['_cell_wave_vector_x'][0].replace('?','0')),
    199                     float(waveDict['_cell_wave_vector_y'][0].replace('?','0')),
    200                     float(waveDict['_cell_wave_vector_z'][0].replace('?','0'))],False,4]
     198                SuperVec = [[cif.get_number_with_esd(waveDict['_cell_wave_vector_x'][0].replace('?','0'))[0],
     199                    cif.get_number_with_esd(waveDict['_cell_wave_vector_y'][0].replace('?','0'))[0],
     200                    cif.get_number_with_esd(waveDict['_cell_wave_vector_z'][0].replace('?','0'))[0]],False,4]
    201201            # read in atoms
    202202            self.errors = 'Error during reading of atoms'
     
    263263            ranIdlookup = {}
    264264            for aitem in atomloop:
     265                mc = 0
    265266                if magnetic:
    266                     atomlist = ['','','',0.,0.,0.,1.0,0.,0.,0.,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.]
    267                 else:
    268                     atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.]
     267                    atomlist = ['','','',0.,0.,0.,1.0, 0.,0.,0.,'',0.,'I',0.01, 0.,0.,0.,0.,0.,0.,]
     268                    mc = 3
     269                else:
     270                    atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01, 0.,0.,0.,0.,0.,0.,]
    269271                for val,key in zip(aitem,atomkeys):
    270272                    col = G2AtomDict.get(key,-1)
    271273                    if col >= 3:
    272274                        atomlist[col] = cif.get_number_with_esd(val)[0]
    273                         if col >= 11: atomlist[9] = 'A' # if any Aniso term is defined, set flag
    274                     elif col is not None:
     275                        if col >= 11: atomlist[9+mc] = 'A' # if any Aniso term is defined, set flag
     276                    elif col is not None and col != -1:
    275277                        atomlist[col] = val
    276278                    elif key in ('_atom_site_thermal_displace_type',
    277279                               '_atom_site_adp_type'):   #Iso or Aniso?
    278280                        if val.lower() == 'uani':
    279                             if magnetic:
    280                                 atomlist[12] = 'A'
    281                             else:
    282                                 atomlist[9] = 'A'
     281                            atomlist[9+mc] = 'A'
    283282                    elif key == '_atom_site_u_iso_or_equiv':
    284283                        uisoval = cif.get_number_with_esd(val)[0]
    285284                        if uisoval is not None:
    286                             if magnetic:
    287                                 atomlist[13] = uisoval                               
    288                             else:   
    289                                 atomlist[10] = uisoval
     285                            atomlist[10+mc] = uisoval
    290286                if not atomlist[1] and atomlist[0]:
    291287                    typ = atomlist[0].rstrip('0123456789-+')
     
    296292                        self.warnings += ' Atom type '+typ+' not recognized; Xe assumed\n'
    297293                if atomlist[0] in anisolabels: # does this atom have aniso values in separate loop?
    298                     if magnetic:
    299                         atomlist[12] = 'A'
    300                     else:
    301                         atomlist[9] = 'A'
    302                     for val,key in zip( # load the values
    303                             anisoloop.GetKeyedPacket('_atom_site_aniso_label',atomlist[0]),
    304                             anisokeys):
     294                    atomlist[9+mc] = 'A'
     295                    for val,key in zip(anisoloop.GetKeyedPacket('_atom_site_aniso_label',atomlist[0]),anisokeys):
    305296                        col = G2AtomDict.get(key)
    306                         if magnetic:
    307                             col += 3
    308297                        if col:
    309                             atomlist[col] = cif.get_number_with_esd(val)[0]
     298                            atomlist[col+mc] = cif.get_number_with_esd(val)[0]
    310299                if magnetic:
    311300                    for mitem in magatomloop:
     
    317306                                    atomlist[mcol] = cif.get_number_with_esd(mval)[0]
    318307                            break                           
    319                     atomlist[10],atomlist[11] = G2spc.SytSym(atomlist[3:6],SGData)[:2]
    320                 else:
    321                     atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData)[:2]
     308                atomlist[7+mc],atomlist[8+mc] = G2spc.SytSym(atomlist[3:6],SGData)[:2]
    322309                atomlist[1] = G2elem.FixValence(atomlist[1])
    323310                atomlist.append(ran.randint(0,sys.maxsize)) # add a random Id
Note: See TracChangeset for help on using the changeset viewer.