aloe.ext.ctfFile3 module

ctfFile – Reader for CTF files

class aloe.ext.ctfFile3.Ctf(filepath)[source]

Bases: object

getAcceleratingVoltage()[source]

Return the accelerating voltage [units=kV]

Return type:float
getAcquisitionEuler1()[source]

Return the acquisition euler angle (\(\theta_1\)) [units=deg]

Return type:float
getAcquisitionEuler2()[source]

Return the acquisition euler angle (\(\theta_2\)) [units=deg]

Return type:float
getAcquisitionEuler3()[source]

Return the acquisition euler angle (\(\theta_3\)) [units=deg]

Return type:float
getAcquisitionEulers()[source]

Return the acquisition euler angles \((\theta_1, \theta_2, \theta_3)\) [units=deg]

Return type:float
getAuthor()[source]

Return the author

Return type:str
getCoverage()[source]
getDevice()[source]
getHeight()[source]

Return the height of mapping (points in Y) [units=px]

Return type:int
getJobMode()[source]

Return the job mode

Return type:str
getMagnification()[source]

Return the magnification [units=X]

Return type:float
getNumberPhases()[source]

Return the number of phases

Return type:int
getNumberPixels()[source]

Return the number of pixels in the map

Return type:int
getPhaseLatticeAngleAlpha(id)[source]

Return the lattice angle \(\alpha\) of a given phase id [units=deg]

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:float
getPhaseLatticeAngleBeta(id)[source]

Return the lattice angle \(\beta\) of a given phase id [units=deg]

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:float
getPhaseLatticeAngleGamma(id)[source]

Return the lattice angle \(\gamma\) of a given phase id [units=deg]

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:float
getPhaseLatticeAngles(id)[source]

Return the lattice angles of a given phase id [units=deg]

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:(float(\(\alpha\)), float(\(\beta\)), float(\(\gamma\)))
getPhaseLatticeParameterA(id)[source]

Return the lattice parameter a of a given phase id [units=:math:text{angstroms}]

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:float
getPhaseLatticeParameterB(id)[source]
Return the lattice parameter b of a given phase id [units=:math:text{angstroms}]
Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:float
getPhaseLatticeParameterC(id)[source]
Return the lattice parameter c of a given phase id [units=:math:text{angstroms}]
Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:float
getPhaseLatticeParameters(id)[source]

Return the lattice parameters of a given phase id [units=:math:text{angstroms}]

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:(float(a), float(b), float(c))
getPhaseName(id)[source]

Return the phase of a given phase id

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:str
getPhaseSpaceGroupNo(id)[source]

Return the space group no. of a given phase

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:int between [1, 230]
getPhases(id=None)[source]

Return the dictionary of a given phase id or the whole phase dictionary if id == None

Parameters:id (int) – id of the phase (the first phase has id == 1)
Return type:dict
getPhasesList()[source]

Return a list with all the phases name.

Return type:list
getPixArray(key='euler1', noneValue=None, **conditions)

Return the filtered list for a given column header key and a set of conditions. The pixels that don’t respect the condition(s) have a value of noneValue.

Parameters:

key: name of the columns. Refer to getPixelResults() for list of keys.

The conditions are given as a tuple where
  • the first element is the operator ('=', '>', '>=', '<', '<=', '!=')
  • the second element is the value

Note

The greater than and less than only works with float and decimal.

Examples::

# Return a array of band contrast for pixels of only the second phase
# and that have a band contrast higher than 50
pixArray = ctf.getPixelArray(key='bc', phase=('=', 2), bc=('>', 50)))
Return type:list
getPixelArray(key='euler1', noneValue=None, **conditions)[source]

Return the filtered list for a given column header key and a set of conditions. The pixels that don’t respect the condition(s) have a value of noneValue.

Parameters:

key: name of the columns. Refer to getPixelResults() for list of keys.

The conditions are given as a tuple where
  • the first element is the operator ('=', '>', '>=', '<', '<=', '!=')
  • the second element is the value

