diff --git a/SimPEG/Survey.py b/SimPEG/Survey.py index 1ddcb3e9..450f7464 100644 --- a/SimPEG/Survey.py +++ b/SimPEG/Survey.py @@ -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: