@@ -5201,7 +5201,7 @@ def AtomModify(event):
52015201 if dlg.ShowModal() == wx.ID_OK:
52025202 parm = dlg.GetValue()
52035203 for r in indx:
5204- if not Atoms.IsReadOnly(r,0): #not if in RB!
5204+ # if not Atoms.IsReadOnly(r,0): #not if in RB!
52055205 atomData[r][cid] = parm
52065206 SetupGeneral()
52075207 FillAtomsGrid(Atoms)
@@ -5572,13 +5572,15 @@ def OnFracSplit(event):
55725572 cx,ct,cs,ci = G2mth.getAtomPtrs(data)
55735573 indx = getAtomSelections(Atoms,ct-1)
55745574 if indx:
5575+ B2 = {}
55755576 atomData = data['Atoms']
55765577 PE = G2elemGUI.PickElement(G2frame,oneOnly=True)
55775578 if PE.ShowModal() == wx.ID_OK:
55785579 Atype2 = PE.Elem.strip()
55795580 AtomInfo2 = G2elem.GetAtomInfo(Atype2)
55805581 FF2 = G2elem.GetFFtable([Atype2])[Atype2]
5581- B2 = AtomInfo2['Isotopes']['Nat. Abund.']['SL'][0]
5582+ for iso in AtomInfo2['Isotopes']:
5583+ B2[iso] = AtomInfo2['Isotopes'][iso]['SL'][0]
55825584 PE.Destroy()
55835585 SQ = 0.0
55845586 PE2 = G2G.SingleFloatDialog(G2frame,'form factor','Enter sinth/lam for atom frac split',SQ)
@@ -5588,24 +5590,36 @@ def OnFracSplit(event):
55885590 ff2 = G2elem.ScatFac(FF2,SQ**2)
55895591 print(' X-ray site fractions for sin(th)/lam = %.3f'%SQ)
55905592 for ind in indx:
5591- Aname1 = atomData[ind][ct-1]
5592- Atype1 = G2elem.FixValence(atomData[ind][ct])
5593- Afrac = atomData[ind][cx+3]
5594- Amult = float(atomData[ind][cx+5])
5595- AtomInfo1 = G2elem.GetAtomInfo(Atype1)
5596- if Atype1 == Atype2:
5597- print('ERROR - 2nd atom type must be different from selected atom')
5598- continue
5599- FF1 = G2elem.GetFFtable([Atype1])[Atype1]
5600- ff1 = G2elem.ScatFac(FF1,SQ**2)
5601- B1 = AtomInfo1['Isotopes']['Nat. Abund.']['SL'][0]
5593+ Aname1 = atomData[ind][ct-1]
5594+ Atype1 = G2elem.FixValence(atomData[ind][ct])
5595+ if Atype1 == 'Q':
5596+ PE = G2elemGUI.PickElement(G2frame,oneOnly=False)
5597+ if PE.ShowModal() == wx.ID_OK:
5598+ Atype1 = PE.Elem.strip()
5599+ PE.Destroy()
5600+ Afrac = atomData[ind][cx+3]
5601+ Amult = float(atomData[ind][cx+5])
5602+ AtomInfo1 = G2elem.GetAtomInfo(Atype1)
5603+ if Atype1 == Atype2:
5604+ print('ERROR - 2nd atom type must be different from selected atom')
5605+ continue
5606+ FF1 = G2elem.GetFFtable([Atype1])[Atype1]
5607+ ff1 = G2elem.ScatFac(FF1,SQ**2)
5608+ if ff1 != ff2:
56025609 frac1 = (ff1*Afrac-ff2)/(ff1-ff2)
5603- bfrac1 = (B1*Afrac-B2)/(B1-B2)
56045610 print(' For %s: X-ray based site fractions %s = %.3f, %.3f/cell; %s = %.3f, %.3f/cell' \
5605- %(Aname1,Atype1,frac1,frac1*Amult,Atype2,(1.-frac1),(1.-frac1)*Amult))
5606- print(' neutron based site fractions %s = %.3f, %.3f/cell; %s = %.3f, %.3f/cell\n' \
5607- %(Atype1,bfrac1,bfrac1*Amult,Atype2,(1.-bfrac1),(1.-bfrac1)*Amult))
5608-
5611+ %(Aname1,Atype1,frac1,frac1*Amult,Atype2,(1.-frac1),(1.-frac1)*Amult))
5612+
5613+ B1 = AtomInfo1['Isotopes']['Nat. Abund.']['SL'][0]
5614+ for iso in B2:
5615+ if B1 != B2[iso]:
5616+ bfrac1 = (B1*Afrac-B2[iso])/(B1-B2[iso])
5617+ atype2 = Atype2
5618+ if 'nat' not in iso:
5619+ atype2 += '_%s'%iso
5620+ print(' neutron based site fractions %s = %.3f, %.3f/cell; %s = %.3f, %.3f/cell' \
5621+ %(Atype1,bfrac1,bfrac1*Amult,atype2,(1.-bfrac1),(1.-bfrac1)*Amult))
5622+
56095623 def OnValidProtein(event):
56105624
56115625 def pickHandler(resName):
0 commit comments