Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def activeModel(self):
if getattr(self, '_activeModel', None) is None:
if self._staticInput == 'FILE':
# Read from file active cells with 0:air, 1:dynamic, -1 static
self._activeModel = TensorMesh.readModelUBC(
self.mesh, self.basePath + self._staticInput
)
else:
self._activeModel = np.ones(self._mesh.nC)
return self._activeModel
def m0(self):
if getattr(self, '_m0', None) is None:
if isinstance(self.mstart, float):
self._m0 = np.ones(self.nC) * self.mstart
else:
self._m0 = TensorMesh.readModelUBC(
self.mesh, self.basePath + self.mstart
)
return self._m0
def mref(self):
if getattr(self, '_mref', None) is None:
if isinstance(self._mrefInput, float):
self._mref = np.ones(self.nC) * self._mrefInput
else:
self._mref = TensorMesh.readModelUBC(
self.mesh, self.basePath + self._mrefInput
)
# # Reduce to active space
# self._mref = self._mref[self.activeCells]
return self._mref