コード例 #1
0
 def getInstrumentParams(self):
         self.stackpix = apStack.getStackPixelSizeFromStackId(self.stackid, True) * 1e-10
         stackparticledata = apStack.getOneParticleFromStackId(self.stackid, self.imgnum+1, msg=True)
         pdata = stackparticledata['particle']
         self.imgpix = apDatabase.getPixelSize(pdata['image'])*1e-10
         scopedata = pdata['image']['scope']
         self.tem = scopedata['tem']
         self.cam = pdata['image']['camera']['ccdcamera']
         self.ht = scopedata['high tension']
         self.Cs = 2e-3
         self.mag = scopedata['magnification']
         self.camsize = {'x':4096,'y':4096}
         self.beamdiameter = 1e-6
         self.c2diameter = 1.0e-4
         self.wavelength = fftfun.getElectronWavelength(self.ht)
コード例 #2
0
 def getInstrumentParams(self):
     self.stackpix = apStack.getStackPixelSizeFromStackId(
         self.stackid, True) * 1e-10
     stackparticledata = apStack.getOneParticleFromStackId(self.stackid,
                                                           self.imgnum + 1,
                                                           msg=True)
     pdata = stackparticledata['particle']
     self.imgpix = apDatabase.getPixelSize(pdata['image']) * 1e-10
     scopedata = pdata['image']['scope']
     self.tem = scopedata['tem']
     self.cam = pdata['image']['camera']['ccdcamera']
     self.ht = scopedata['high tension']
     self.Cs = 2e-3
     self.mag = scopedata['magnification']
     self.camsize = {'x': 4096, 'y': 4096}
     self.beamdiameter = 1e-6
     self.c2diameter = 1.0e-4
     self.wavelength = fftfun.getElectronWavelength(self.ht)
t = getTEM()
print 'Load gold grating replica into the scope and set it to eucentric height and focus'
print 'Spread the beam to cover an area at a magnification in SA mode'
raw_input('hit enter when done')
print '---------------------------------------------------------------'
print 'Activate Diffraction Mode, change the camera length to'
print ' ~ 1.4 m with magnification knob'
print 'Focus the beam and center it with multi-function knobs.'
print 'The gold diffraction rings should show up sharply.'
print 'Identify the inner-most, i.e. <111>, diffraction ring.'
print '---------------------------------------------------------------'
raw_input('hit enter when ready to continue')

# calculate diffraction angle from high tension
ht = t.getHighTension()
wavelength = fftfun.getElectronWavelength(ht)
gold_diffraction = wavelength/0.236e-9
print 'gold <111> diffraction ring angle = %.3f mrad' % (gold_diffraction * 1e3)
beamtilt = {'x':gold_diffraction,'y':0.00}

# save original beam tilt
beamtilt0 = t.getBeamTilt()

scale_factor = 1.0
best_scale_factor = 1.0
while scale_factor > 0.001:
        print '---------------------------------------------------------------'
        new_beamtilt = {'x':beamtilt0['x']+beamtilt['x']*scale_factor}
        t.setBeamTilt(new_beamtilt)
        print 'current rotation_center_scale = %.1f' % (scale_factor,)
        best_scale_factor = scale_factor