def extractFields(self, bvec): nD = bvec.shape[0]/3 bvec = np.reshape(bvec, (3, nD)) # rot = Utils.mkvc(Utils.dipazm_2_xyz(-self.prism.pinc, -self.prism.pdec)) # bvec = Utils.rotatePointsFromNormals(bvec.T, rot, np.r_[0., 1., 0.], # np.r_[0, 0, 0]).T R = Utils.rotationMatrix(self.prism.pinc, self.prism.pdec) bvec = R.dot(bvec) if self.uType == 'bx': u = Utils.mkvc(bvec[0, :]) if self.uType == 'by': u = Utils.mkvc(bvec[1, :]) if self.uType == 'bz': u = Utils.mkvc(bvec[2, :]) if self.uType == 'tf': # Projection matrix Ptmi = Utils.dipazm_2_xyz(self.Binc, self.Bdec).T u = Utils.mkvc(Ptmi.dot(bvec)) return u
def Mind(self): # Define magnetization direction as sum of induced and remanence mind = Utils.dipazm_2_xyz(self.Binc, self.Bdec) R = Utils.rotationMatrix(-self.prism.pinc, -self.prism.pdec, normal=False) Mind = self.susc*self.Higrf*R.dot(mind) # Mind = self.susc*self.Higrf*Utils.dipazm_2_xyz(self.Binc - self.prism.pinc, # self.Bdec - self.prism.pdec) return Mind
def Mrem(self): mrem = Utils.dipazm_2_xyz(self.rinc, self.rdec) R = Utils.rotationMatrix(-self.prism.pinc, -self.prism.pdec, normal=False) Mrem = self.Q*self.susc*self.Higrf * R.dot(mrem) # Mrem = self.Q*self.susc*self.Higrf * \ # Utils.dipazm_2_xyz(self.rinc - self.prism.pinc, self.rdec - self.prism.pdec) return Mrem