Changeset 3830 for trunk/GSASIIimage.py


Ignore:
Timestamp:
Feb 27, 2019 10:20:33 AM (3 years ago)
Author:
vondreele
Message:

modify makeRing to allow optionally a multiplier on number of steps around diffraction ring.
Used to make 5x (i.e. 0.2mm steps) number of steps for ring intensity plot
fix error in modulated magnetic centering ops 4th dimension
math for making mag modulations now correct in SStructureFactor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r3815 r3830  
    229229        return 0,0,0,0     
    230230   
    231 def makeRing(dsp,ellipse,pix,reject,scalex,scaley,image):
     231def makeRing(dsp,ellipse,pix,reject,scalex,scaley,image,mul=1):
    232232    'Needs a doc string'
    233233    def ellipseC():
     
    245245    sphi = sind(phi-90.)
    246246    ring = []
    247     C = int(ellipseC())         #ring circumference
     247    C = int(ellipseC())*mul         #ring circumference in mm
    248248    azm = []
    249249    for i in range(0,C,1):      #step around ring in 1mm increments
     
    11291129        if len(Ring):
    11301130            ellipse = FitEllipse(R['ImxyObs'].T)
    1131             ringxy,ringazm = makeRing(ring['Dcalc'],ellipse,0,0.,scalex,scaley,Image)
     1131            ringxy,ringazm = makeRing(ring['Dcalc'],ellipse,0,0.,scalex,scaley,Image,5)
    11321132            ring['ImxyCalc'] = np.array(ringxy).T[:2]
    11331133            ringint = np.array([float(Image[int(x*scalex),int(y*scaley)]) for y,x in np.array(ringxy)[:,:2]])
    11341134            ringint /= np.mean(ringint)
    1135             print (' %s %.3f %s %.3f'%('d-spacing',ring['Dcalc'],'sig(MRD):',np.sqrt(np.var(ringint))))
     1135            print (' %s %.3f %s %.3f %s %d'%('d-spacing',ring['Dcalc'],'sig(MRD):',np.sqrt(np.var(ringint)),'# points:',len(ringint)))
    11361136            RingsAI.append(np.array(zip(ringazm,ringint)).T)
    11371137    return RingsAI
Note: See TracChangeset for help on using the changeset viewer.