Table of Contents

Class: Distortion experiment/distortion.py

Distortion correction class.

Methods   
__getinitargs__
__init__
circlevisibility
getdetalign
getdistor
incidenceangle
isidealized
mm2pix
mmp2c
mmp2mmid
mmp2v
mmp2vid
newalign
pix2mm
pixp2c
pixp2mmid
pixp2v
pixp2vid
timestamp
vp2mm
vp2pix
vp2pixchk
  __getinitargs__ 
__getinitargs__ ( self )

  __init__ 
__init__ (
        self,
        header,
        ideal=0,
        )

Exceptions   
error( "No effpixsize in header" )
  circlevisibility 
circlevisibility (
        self,
        theta,
        p,
        )

Calculate how much of the powder circle with radius theta is visible on the detector at position p

  getdetalign 
getdetalign ( self,  ideal )

Initialization function, called at construction time. Obtains the detector alignment data from the experiment.calibration module for the detector.

  getdistor 
getdistor ( self,  ideal )

Initialization function, called at construction time. Obtains the distortion calibration data from the experiment.calibration module for the detector.

  incidenceangle 
incidenceangle (
        self,
        v,
        p,
        )

Calculate the angle of incidence of the outgoing ray v with the detector in position p

  isidealized 
isidealized ( self )

Returns true if either the detector distortion or the detector alignment are idealized (i.e. not obtained from a calibration file

  mm2pix 
mm2pix (
        self,
        mmx,
        mmy,
        )

Get (floating point) pixel coordinates from mm's

Exceptions   
error( "Far outside detector, where distortion polynomial doesn't hold" )
  mmp2c 
mmp2c (
        self,
        mmx,
        mmy,
        p,
        rotateback=1,
        )

Calculate (normalized?) C vector from impact position and goniometer orientation p

  mmp2mmid 
mmp2mmid (
        self,
        mmx,
        mmy,
        p,
        )

Calculate ideal impact mm coordinates (on detector with ideal position and alignment) from mmx,mmy and goniometer position.

  mmp2v 
mmp2v (
        self,
        mmx,
        mmy,
        p,
        )

Make diffracted ray from mmx, mmy and goniometer position. This can be called either with float or with Numeric.array versions of mmx and mmy

  mmp2vid 
mmp2vid (
        self,
        mmx,
        mmy,
        p,
        )

Make ideal vector (on detector with ideal position and alignment) from mmx,mmy and goniometer position.

  newalign 
newalign ( self )

Calculates a new detector alignment matrix and its inverse. Must be called whenever the detector alignment rotations are modified.

  pix2mm 
pix2mm (
        self,
        pixv,
        pixh,
        )

Get mm coordinates from pixel values. This can be called with float values pixv and pixh, or with complete Numeric arrays of data. In the former case, a distortion.error exception will be raised if the pixel coordinates are far outside of the detector, where the distortion polynomial does no longer hold.

Exceptions   
error( "Far outside detector, where distortion polynomial doesn't hold" )
  pixp2c 
pixp2c (
        self,
        pixv,
        pixh,
        p,
        rotateback=1,
        )

Calculate (normalized?) C vector from impact position and goniometer orientation p

  pixp2mmid 
pixp2mmid (
        self,
        pixv,
        pixh,
        p,
        )

Calculate idealized mm coordinates from pixel coordinates and detector position p

  pixp2v 
pixp2v (
        self,
        pixv,
        pixh,
        p,
        )

Calculate impact vector from pixel coordinates and detector position p

  pixp2vid 
pixp2vid (
        self,
        pixv,
        pixh,
        p,
        )

Calculate idealized impact vector from pixel coordinates and detector position p

  timestamp 
timestamp ( self )

  vp2mm 
vp2mm (
        self,
        vin,
        p,
        )

Calculate mm from impact vector vin and theta/dx in a goniometer position p

Exceptions   
AttributeError( "Need dx and theta values" )
error( "back ray" )
  vp2pix 
vp2pix (
        self,
        vin,
        p,
        )

Calculate pixel coordinates from impact vector vin and detector position p

  vp2pixchk 
vp2pixchk (
        self,
        vin,
        p,
        )

Calculate pixel coordinates from impact vector vin and detector position p This version verifies that the vector actually points to the detector by performing checks on the resulting pixel coordinates

Exceptions   
error( "Outside detector" )

Table of Contents

This document was automatically generated on Fri Jul 3 09:28:36 2009 by HappyDoc version WORKING