solarwindpy.core.vector.BField
- class BField(data: DataFrame)[source]
Bases:
VectorA class representing a magnetic field, inheriting from Vector.
- property pressure: Series
Calculate the magnetic pressure or energy density.
- Returns:
Magnetic pressure.
- Return type:
pd.Series
Notes
The magnetic pressure is calculated using
\[p_B = \frac{1}{2\mu_0} B^2\]
- __init__(data: DataFrame)
Initialize a
Vectorinstance.- Parameters:
data (
pandas.DataFrame) – The vector data withx,yandzcomponents.
- property cartesian: DataFrame
Cartesian coordinates of the vector.
- Returns:
Columns
x,yandz.- Return type:
pd.DataFrame
- property colat
Shortcut to colatitude property.
- Returns:
Colatitude in degrees.
- Return type:
pd.Series
- property colatitude: Series
Colatitude of the vector.
- Returns:
Colatitude in degrees.
- Return type:
pd.Series
- property constants: Constants
Physical constants.
- Returns:
Physical constants instance.
- Return type:
uc.Constants
- cos_theta(other: Vector | DataFrame) Series
Cosine of the angle between this vector and
other.- Parameters:
other (
Vectororpandas.DataFrame) – Vector to calculate the angle with.- Returns:
Cosine of the angle.
- Return type:
pd.Series
- Raises:
NotImplementedError – If
otheris not aVectororDataFrame.
- property data: DataFrame
Underlying DataFrame containing the data.
- Returns:
Data with MultiIndex columns.
- Return type:
pd.DataFrame
- head()
Return the first few rows of the data.
- Returns:
First few rows of the data.
- Return type:
pd.DataFrame
- property lat
Shortcut to latitude property.
- Returns:
Latitude in degrees.
- Return type:
pd.Series
- property latitude
Latitude of the vector.
- Returns:
Latitude in degrees.
- Return type:
pd.Series
- property longitude: Series
Longitude of the vector.
- Returns:
Longitude in degrees.
- Return type:
pd.Series
- property mag: Series
Calculate the magnitude of the vector.
- Returns:
Vector magnitude.
- Return type:
pd.Series
- static mi_tuples(x: Tuple[Tuple[str, ...], ...]) MultiIndex
Create a MultiIndex from tuples with appropriate names.
- Parameters:
x (Tuple[Tuple[str, ...], ...]) – Tuples to create MultiIndex from.
- Returns:
MultiIndex created from tuples.
- Return type:
MI
- project(other: Vector | DataFrame) DataFrame
Project self onto
other.- Parameters:
other (
Vectororpandas.DataFrame) – Vector to project onto.- Returns:
Parallel and perpendicular components of the projection.
- Return type:
pd.DataFrame
- Raises:
NotImplementedError – If
otheris not aVectororDataFrame.
- property r: Series
Shortcut to
magwhen using spherical coordinates.- Returns:
Vector magnitude.
- Return type:
pd.Series
- property rho: Series
Magnitude of the vector in the xy-plane.
- Returns:
XY-plane magnitude.
- Return type:
pd.Series
- set_data(new: DataFrame)
Set new vector data.
- Parameters:
new (
pandas.DataFrame) – New vector data.- Raises:
ValueError – If
newdoes not contain the required columns.
- tail()
Return the last few rows of the data.
- Returns:
Last few rows of the data.
- Return type:
pd.DataFrame
- property units: Units
Units conversion factors.
- Returns:
Units conversion instance.
- Return type:
uc.Units
- property uv: Vector
Shortcut for
unit_vector.- Returns:
Normalised vector.
- Return type: