Documented functions with links to source¶
Program to evaluate scanner performance of scanner by measuring deviation from 45 degree line to determine CCD curvature and pincushion parameter.
-
class
scanlinefit.
ScanLineFitPar
[source]¶ Class to initiate default dictionary with input parameters including help and range values and status dictionary
Methods
define_parameters_and_their_properties
define_program_states
set_bottomright_coordinates
set_integration_width
set_topleft_coordinates
-
class
scanlinefit.
ScanLineFit
(parset=None)[source]¶ Class that holds functions for determining deviation of an ideal 45 degree line
__init__ Function to read in the entered parameter dictionary and load micrograph
Usage: ScanLineFit(pardict)
Input: pardict = OrderedDict of program parameters
Methods
fitcube
([linex, liney])Function to perform cubic polynomial fit to binary line and determine
getline
([iwidth, topleft, bottomright])Function to determine 45 degree line and their corresponding x, y coordinates using rough starting coordindates and refine by center-of-gravity measurements
visfit
([linex, liney, polyvar, fitliney3, …])Function to visualize 45 degree line including cubic polynomial fit using matplotlib
perform_scanlinefit
-
getline
(iwidth=None, topleft=None, bottomright=None)[source]¶ Function to determine 45 degree line and their corresponding x, y coordinates using rough starting coordindates and refine by center-of-gravity measurements
Usage: output1 = getline(iwidth, topleft, bottomright)
Input: iwidth = integration width, topleft = topleft coordinates of line, bottomright = bottom right coordinates of line
Output: 1. array of x and y
-
fitcube
(linex=None, liney=None)[source]¶ Function to perform cubic polynomial fit to binary line and determine
Usage: polyvar, fitliney3, fitliney1 = fitcube(linex, liney)
Input: linex = x and liney = y array of thresholded 45 degree line
Output: list of a, b, c, d (a, b, c = measure of CCD curvature, d = pincushion or barrel distortion), fitliney3 = computed array of cubic fit, fitliney1 = computed array of linear fit
-
visfit
(linex=None, liney=None, polyvar=None, fitliney3=None, fitliney1=None)[source]¶ Function to visualize 45 degree line including cubic polynomial fit using matplotlib
Usage: output = visfit(linex, liney, polyvar, fitliney3, fitliney1)
Input: linex = x and liney = y array of thresholded 45 degree line, polyvar = list of a, b, c, d (a, b, c = measure of CCD curvature, d = pincushion or barrel distortion fitliney3 = computed array of cubic fit, fitliney1 = computed array of linear fit
Output: output plot to saved to PDF, SVG, or PNG, TIF, JPG format