VAPoR  0.1
vapor.py
Go to the documentation of this file.
1 ''' The vapor module is internal to vaporgui, so its methods and variables can only be accessed in the python scripts used to calculate derived variables inside vaporgui.
2  This module includes the following methods:
3  vapor.MapVoxToUser - map voxel coordinates to user coordinates
4  vapor.MapUserToVox - map user coordinates to voxel coordinates
5  vapor.GetValidRegionMax - determine maximum valid voxel coordinates of a variable
6  vapor.GetValidRegionMin - determine minimum valid voxel coordinates of a variable
7  vapor.Get3DVariable - Obtain a 3 dimensional array of variable data from the VDC
8  vapor.Get2DVariable - Obtain a 2 dimensional array of variable data from the VDC
9  vapor.VariableExists - Determine whether a specified variable exists at a timestep
10  vapor.Get3DMask - Obtain a 3D mask variable indicating where a variable is not equal to its missing value
11  vapor.Get2DMask - Obtain a 2D mask variable indicating where a variable is not equal to its missing value.
12 
13  This module also includes the following variables
14  vapor.TIMESTEP - The integer time step of the output variable(s) being calculated.
15  vapor.REFINEMENT - the integer refinement level of the output variable(s) being calculated.
16  vapor.LOD - The integer level-of-detail (compression level) of the output variable(s) being calculated.
17  vapor.BOUNDS - The integer 6-tuple specifying the integer extents of the Z, Y, and X coordinates
18  of the variable being calculated, inside the full 3D domain of the current VDC. '''
19 
20 def MapVoxToUser(voxcoord, refinementLevel ,lod):
21  ''' Convert voxel coordinates to user coordinates, at a given refinement level and level of detail.
22  Calling sequence: userCoord = MapVoxToUser(voxcoord, refLevel ,lod)
23  Where: voxcoord is an integer 3-tuple indicating voxel coordinates to convert.
24  refLevel is the integer refinement level
25  lod (optional, defaults to 0) is the integer compression level
26  Result userCoord is the returned float32 3-tuple of user coordinates.'''
27 
28 def MapUserToVox(userCoord, refinementLevel ,lod):
29  ''' Convert user coordinates to voxel coordinates, at a given refinement level and level of detail.
30  Calling sequence: voxCoord = MapUserToVox(userCoord, refLevel [,lod])
31  Where: userCoord is a float3 3-tuple indicating user coordinates to convert.
32  refLevel is the integer refinement level
33  lod (optional, defaults to 0) is the integer compression level
34  Result voxCoord is the returned integer 3-tuple of voxel coordinates.'''
35 
36 def GetValidRegionMax(timestep, variableName, refinementLevel):
37  ''' Determine the maximum voxel coordinates of a variable at a timestep and refinement level.
38  Calling sequence: maxCoord = vapor.GetValidRegionMax(timestep,variableName,refinementLevel)
39  Where: timestep is an integer time step in the VDC.
40  variableName is a string variable name in the VDC
41  refinementLevel is an integer refinement level in the VDC
42  returns maxCoord, an integer 3-tuple, the maximum coordinates of the variable at the timestep and refinement level.'''
43 
44 def GetValidRegionMin(timestep, variableName, refinementLevel):
45  ''' Determine the minimum voxel coordinates of a variable at a timestep and refinement level.
46  Calling sequence: minCoord = vapor.GetValidRegionMin(timestep,variableName,refinementLevel)
47  Where: timestep is an integer time step in the VDC.
48  variableName is a string variable name in the VDC
49  refinementLevel is an integer refinement level in the VDC
50  returns minCoord, an integer 3-tuple, the minimum coordinates of the variable at the timestep and refinement level.'''
51 
52 def Get3DVariable(timestep, variableName, refinement, lod, bounds):
53  ''' Obtain a 3-dimensional array of variable data from the VDC, using:
54  timestep (integer time step)
55  variableName (the variable name, a string)
56  refinement (integer refinement level)
57  lod (integer compression level)
58  bounds (6-tuple integer extents identifying the location of the data in the full domain,
59  as with vapor.BOUNDS.
60  Returns a 3-dimensional float32 array of variable values.'''
61 
62 def Get2DVariable(timestep, variableName, refinement, lod, bounds):
63  ''' Obtain a 2-dimensional array of variable data from the VDC, using:
64  timestep (integer time step)
65  variableName (the variable name, a string)
66  refinement (integer refinement level)
67  lod (integer compression level)
68  bounds (6-tuple integer extents identifying the location of the data in the full domain,
69  as with vapor.BOUNDS, however the first and fourth element of this tuple are ignored.
70  Returns a 2-dimensional float32 array of variable values.'''
71 
72 def VariableExists(timestep, varname ,refinement ,lod):
73  ''' Determine if a variable is present in the VDC at specified timestep, refinement, and lod. Arguments are:
74  timestep (integer time step)
75  varname (the variable name, a string)
76  refinement (integer refinement level, optional, defaults to 0)
77  lod (integer compression level, optional, defaults to 0)
78  Returns: boolean value, true if the variable exists.'''
79 
80 def Get3DMask(timestep, varname, refinement, lod, bounds):
81  ''' Obtain the boolean 3D mask associated with a 3D variable at a timestep, with specified refinement, lod, and bounds. Arguments are:
82  timestep (integer time step)
83  varname (string variable name)
84  refinement (integer refinement level)
85  lod (integer compression level)
86  bounds (6-tuple integer extents identifying the location of the data in the full domain, as with vapor.BOUNDS.
87  Returns: a 3-dimensional boolean array, which is the requested mask.'''
88 
89 def Get2DMask(timestep, varname, refinement, lod, bounds):
90  ''' Obtain the boolean 2D mask associated with a 2D variable at a timestep,
91  with specified refinement, lod, and bounds. Arguments are:
92  timestep (integer time step)
93  varname (string variable name)
94  refinement (integer refinement level)
95  lod (integer compression level)
96  bounds (6-tuple integer extents identifying the location of the data in the full domain,
97  as with vapor.BOUNDS. The first and fourth entry are ignored.
98  Returns: a 2-dimensional boolean array, which is the requested mask.'''
99 
100 
101 
def Get3DMask(timestep, varname, refinement, lod, bounds)
Definition: vapor.py:80
def MapVoxToUser(voxcoord, refinementLevel, lod)
Definition: vapor.py:20
def MapUserToVox(userCoord, refinementLevel, lod)
Definition: vapor.py:28
def Get3DVariable(timestep, variableName, refinement, lod, bounds)
Definition: vapor.py:52
def VariableExists(timestep, varname, refinement, lod)
Definition: vapor.py:72
def Get2DMask(timestep, varname, refinement, lod, bounds)
Definition: vapor.py:89
def GetValidRegionMin(timestep, variableName, refinementLevel)
Definition: vapor.py:44
def Get2DVariable(timestep, variableName, refinement, lod, bounds)
Definition: vapor.py:62
def GetValidRegionMax(timestep, variableName, refinementLevel)
Definition: vapor.py:36