---
# System prepended metadata

title: Untitled

---



```python
# in plasmapy/analysis/magnetics.py
import numpy as np


def calc_bfield(
    signal: np.ndarray,
    time: np.ndarray,
    *,
    area: float = None,
    nloops: int = None,
    gain: float = None,
) -> Tuple[np.ndarray, np.ndarray]:
    ...
    return bfield, new_time



# in plasmapy/diagnostics/magnetics.py
import astropy.units as u

from plasmapy.analysis.magnetics import calc_bfield
from plasmapy.utils.decorators import validate_quantities


class Bdot:
    _settings = {}
    _signal = None
    _time = None

    @validate_quantities
    def __init__(
        self,
        signal: u.volt,
        time: u.s,
        *,
        area: u.m**2,
        nloops,
        gain,
    ):
        self._signal = signal.value
        self._time = time.value
        self._settings = {
            "area": area.value,
            "nloops":, nloops,
            "gain": gain,
        }
    
    
    @validate_quantities
    def calc_bield(self) -> (u.T, u.s):
        
        bfield, new_time = calc_bfield(
            self._signal,
            self._time,
            **self._settings,
        )
        return bfield * u.T, new_time * u.s
        
```