Project

General

Profile

Actions

Gatan K2 Installation Pyscope Test » History » Revision 11

« Previous | Revision 11/12 (diff) | Next »
Anchi Cheng, 01/30/2018 07:32 PM


  1. Start DigitalMicrograph
  2. From python command line or IDLE:
    import pyscope.dmsem
    k = pyscope.dmsem.GatanK2Counting()
    k.setExposureTime(200)
    k.getImage()

You should expect these to run without error. The getImage() command should give a 2D numpy array like

array([[1000, 3400, 2300, ..., 1000,1200,3000],
         [1000, 3400, 2300, ..., 1000,1200,3000],
         [1000, 3400, 2300, ..., 1000,1200,3000],
         ...,
         [1000, 3400, 2300, ..., 1000,1200,3000],
         [1000, 3400, 2300, ..., 1000,1200,3000],
         [1000, 3400, 2300, ..., 1000,1200,3000],dtype=int16)

The number and dtype depends on the camera.

a.shape command should give a tuple of the camera dimension matching your camera.
For example, (4096,4096)

If you use python shell to do this test, some of the error will cause the shell window to close immediately. Use Python IDLE instead in that case

Testing frame saving
k.setSaveRawFrames(True)
k.setExposureTime(200)
a=k.getImage()
a.shape
* The last command should give you the shape of the summed image, and the frame movie should show up on your frames directory

You can continue the test above by saving frames, too.

testing energy filter

  1. Start DigitalMicrograph
  2. From python command line or IDLE:
    import pyscope.dmsem
    k = pyscope.dmsem.GatanK2Counting()
    k.getEnergyFiltered()
    k.getEnergyFilter()
    k.setEnergyFilter(True)
    k.getEnergyFilter()
    k.setEnergyFilter(False)
    k.getEnergyFilter()
    k.getEnergyFilterWidth()
    

Updated by Anchi Cheng almost 7 years ago · 11 revisions