Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPIC] Introducing Magnetic Flux Probes #1648

Open
6 tasks
rocco8773 opened this issue Jul 28, 2022 · 5 comments
Open
6 tasks

[EPIC] Introducing Magnetic Flux Probes #1648

rocco8773 opened this issue Jul 28, 2022 · 5 comments
Assignees
Labels
epic Plasma Lv2 | Intermediate Issues that require an intermediate knowledge of plasma physics plasmapy.analysis Related to the plasmapy.analysis subpackage plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage priority: high Issues & PRs with significant urgency and importance that should be addressed soon Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python

Comments

@rocco8773
Copy link
Member

rocco8773 commented Jul 28, 2022

  1. Functionality for plasmapy.analysis
    • Create a bdot_probe.py
      • Create calc_bfield() function. Does not use units, strictly numpy arrays (probably 1D).
    • Create a sginal.py
      • Create remove_offset() function. Does not use units, strictly numpy arrays (probably 1D).
      • Create band_pass() function. Does not use units, strictly numpy arrays (probably 1D).
  2. Functionality for plasmapy.diagnostics
    • Create bdot_porbe.py and a Bdot class.
      • Class will start enforcing units.
      • Probably start with just 1D data and then go into multiple signals and bdot axes.
      • Start by incorporating just the calc_bield() function, and then incorporate the other functions.

Proposed Framework

# 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     
@rocco8773 rocco8773 added plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage epic plasmapy.analysis Related to the plasmapy.analysis subpackage labels Jul 28, 2022
@aminaahmed1803
Copy link

I completed part one and opened a pull request (signal.py and bdot_probe.py #1652) for it

@StanczakDominik
Copy link
Member

StanczakDominik commented Jul 29, 2022

For the uninitiated, what does new_time represent?

@aminaahmed1803
Copy link

After integration of the bdot array, the resultant bfield array is one index shorter because of the integration. new_time is the array containing time values corresponding to bfield.

@svincena
Copy link
Contributor

Definition : cumulative_trapezoid(y, x=None, dx=1.0, axis=-1, initial=None)

Typically, I like to specify the initial value of the trapezoidal integration scheme (usually zero), in which case the time arrays are the same and some overhead of passing in and out entire time arrays that are the same and as large (or off by one) as the data for many subsequent integrations is reduced.

@aminaahmed1803
Copy link

I created diagnostics/magnetics.py as formatted above. I haven't documented it yet. Just wanted to make sure it was correct first!

@namurphy namurphy added priority: high Issues & PRs with significant urgency and importance that should be addressed soon Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python Plasma Lv2 | Intermediate Issues that require an intermediate knowledge of plasma physics labels Aug 18, 2022
@github-actions github-actions bot added the Stale Dormant issues & PRs which will be automatically closed if the label is not removed. label Oct 18, 2022
@namurphy namurphy removed the Stale Dormant issues & PRs which will be automatically closed if the label is not removed. label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Plasma Lv2 | Intermediate Issues that require an intermediate knowledge of plasma physics plasmapy.analysis Related to the plasmapy.analysis subpackage plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage priority: high Issues & PRs with significant urgency and importance that should be addressed soon Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python
Projects
None yet
Development

No branches or pull requests

6 participants