| 4692 | return self.get_array(mp.Hp, cmplx=not self.fields.is_real, snap=snap) |
| 4693 | |
| 4694 | def get_bfield(self, snap=False): |
| 4695 | if self.is_cylindrical: |
| 4696 | r = self.get_array(mp.Br, cmplx=not self.fields.is_real, snap=snap) |
| 4697 | p = self.get_array(mp.Bp, cmplx=not self.fields.is_real, snap=snap) |
| 4698 | return np.stack([r, p], axis=-1) |
| 4699 | else: |
| 4700 | x = self.get_array(mp.Bx, cmplx=not self.fields.is_real, snap=snap) |
| 4701 | y = self.get_array(mp.By, cmplx=not self.fields.is_real, snap=snap) |
| 4702 | z = self.get_array(mp.Bz, cmplx=not self.fields.is_real, snap=snap) |
| 4703 | return np.stack([x, y, z], axis=-1) |
| 4704 | |
| 4705 | def get_bfield_x(self, snap=False): |
| 4706 | return self.get_array(mp.Bx, cmplx=not self.fields.is_real, snap=snap) |