Note

The greater than and less than only works with float and decimal.

Examples::

# Return a array of band contrast for pixels of only the second phase
# and that have a band contrast higher than 50
pixArray = ctf.getPixelArray(key='bc', phase=('=', 2), bc=('>', 50)))
Return type:list
getPixelCoordinate(index)[source]

Return the coordinate of the pixel from its index. The pixel (0,0) has an index of 1.

Parameters:index (int) – the index of the pixel
Return type:a integer tuple (x, y)
getPixelImageLabel(**data)[source]

Return the filename of the pixel image (diffraction pattern).

Parameters:
  • coord (tuple) –

    a integer tuple (x, y) between

    • \(0 < x <= (\text{XCells} - 1)\)
    • \(0 < y <= (\text{YCells} - 1)\)
  • index (int) – index of the pixel
Return type:

string

getPixelIndex(coord)[source]

Return the index of the pixel which also represents the image number of that pixel. The pixel (0,0) has an index of 1.

Parameters:coord (tuple) –

a integer tuple (x, y) between

  • \(0 < x <= (\text{XCells} - 1)\)
  • \(0 < y <= (\text{YCells} - 1)\)
Return type:int
getPixelIndexLabel(**data)[source]

Return the label of the index of the pixel which also represents the image number of that pixel. The pixel (0,0) has an index of 1. The number of zero before the index is asjusted accordingly to the maximum index.

Parameters:coord (tuple) –

a integer tuple (x, y) between

  • \(0 < x <= (\text{XCells} - 1)\)
  • \(0 < y <= (\text{YCells} - 1)\)
Return type:str
getPixelResults_coordinate(coord)[source]

Return a dictionary with the data for a given coordinate.

key Description
phase id of the phase (the first phase has id == 1)
x x position of the pixel
y y position of the pixel
bands number of bands used in the indexation
errorcode see below
error explanation of the errorcode
euler1 first euler angle (Bunge convention)
euler2 second euler angle (Bunge convention)
euler3 third euler angle (Bunge convention)
mad mean angular deviation
bc band contrast
bs band slope
errorcode Description
0 Success
1 Low band contrast
2 Low band slope
3 No solution
4 High MAD
5 Not yet analysed (job cancelled before point!)
6 Unexpected error (excepts etc.)
Parameters:coord (tuple) –

a integer tuple (x, y) between

  • \(0 < x <= (\text{XCells} - 1)\)
  • \(0 < y <= (\text{YCells} - 1)\)
Return type:dict
getPixelResults_index(index)[source]

Return a dictionary with the data for a given index.

Parameters:index (int) – the index of the pixel
Return type:dict
getProjectFolderName()[source]

Return the immediate folder where the project is located from the information stored in the ctf.

Return type:str
getProjectFolderPath()[source]

Return the full path of the folder where the project is located from the information stored in the ctf.

Return type:str
getProjectImagesFolderName()[source]

Return the folder name where the project images are located from the information stored in the ctf.

Return type:str
getProjectImagesFolderPath()[source]

Return the full path of the folder where the project images are located from the information stored in the ctf.

Return type:str
getProjectName()[source]

Return the name of the project (No .cpr or .ctf) from the information stored in the ctf.

Return type:str
getSize()[source]

Return the number of points in the mapping [units=px]

Return type:int
getTiltAngle()[source]

Return the tilt angle [units=deg]

Return type:float
getTiltAxis()[source]

Return the tilt axis

Return type:int
getWidth()[source]

Return the width of mapping (points in ) [units=px]

Return type:int
getXCells()[source]

Return the number of points in the X direction [units=px]

Return type:int
getXStep()[source]

Return the size of the step in the X direction [units= \(\mu m\)]

Return type:float
getYCells()[source]

Return the number of points in the Y direction [units=px]

Return type:int
getYStep()[source]

Return the size of the step in the Y direction [units= \(\mu m\)]

Return type:float