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

define_parameters_and_their_properties()[source]
define_program_states()[source]
set_integration_width(feature_set)[source]
set_topleft_coordinates(feature_set)[source]
set_bottomright_coordinates(feature_set)[source]
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

  1. Usage: ScanLineFit(pardict)

  2. 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

  1. Usage: output1 = getline(iwidth, topleft, bottomright)

  2. Input: iwidth = integration width, topleft = topleft coordinates of line, bottomright = bottom right coordinates of line

  3. Output: 1. array of x and y

fitcube(linex=None, liney=None)[source]
  • Function to perform cubic polynomial fit to binary line and determine

  1. Usage: polyvar, fitliney3, fitliney1 = fitcube(linex, liney)

  2. Input: linex = x and liney = y array of thresholded 45 degree line

  3. 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

  1. Usage: output = visfit(linex, liney, polyvar, fitliney3, fitliney1)

  2. 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

  3. Output: output plot to saved to PDF, SVG, or PNG, TIF, JPG format

perform_scanlinefit()[source]
scanlinefit.main()[source]