Package schrodinger :: Package analysis :: Package visanalysis :: Module vdaxis :: Class _VDAxis
[hide private]
[frames] | no frames]

Class _VDAxis

object --+
         |
        _VDAxis

The _VDAxis class represents a single coordinate-axis. It provides the functionality needed to map between the array- and world-coordinates along this axis.

Instance Methods [hide private]
 
__init__(self, N, resolution, origin)
This function creates a new _VDAxis object.
 
_get_N(self)
 
_get_resolution(self)
 
_get_origin(self)
 
_get_max(self)
 
N(self)
 
resolution(self)
 
origin(self)
 
min(self)
 
max(self)
bool
IsCompatible(self, axis)
This function can be used to test whether axis is compatible with this _VDAxis.
float
ToArrayCoordinate(self, world)
Converts the specified world-coordinate to an array-coordinate.
float
ToWorldCoordinate(self, array)
Converts the specified array-coordinate to a world-coordinate.
bool
InBounds(self, world)
Tests whether the world-coordinate corresponds to a position along the array-coordinate axis that is in bounds.
iterator< int >
ArrayCoordinates(self)
This function returns an iterator that provides the valid array-coordinates for this _VDAxis.
iterator< float >
WorldCoordinates(self)
This function returns an iterator that provides the world-coordinates represented by the valid array-coordinates along this _VDAxis.
iterator< tuple< int, float > >
Coordinates(self)
This function returns an iterator which when de-referenced provides a tuple of the form tuple< int, float >.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, N, resolution, origin)
(Constructor)

 

This function creates a new _VDAxis object.

N, resolution and origin are exposed as properties of the same name.

Parameters:
  • N (int) - Specifies the number of array-coordinate points along this _VDAxis
  • resolution (float) - The resolution of this _VDAxis in world-coordinate units
  • origin (float) - The origin of this _VDAxis in world-coordinate units
Overrides: object.__init__

IsCompatible(self, axis)

 

This function can be used to test whether axis is compatible with this _VDAxis. Compatible _VDAxis objects have the same N, resolution and origin.

Parameters:
  • axis (_VDAxis) - The axis to be tested for compatibility with this _VDAxis
Returns: bool
True if axis is compatible with this_VDAxis

ToArrayCoordinate(self, world)

 

Converts the specified world-coordinate to an array-coordinate.

Parameters:
  • world (float) - The world-coordinate to convert.
Returns: float
The array-coordinate corresponding to world. This point need not be a valid array-coordinate

ToWorldCoordinate(self, array)

 

Converts the specified array-coordinate to a world-coordinate.

Parameters:
  • array (float) - The array-coordinate to convert
Returns: float
The world-coordinate corresponding to array.

InBounds(self, world)

 

Tests whether the world-coordinate corresponds to a position along the array-coordinate axis that is in bounds.

Parameters:
  • world (float) - The world-coordinate to test
Returns: bool
True if the world-coordinate is in bounds

ArrayCoordinates(self)

 

This function returns an iterator that provides the valid array-coordinates for this _VDAxis. It can be used to easily iterate across the valid array-coordinates for this _VDAxis.

Returns: iterator< int >
Array-coordinate iterator

WorldCoordinates(self)

 

This function returns an iterator that provides the world-coordinates represented by the valid array-coordinates along this _VDAxis.

Returns: iterator< float >
World-coordinate iterator

Coordinates(self)

 

This function returns an iterator which when de-referenced provides a tuple of the form tuple< int, float >. The tuple contains array-coordinate, world-coordinate pairs for this _VDAxis. This function makes it easy to iterate across this _VDAxis.

Returns: iterator< tuple< int, float > >
Coordinate iterator