Ignore:
Timestamp:
Jul 29, 2016 3:52:31 PM (6 years ago)
Author:
vondreele
Message:

begin adding magnetism; change space group fortran code
modify tutorial menus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2phase.py

    r2116 r2401  
    260260                    self.warnings += '\nThe GSAS space group was not interpreted(!) and has been set to "P 1".'
    261261                    self.warnings += "Change this in phase's General tab."                       
     262            elif 'SPNFLP' in key:
     263                spin = {'1':'black','-1':'red'}
     264                SpnFlp = [spin[s.strip()] for s in EXPphase[key].split()]               
    262265            elif 'OD    ' in key:
    263266                SHdata = EXPphase[key].split() # may not have all 9 values
     
    276279                shNcof = int(SHvals[1])
    277280        Atoms = []
    278         if Ptype == 'nuclear':
     281        if Ptype in ['nuclear','magnetic',]:
    279282            for key in keyList:
    280283                if 'AT' in key:
     
    296299                        Atom.append(ran.randint(0,sys.maxint))
    297300                        Atoms.append(Atom)
     301                    elif key[11:] == 'M' and key[6:8] == 'AT':
     302                        S = EXPphase[key]
     303                        Mag = [float(S[:10]),float(S[10:20]),float(S[20:30])]
     304                        Atoms[-1] = Atoms[-1][:7]+Mag+Atoms[-1][7:]
    298305        elif Ptype == 'macromolecular':
    299306            for key in keyList:
     
    334341        if general['Type'] =='macromolecular':
    335342            general['AtomPtrs'] = [6,4,10,12]
    336         else:
     343        elif general['Type'] =='magnetic':
     344            general['AtomPtrs'] = [3,1,10,12]
     345            general['SGData']['SGSpin'] = SpnFlp   
     346        else:   #nuclear
    337347            general['AtomPtrs'] = [3,1,7,9]   
    338348        general['SH Texture'] = textureData
     
    440450                if nqi:
    441451                    raise self.ImportException("Supersymmetry too high; GSAS-II limited to (3+1) supersymmetry")           
    442                 Type = 'modulated'
    443452                vec = S.split()[1:]
    444453                SuperVec = [[float(vec[i]) for i in range(3)],False,4]
     
    549558        Phase = G2IO.SetNewPhase(Name=Title,SGData=SGData,cell=cell+[Volume,])
    550559        Phase['General']['Type'] = Type
     560        Phase['General']['Modulated'] = True
    551561        Phase['General']['Super'] = nqi
    552562        Phase['General']['SuperVec'] = SuperVec
Note: See TracChangeset for help on using the changeset viewer.