Updates to Survey TimeRx

This commit is contained in:
rowanc1
2014-05-02 10:57:30 -07:00
parent 14a411a129
commit fc80c84ed1
+23 -3
View File
@@ -68,6 +68,26 @@ class BaseTimeRx(BaseRx):
"""Number of data in the receiver."""
return self.locs.shape[0] * len(self.times)
def getSpatialP(self, mesh):
"""
Returns the spatial projection matrix.
.. note::
This is not stored in memory, but is created on demand.
"""
return mesh.getInterpolationMat(self.locs, self.projGLoc)
def getTimeP(self, timeMesh):
"""
Returns the time projection matrix.
.. note::
This is not stored in memory, but is created on demand.
"""
return timeMesh.getInterpolationMat(self.times, self.projTLoc)
def getP(self, mesh, timeMesh):
"""
Returns the projection matrices as a
@@ -76,13 +96,13 @@ class BaseTimeRx(BaseRx):
.. note::
Projection matrices are stored as a dictionary (mesh, timeMesh)
Projection matrices are stored as a dictionary (mesh, timeMesh) if storeProjections is True
"""
if (mesh, timeMesh) in self._Ps:
return self._Ps[(mesh, timeMesh)]
Ps = mesh.getInterpolationMat(self.locs, self.projGLoc)
Pt = timeMesh.getInterpolationMat(self.times, self.projTLoc)
Ps = self.getSpatialP(mesh)
Pt = self.getTimeP(timeMesh)
P = sp.kron(Pt, Ps)
if self.storeProjections: