schrodinger.analysis.visanalysis.volumedatautils module¶
- schrodinger.analysis.visanalysis.volumedatautils.CreateLike(volumeData, initialValue=0.0)¶
This function creates a new VolumeData instance that is identical in size and resolution to volumeData. All data-points within the newly constructed VolumeData instance are set to initialValue.
- Parameters
volumeData (
volumeData
) – The template VolumeData instanceinitialValue (
float
) – The initial value to assign to every data-point of the new VolumeData instance
- Returns
The newly constructed VolumeData instance
- Return type
VolumeData
- schrodinger.analysis.visanalysis.volumedatautils.Resize(volumeData, N=None, resolution=None, origin=None, interpolationOrder=0, oobMethod='constant', oobConstant=0.0)¶
This function is used to resize the specified volumeData object, returning a new VolumeData instance with the specified N, resolution and origin.
- Parameters
volumeData (VolumeData) – The VolumeData instance to be resized.
N (
iterable
) – The number of array-coordinates along the X, Y and Z axes respectively.resolution (
iterable
) – The resolution of the X, Y and Z axes respectively. Specified in world-coordinate unitsorigin – The origin of the X, Y and Z axes respectively. Specified in world-coordinates
interpolationOrder (
int
) – The degree of interpolation to use when retrieving the values. 0-5oobMethod (
string
) – What to do with requests that lie outside of the bounds of this VolumeData object. The options are “constant”, which returns the value of oobConstant. “nearest” which returns the value of the nearest valid point or “wrap”, which effectively tiles the data into an infinite repeating lattice.oobConstant (
float
) – Of the class float. The value to return if the request is OOB and the oobMethod is “constant”
- Returns
A new VolumeData instance covering the specified region of space, filled with data from the argument volumeData instance.
- Return type
- schrodinger.analysis.visanalysis.volumedatautils.CalculateContainingVolume(minWorldCoordinates, maxWorldCoordinates, resolutions, resolutionMode='highest', resolutionValue=None)¶
This function calculates values for N, origin and resolution that span the specified world-coordinate range.
len(resolutions) == len(minWorldCoordinates) == len(maxWorldCoordinates)
- Parameters
minWorldCoordinates (
iterable
) – The minimum world-coordinates to considermaxWorldCoordinates (
iterable
) – The maximum world-coordinates to considerresolutions (
iterable
) – The resolutions to considerresolutionMode (
string
) – Either “highest”, in which case the highest resolution is used for the resized VolumeDatas, “lowest”, in which case the lowest resolution is used, or “fixed”, in which case the resolution specified by resolutionValue will be usedresolutionValue (
iterable
) – The resolution value to use when the resolutionMode is “fixed”. Ignored otherwise
- Returns
These are the values of N, resolution and origin that span the input world-coordinate range
- Return type
tuple
- schrodinger.analysis.visanalysis.volumedatautils.MakeConsistent(volumeDatas, resolutionMode='highest', resolutionValue=None, interpolationOrder=0, oobMethod='constant', oobConstant=0.0)¶
This function can be used to make all of the VolumeData instances in volumeDatas consistent with each other. This is done by resizing all of the VolumeData instances so that they span the union volume of the individual VolumeData instances.
- Parameters
volumeDatas (
iterable
) – The VolumeData instances to make consistent with each other.resolutionMode (
string
) – Either “highest”, in which case the highest resolution is used for the resized VolumeDatas, “lowest”, in which case the lowest resolution is used, or “fixed”, in which case the resolution specified by resolutionValue will be usedresolutionValue (
iterable
) – The resolution value to use when the resolutionMode is “fixed”. Ignored otherwiseinterpolationOrder (
int
) – The degree of interpolation to use when retrieving the values. 0-5oobMethod (
string
) –What to do with requests that lie outside of the bounds of this VolumeData object. The options are “constant”, which returns the value of oobConstant. “nearest” which returns the value of the nearest valid point or “wrap”, which effectively tiles the data
into an infinite repeating lattice.
oobConstant (
float
) – Of the class float. The value to return if the request is OOB and the oobMethod is “constant”
- Returns
These are the set of consistent VolumeData instances formed from volumeDatas
- Return type
iterable
- class schrodinger.analysis.visanalysis.volumedatautils.DataPointLocator(volumeData)¶
Bases:
object
The DataPointLocator class is a simple utility class that allows data-points that are ‘close’ to a given position in space to be located easily. This class uses spatial partitioning (k-d tree) to ensure that the search for data-points is carried out in a computationally efficient manner.
The class is designed to be used in the following manner:
1) Instantiate a new DataPointLocator object. This sets up the instance ready to carry out the search. At this point the results list is empty. 2) Execute the various SearchForDataPointsWithinX methods to fill the internal results list with array-coordinates that are within the specified world-distance of the various search origins. 3) Optionally ‘uniquify’ the results list. 4) Examine the results list to find those points that were within the specified distances of the search origins.
- __init__(volumeData)¶
This function creates a new DataPointLocator instance.
- Parameters
volumeData (
VolumeData
) – The VolumeData instance to run the queries against
- SearchForDataPointsWithin(world, distance)¶
This function searches for valid array-coordinates whose corresponding world-coordinate lies within distance of the specified world-coordinate. The array-coordinates are appended to the internal results list.
- Parameters
world (
iterable
) – The search origin, specified in world-coordinatesdistance (
float
) – Locate all valid array-coordinates whose corresponding world-coordinate lies with distance of world
- SearchForDataPointsWithinL(worldCoordinates, distances)¶
This function is similar to SearchForDataPointsWith, however this function accepts a list of world-coordinate search origins and a corresponding list of distances.
- Parameters
worldCoordinates (
iterable
) – The world-coordinates to act as search origins. len(worldCoordinates) must be the same as len(distances)distances (
iterable
) – The corresponding distances. len(worldCoordinates) must be the same as len(distances)
- UniquifyResults()¶
This function uniquifies the result list so that each array-coordinate appears only once.
- ClearResults()¶
This function clears the current result list.
- property Results¶
This property allows access to the result list.