Interpolating and integrating FPI distribution functions#
mmspy provides particle-related computations in the
mmspy.compute.particle module. Here, we demonstrate how a particle
distribution function may be interpolated onto an N-dimensional regular
grid (in linear or logarithmic spacing) and integrated for plasma moments.
We do this specifically for the electron diffusion region reported in
Burch et al (2016).
First import and pre-configure the package:
import mmspy as mms
mms.store.path = "./data.zarr/examples/fpi-distribution"
mms.query.start_time = "2015-10-16T13:06:55"
mms.query.stop_time = "2015-10-16T13:07:05"
mms.query.probe = "mms1"
mms.query.data_rate = "brst"
mms.query.data_level = "l2"
Event overview#
Let us quickly plot the event using L2 data. We load the magnetic field, FPI ion, and electron moments:
fgm = mms.load(instrument="fgm", data_type="None")
ion_moments = mms.load(instrument="fpi", data_type="dis-moms")
elc_moments = mms.load(instrument="fpi", data_type="des-moms")
26-Mar-20 03:50:06 [INFO] Query is set from 2015-10-16 13:06:55 to 2015-10-16 13:07:05.
26-Mar-20 03:50:07 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fgm/bfield/brst/l2/zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:07 [INFO] Synchronized remote file mms1_fgm_brst_l2_20151016130524_v4.18.1.cdf to local file zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:07 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fgm/bfield/brst/l2/zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:07 [INFO] Synchronized remote file mms1_fgm_brst_l2_20151016130904_v4.18.1.cdf to local file zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:08 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fgm/bfield/brst/l2/zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:08 [INFO] Synchronized remote file mms1_fgm_brst_l2_20151016133344_v4.18.1.cdf to local file zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:08 [INFO] Synchronized remote store mms1/fgm/brst/l2 to local store local/mms1/fgm/bfield/brst/l2.
26-Mar-20 03:50:08 [INFO] Query is set from 2015-10-16 13:06:55 to 2015-10-16 13:07:05.
26-Mar-20 03:50:08 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/dis-moms/brst/l2/zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:08 [INFO] Synchronized remote file mms1_fpi_brst_l2_dis-moms_20151016130524_v3.3.0.cdf to local file zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:09 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/dis-moms/brst/l2/zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:09 [INFO] Synchronized remote file mms1_fpi_brst_l2_dis-moms_20151016130904_v3.3.0.cdf to local file zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:09 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/dis-moms/brst/l2/zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:09 [INFO] Synchronized remote file mms1_fpi_brst_l2_dis-moms_20151016133344_v3.3.0.cdf to local file zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:09 [INFO] Synchronized remote store mms1/fpi/brst/l2/dis-moms to local store local/mms1/fpi/dis-moms/brst/l2.
26-Mar-20 03:50:09 [INFO] Query is set from 2015-10-16 13:06:55 to 2015-10-16 13:07:05.
26-Mar-20 03:50:10 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/des-moms/brst/l2/zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:10 [INFO] Synchronized remote file mms1_fpi_brst_l2_des-moms_20151016130524_v3.3.0.cdf to local file zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:11 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/des-moms/brst/l2/zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:11 [INFO] Synchronized remote file mms1_fpi_brst_l2_des-moms_20151016130904_v3.3.0.cdf to local file zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:12 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/des-moms/brst/l2/zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:12 [INFO] Synchronized remote file mms1_fpi_brst_l2_des-moms_20151016133344_v3.3.0.cdf to local file zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:12 [INFO] Synchronized remote store mms1/fpi/brst/l2/des-moms to local store local/mms1/fpi/des-moms/brst/l2.
and plot:
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import numpy as np
mms.configure_matplotlib()
fig, axes = plt.subplots(7, 1, figsize=(12, 14), sharex=True)
mms.plot.add_colorbar(ax := axes[0]).remove()
ax.plot(fgm.time, fgm.b_gse.sel(rank_1="x"), "-b")
ax.plot(fgm.time, fgm.b_gse.sel(rank_1="y"), "-g")
ax.plot(fgm.time, fgm.b_gse.sel(rank_1="z"), "-r")
ax.plot(fgm.time, fgm.b_gse.tensor.magnitude, "-k")
ax.set_ylabel(f"{fgm.b_gse.pint.units:latex}")
cax = mms.plot.add_colorbar(ax := axes[1])
im = ax.pcolormesh(
ion_moments.time.expand_dims(energy_channel=ion_moments.energy_channel, axis=-1),
ion_moments.energy,
ion_moments.energyspectr_omni,
cmap="jet",
norm=LogNorm(1e2, 1e8),
)
cb = fig.colorbar(im, cax=cax)
cb.set_label(f"{ion_moments.energyspectr_omni.pint.units:latex}")
ax.set_yscale("log")
ax.set_ylim(ion_moments.energy.min().values, ion_moments.energy.max().values)
ax.set_ylabel(f"{ion_moments.energy.pint.units:latex}")
cax = mms.plot.add_colorbar(ax := axes[2])
im = ax.pcolormesh(
elc_moments.time.expand_dims(energy_channel=elc_moments.energy_channel, axis=-1),
elc_moments.energy,
elc_moments.energyspectr_omni,
cmap="jet",
norm=LogNorm(1e3, 1e9),
)
cb = fig.colorbar(im, cax=cax)
cb.set_label(f"{elc_moments.energyspectr_omni.pint.units:latex}")
ax.set_yscale("log")
ax.set_ylim(elc_moments.energy.min().values, elc_moments.energy.max().values)
ax.set_ylabel(f"{elc_moments.energy.pint.units:latex}")
mms.plot.add_colorbar(ax := axes[3]).remove()
ax.plot(ion_moments.time, ion_moments.numberdensity, "-k")
ax.set_ylabel(f"{ion_moments.numberdensity.pint.units:latex}")
mms.plot.add_colorbar(ax := axes[4]).remove()
ax.plot(ion_moments.time, ion_moments.bulkv_gse.sel(rank_1="x"), "-b")
ax.plot(ion_moments.time, ion_moments.bulkv_gse.sel(rank_1="y"), "-g")
ax.plot(ion_moments.time, ion_moments.bulkv_gse.sel(rank_1="z"), "-r")
ax.set_ylabel(f"{ion_moments.bulkv_gse.pint.units:latex}")
mms.plot.add_colorbar(ax := axes[5]).remove()
ax.plot(elc_moments.time, elc_moments.bulkv_gse.sel(rank_1="x"), "-b")
ax.plot(elc_moments.time, elc_moments.bulkv_gse.sel(rank_1="y"), "-g")
ax.plot(elc_moments.time, elc_moments.bulkv_gse.sel(rank_1="z"), "-r")
ax.set_ylabel(f"{elc_moments.bulkv_gse.pint.units:latex}")
mms.plot.add_colorbar(ax := axes[6]).remove()
ax.plot(elc_moments.time, elc_moments.temppara, "-b")
ax.plot(elc_moments.time, elc_moments.tempperp, "-r")
ax.set_ylabel(f"{elc_moments.temppara.pint.units:latex}")
for i, ax in enumerate(axes):
ax.axvline(np.datetime64("2015-10-16T13:07"), ls="--")
mms.plot.autoformat(axes)
fig.align_ylabels(axes)
plt.show()
26-Mar-20 03:50:12 [INFO] Using stylesheet /home/docs/checkouts/readthedocs.org/user_builds/mmspy/checkouts/latest/src/mmspy/data/mmspy.mplstyle
26-Mar-20 03:50:12 [WARN] /tmp/ipykernel_2326/128070278.py:17: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.
im = ax.pcolormesh(
26-Mar-20 03:50:12 [WARN] /tmp/ipykernel_2326/128070278.py:31: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.
im = ax.pcolormesh(
The EDR is indicated by the vertical dashed line.
Processing FPI distributions#
Load the spacecraft potential, ion, and electron distribution functions:
edp = mms.load(instrument="edp", data_type="scpot")
ion_distribution = mms.load(instrument="fpi", data_type="dis-dist")
elc_distribution = mms.load(instrument="fpi", data_type="des-dist")
26-Mar-20 03:50:13 [INFO] Query is set from 2015-10-16 13:06:55 to 2015-10-16 13:07:05.
26-Mar-20 03:50:14 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/edp/scpot/brst/l2/zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:14 [INFO] Synchronized remote file mms1_edp_brst_l2_scpot_20151016130524_v2.4.0.cdf to local file zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:14 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/edp/scpot/brst/l2/zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:14 [INFO] Synchronized remote file mms1_edp_brst_l2_scpot_20151016130904_v2.4.0.cdf to local file zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:15 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/edp/scpot/brst/l2/zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:15 [INFO] Synchronized remote file mms1_edp_brst_l2_scpot_20151016133344_v2.4.0.cdf to local file zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:15 [INFO] Synchronized remote store mms1/edp/brst/l2/scpot to local store local/mms1/edp/scpot/brst/l2.
26-Mar-20 03:50:15 [INFO] Query is set from 2015-10-16 13:06:55 to 2015-10-16 13:07:05.
26-Mar-20 03:50:16 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/dis-dist/brst/l2/zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:17 [INFO] Synchronized remote file mms1_fpi_brst_l2_dis-dist_20151016130524_v3.3.0.cdf to local file zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:17 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/dis-dist/brst/l2/zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:17 [INFO] Synchronized remote file mms1_fpi_brst_l2_dis-dist_20151016130904_v3.3.0.cdf to local file zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:18 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/dis-dist/brst/l2/zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:18 [INFO] Synchronized remote file mms1_fpi_brst_l2_dis-dist_20151016133344_v3.3.0.cdf to local file zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:18 [INFO] Synchronized remote store mms1/fpi/brst/l2/dis-dist to local store local/mms1/fpi/dis-dist/brst/l2.
26-Mar-20 03:50:18 [INFO] Query is set from 2015-10-16 13:06:55 to 2015-10-16 13:07:05.
26-Mar-20 03:50:27 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/des-dist/brst/l2/zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:28 [INFO] Synchronized remote file mms1_fpi_brst_l2_des-dist_20151016130524_v3.3.0.cdf to local file zarr_2015_10_16_13_05_24.
26-Mar-20 03:50:30 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/des-dist/brst/l2/zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:30 [INFO] Synchronized remote file mms1_fpi_brst_l2_des-dist_20151016130904_v3.3.0.cdf to local file zarr_2015_10_16_13_09_04.
26-Mar-20 03:50:35 [INFO] Writing dataset to data.zarr/examples/fpi-distribution/local/mms1/fpi/des-dist/brst/l2/zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:35 [INFO] Synchronized remote file mms1_fpi_brst_l2_des-dist_20151016133344_v3.3.0.cdf to local file zarr_2015_10_16_13_33_44.
26-Mar-20 03:50:35 [INFO] Synchronized remote store mms1/fpi/brst/l2/des-dist to local store local/mms1/fpi/des-dist/brst/l2.
Preprocessing#
A common preprocessing step suggested for FPI distributions
(CMAD)
is to subtract the spacecraft potential. This can be done quickly via
the fpi accessor:
V_sc = edp.scpot
ion_distribution = ion_distribution.fpi.correct_for_spacecraft_potential(V_sc, average=True)
elc_distribution = elc_distribution.fpi.correct_for_spacecraft_potential(V_sc, average=True)
Note
V_sc is automatically resampled to the resolution of ion_distribution
and elc_distribution. The average=True option also tells the
function to perform a rolling average on the scale of V_sc’s resolution.
By default, the units of phase space density in the CDF files are
's3 cm-6', which can be as low as 1e-25-1e-30. Calculations
at these values are not recommended. Thus, it is in general good to
convert the distribution functions to some other units that are far from
machine error, or to normalize the distributions with their minimum
values before interpolation. Here, we do the former (also converting
the data type to double precision in the process):
ion_distribution["dist"] = ion_distribution.dist.astype("f8").pint.to("s3 km-6")
elc_distribution["dist"] = elc_distribution.dist.astype("f8").pint.to("s3 km-6")
Particle grid#
To define a new grid of a given coordinate:
from mmspy.compute.particle import ParticleGrid
from mmspy import units as u
energy_range = u.Quantity(np.logspace(0.0, np.log10(4e4), 32), "eV")
zenith_range = u.Quantity(np.arange(0.0, 180.01, 12.0), "deg")
azimuth_range = u.Quantity(np.arange(0.0, 360.01, 12.0), "deg")
grid = {
"W": ParticleGrid(name="energy", center=energy_range, log_scale=True),
"theta": ParticleGrid(name="zenith", center=zenith_range),
"phi": ParticleGrid(name="azimuth", center=azimuth_range),
}
Note
The keys in the grid are the coordinates of the DataArray
you want to regrid. The values of the grid are the new
ParticleGrid you wish to regrid the
DataArray on.
Note
The name argument for ParticleGrid
defines a new dimension name corresponding to the new coordinates.
Note
The grid above is 3-dimensional. If you only wish to regrid
along one specific coordinate, say 'energy', remove the other
keys. This allows the routine to perform interpolation in arbitrary
dimensions. An example of 1-d regrid is given in Dask in action.
The (unaliased) energy coordinate in L2 distribution functions have
two dimensions, time and energy_channel:
ion_distribution
<xarray.Dataset> Size: 13MB
Dimensions: (time: 66, energy_channel: 32, azimuthal_sector: 32,
zenith_sector: 16)
Coordinates:
* time (time) datetime64[ns] 528B 2015-10-16T13:06:55.1102640...
* energy_channel (energy_channel) int8 32B 0 1 2 3 4 5 ... 27 28 29 30 31
* azimuthal_sector (azimuthal_sector) int8 32B 0 1 2 3 4 ... 27 28 29 30 31
* zenith_sector (zenith_sector) int8 16B 0 1 2 3 4 5 ... 11 12 13 14 15
energy (time, energy_channel) float64 17kB [eV] dask.array<ad...
phi (time, azimuthal_sector) float32 8kB [deg] dask.array<...
theta (zenith_sector) float32 64B [deg] dask.array<open_data...
Data variables: (12/13)
Epoch_minus_var float32 4B [s] 0.0
Epoch_plus_var float32 4B [s] 0.15
compressionloss (time) uint8 66B [] dask.array<getitem, shape=(66,), d...
dist (time, energy_channel, azimuthal_sector, zenith_sector) float64 9MB [s³/km⁶] dask.array<mul, shape=(66, 32, 32, 16), dtype=float64, chunksize=(15, 32, 32, 16), c...
disterr (time, azimuthal_sector, zenith_sector, energy_channel) float32 4MB [s³/cm⁶] dask.array<getitem, shape=(66, 32, 16, 32), dtype=float32, chunksize=(15, 32, 16, 32), c...
energy_delta (time, energy_channel) float32 8kB [eV] dask.array<get...
... ...
phi_delta (energy_channel) float32 128B [deg] dask.array<open_da...
sector_despinp (time) uint8 66B [] dask.array<getitem, shape=(66,), d...
startdelphi_angle (time) float32 264B [deg] dask.array<getitem, shape=(6...
startdelphi_count (time) uint16 132B [] dask.array<getitem, shape=(66,),...
steptable_parity (time) uint8 66B [] dask.array<getitem, shape=(66,), d...
theta_delta (zenith_sector) float32 64B [deg] dask.array<open_data...
Attributes: (12/44)
Correction_table_name: mms1_dis_f1ct_v21-0211_0222_p0.txt mms1...
Correction_table_rev: 7825
Correction_table_scaling_factor: 1.00000
Data_type: brst_l2_dis-dist
Dead_time_correction: 100 ns
Descriptor: DIS>Dual Ion Spectrometers
... ...
size: 32.445181999999996 MB
species: ion
start_time: 2015-10-16T13:05:24.209633002
stop_time: 2015-10-16T13:07:43.860598002
timestamp: 2015_10_16_13_05_24
version: 3.3.0However, we prefer to have the regridded dimension to be named 'energy',
so we rename the energy coordinate to 'W':
ion_distribution = ion_distribution.rename(energy="W")
elc_distribution = elc_distribution.rename(energy="W")
ion_distribution
<xarray.Dataset> Size: 13MB
Dimensions: (time: 66, energy_channel: 32, azimuthal_sector: 32,
zenith_sector: 16)
Coordinates:
* time (time) datetime64[ns] 528B 2015-10-16T13:06:55.1102640...
* energy_channel (energy_channel) int8 32B 0 1 2 3 4 5 ... 27 28 29 30 31
* azimuthal_sector (azimuthal_sector) int8 32B 0 1 2 3 4 ... 27 28 29 30 31
* zenith_sector (zenith_sector) int8 16B 0 1 2 3 4 5 ... 11 12 13 14 15
W (time, energy_channel) float64 17kB [eV] dask.array<ad...
phi (time, azimuthal_sector) float32 8kB [deg] dask.array<...
theta (zenith_sector) float32 64B [deg] dask.array<open_data...
Data variables: (12/13)
Epoch_minus_var float32 4B [s] 0.0
Epoch_plus_var float32 4B [s] 0.15
compressionloss (time) uint8 66B [] dask.array<getitem, shape=(66,), d...
dist (time, energy_channel, azimuthal_sector, zenith_sector) float64 9MB [s³/km⁶] dask.array<mul, shape=(66, 32, 32, 16), dtype=float64, chunksize=(15, 32, 32, 16), c...
disterr (time, azimuthal_sector, zenith_sector, energy_channel) float32 4MB [s³/cm⁶] dask.array<getitem, shape=(66, 32, 16, 32), dtype=float32, chunksize=(15, 32, 16, 32), c...
energy_delta (time, energy_channel) float32 8kB [eV] dask.array<get...
... ...
phi_delta (energy_channel) float32 128B [deg] dask.array<open_da...
sector_despinp (time) uint8 66B [] dask.array<getitem, shape=(66,), d...
startdelphi_angle (time) float32 264B [deg] dask.array<getitem, shape=(6...
startdelphi_count (time) uint16 132B [] dask.array<getitem, shape=(66,),...
steptable_parity (time) uint8 66B [] dask.array<getitem, shape=(66,), d...
theta_delta (zenith_sector) float32 64B [deg] dask.array<open_data...
Attributes: (12/44)
Correction_table_name: mms1_dis_f1ct_v21-0211_0222_p0.txt mms1...
Correction_table_rev: 7825
Correction_table_scaling_factor: 1.00000
Data_type: brst_l2_dis-dist
Dead_time_correction: 100 ns
Descriptor: DIS>Dual Ion Spectrometers
... ...
size: 32.445181999999996 MB
species: ion
start_time: 2015-10-16T13:05:24.209633002
stop_time: 2015-10-16T13:07:43.860598002
timestamp: 2015_10_16_13_05_24
version: 3.3.0Interpolation#
We can now regrid the distributions.
interpolate_distribution does not
care how many dimensions a coordinate has. So as long as they are listed
in the grid, they will be resampled:
from mmspy.compute.particle import interpolate_distribution
f_ion = interpolate_distribution(ion_distribution, variable="dist", grid=grid)
f_elc = interpolate_distribution(elc_distribution, variable="dist", grid=grid)
f_ion.attrs.update(species=ion_distribution.species.name)
f_elc.attrs.update(species=elc_distribution.species.name)
f_ion
<xarray.DataArray 'dist' (time: 66, energy: 32, zenith: 16, azimuth: 31)> Size: 8MB
<Quantity(dask.array<process_chunk, shape=(66, 32, 16, 31), dtype=float64, chunksize=(1, 32, 16, 31), chunktype=numpy.ndarray>, 'second ** 3 / kilometer ** 6')>
Coordinates:
* time (time) datetime64[ns] 528B 2015-10-16T13:06:55.110264002 ... 201...
* energy (energy) int64 256B 0 1 2 3 4 5 6 7 8 ... 24 25 26 27 28 29 30 31
* zenith (zenith) int64 128B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* azimuth (azimuth) int64 248B 0 1 2 3 4 5 6 7 8 ... 23 24 25 26 27 28 29 30
W (energy) float64 256B [eV] 1.0 1.408 1.981 ... 2.842e+04 4e+04
theta (zenith) float64 128B [deg] 0.0 12.0 24.0 ... 156.0 168.0 180.0
phi (azimuth) float64 248B [deg] 0.0 12.0 24.0 ... 336.0 348.0 360.0
Attributes:
species: ionIntegration#
Now, we integrate the regridded distributions.
integrate_distribution calculates
the density, the velocity, and the pressure tensor from a given distribution.
The name of the spherical coordinates must be specified:
from mmspy.compute.particle import integrate_distribution
ion_int_moments = integrate_distribution(f_ion, energy="W", zenith="theta", azimuth="phi")
elc_int_moments = integrate_distribution(f_elc, energy="W", zenith="theta", azimuth="phi")
ion_int_moments
<xarray.Dataset> Size: 6kB
Dimensions: (time: 66, rank_1: 3, rank_2: 6)
Coordinates:
* time (time) datetime64[ns] 528B 2015-10-16T13:06:55.110264002 ... 201...
* rank_1 (rank_1) <U1 12B 'x' 'y' 'z'
* rank_2 (rank_2) <U2 48B 'xx' 'yy' 'zz' 'xy' 'xz' 'yz'
Data variables:
N (time) float64 528B [number_density_unit] dask.array<where, shap...
V (time, rank_1) float64 2kB [velocity_unit] dask.array<transpose,...
P (time, rank_2) float64 3kB [pressure_unit] dask.array<transpose,...All this is planned out by dask. Let us examine the task graph for the pressure tensor (which will be the most complicated since it depends on the density and the velocity):
ion_int_moments.P.data.dask
HighLevelGraph
HighLevelGraph with 341 layers and 18412 keys from all layers.
Layer1: array
array-9e0238a45707563146990032104e3535
|
Layer2: array
array-da3a2526430a8a460ae847d158c5f538
|
Layer3: array
array-996884c0e55d5344f876f9ff9683beca
|
Layer4: array
array-dcb0947603241766155531bd78ef9a67
|
Layer5: original
original-open_dataset-phi-e4e907f3b02656e277cafff85c762e38
|
Layer6: open_dataset-phi
open_dataset-phi-e4e907f3b02656e277cafff85c762e38
|
Layer7: getitem
getitem-e6f7d3eeea97c04da0cbc2ce394194c5
|
Layer8: getitem
getitem-68f026302ed9f0b8cd80bd85a8bf147f
|
Layer9: getitem
getitem-de5389513a79be70e13d5f5daddf31f8
|
Layer10: broadcast_to
broadcast_to-e0ce4a1591c59d627c33310711736e1d
|
Layer11: transpose
transpose-a6280a894d1eb261e58c30e8a2778cc1
|
Layer12: transpose
transpose-4ec111d0af5fb1a825dd8168681164cf
|
Layer13: reshape
reshape-5c393d86c42da0ee0cc99f6fb13cf1de
|
Layer14: astype
astype-8c2de58e0bd46530bf28ed7337df695d
|
Layer15: rechunk-merge
rechunk-merge-a293c6011f4b309c29733b82b790bf1b
|
Layer16: original
original-open_dataset-theta-aa5080043fbfe287fdec606871ab874b
|
Layer17: open_dataset-theta
open_dataset-theta-aa5080043fbfe287fdec606871ab874b
|
Layer18: broadcast_to
broadcast_to-410b119b344fa2859251992e6ff2582f
|
Layer19: transpose
transpose-0cb618bbb28ecfa4151f838f3e5ed10c
|
Layer20: transpose
transpose-796835ff81a4270a4d426f7291f86c40
|
Layer21: reshape
reshape-86c51dcdbf5f07c8c3ed5f794ce6edd5
|
Layer22: broadcast_to
broadcast_to-8792dd10567e47d0c3c8370224baf6ac
|
Layer23: astype
astype-a2f1c08b2858dacb8b22e3e65a9b761d
|
Layer24: rechunk-merge
rechunk-merge-1e1784dd7cabdff3a6ad9aebb78391af
|
Layer25: original
original-open_dataset-dist-fbbe6b58a936835bfab7141663a1d9d8
|
Layer26: open_dataset-dist
open_dataset-dist-fbbe6b58a936835bfab7141663a1d9d8
|
Layer27: getitem
getitem-8ea74b2108d6fe7f2e81893ca1ebe6b4
|
Layer28: getitem
getitem-0ca9b94da3226f74166ed25701afef04
|
Layer29: getitem
getitem-48b2c622706f45a3463d3bdb344288f9
|
Layer30: transpose
transpose-977c03c3e9573223a483865c4a8a65a5
|
Layer31: original-array
original-array-8df6a55353f35ec3baeba7d7500bd3d2
|
Layer32: array
array-8df6a55353f35ec3baeba7d7500bd3d2
|
Layer33: original-array
original-array-dae1e57f1be7586af5f01035f796b030
|
Layer34: array
array-dae1e57f1be7586af5f01035f796b030
|
Layer35: original
original-open_dataset-scpot-08ddcee64f529da9b56d235c272b4b0b
|
Layer36: open_dataset-scpot
open_dataset-scpot-08ddcee64f529da9b56d235c272b4b0b
|
Layer37: getitem
getitem-f235c4521fa442605454445c92e58cd0
|
Layer38: getitem
getitem-b93c89c0b337635cff75c3432d117b4a
|
Layer39: getitem
getitem-0ea246169264af061a9d214ea7047b24
|
Layer40: isnan
isnan-e947f03f8f09021f049a25cff93942f1
|
Layer41: invert
invert-8b0cda10d54f40c35771a7e7c4a792a2
|
Layer42: where
where-49b6389c106cc1a01c6485cc0f576759
|
Layer43: overlap
overlap-98335bf24a00e2d8f8c2ab8b1f6de078
|
Layer44: sliding_window_view
sliding_window_view-adc48088c05650952665f7ba174cdd04
|
Layer45: sum
sum-3affbf1dd333f0c0ed3dc2ac1936f6ce
|
Layer46: sum-aggregate
sum-aggregate-cd1343352f576f65c7cef33f3ce2d4e0
|
Layer47: overlap
overlap-9a3ed2e08f00ab9ec73b1169d5dc1976
|
Layer48: sliding_window_view
sliding_window_view-8a7407177ed61a58673520a26156bc89
|
Layer49: sum
sum-3360caa166e5eb7b36de581de1e16b06
|
Layer50: sum-aggregate
sum-aggregate-686190f9c884d8d0f88ff94a3f5f26a6
|
Layer51: astype
astype-19356ab8e17378dd27285d09ee482716
|
Layer52: ge
ge-e46efea40f1a9e02f5bb38152cdfd1cb
|
Layer53: where
where-3df6590fe27237995e84b57d16e76d35
|
Layer54: astype
astype-747f3ff82dc58e2332f99ddb06079eec
|
Layer55: where
where-da7344e2ee01b50921494e1f2fe539bd
|
Layer56: truediv
truediv-9064f7982d2923f5dd570b75a8f0c0a1
|
Layer57: getitem
getitem-6d56ab13a2f4c0a1a1fe7dd703144da4
|
Layer58: getitem
getitem-a954459f273226914b6fa1360bcd436b
|
Layer59: interpnd
interpnd-f71a966f07e8d35acaad3ad29df4fdbf
|
Layer60: interpnd_0
interpnd_0-f71a966f07e8d35acaad3ad29df4fdbf
|
Layer61: transpose
transpose-cb490941106c3081f98214f47a81c85c
|
Layer62: multiply
multiply-faed170660f80b90a395df1c255c4503
|
Layer63: mul
mul-fac36fe44987286607f29c10a8df2173
|
Layer64: getitem
getitem-99682c68df79bdfcf6eb6da2db5f13eb
|
Layer65: transpose
transpose-800beebe63a6c3f5627636e012ac7324
|
Layer66: mul
mul-70d359752b5990ec0c4c83e8a4415c38
|
Layer67: absolute
absolute-15a7cecb6b36ba72ef0acebe6758a444
|
Layer68: mul
mul-5f99a93370e8a465f4c28d7c9ce28e7f
|
Layer69: getitem
getitem-32ca6c1626459790d1e15403ba36c5f7
|
Layer70: transpose
transpose-0c9b1052ed71dcc62b306c75025c2e4a
|
Layer71: mul
mul-8b074a0f60c074b7fce8a4a21775a9a6
|
Layer72: original
original-open_dataset-energy-d325048d67fa37ef040b2fe86fdb069f
|
Layer73: open_dataset-energy
open_dataset-energy-d325048d67fa37ef040b2fe86fdb069f
|
Layer74: getitem
getitem-6a5f232c490e778c98ad35a9235a2fb5
|
Layer75: getitem
getitem-f6dab7cc968ff420ffa4c46118834cee
|
Layer76: getitem
getitem-4c91398480dc4f504512feb63902f3b2
|
Layer77: add
add-c9c315c8ce4bf6b53a202e546c9a91de
|
Layer78: broadcast_to
broadcast_to-eae88bf5750c39752e107cfeff6b60f9
|
Layer79: transpose
transpose-e8218d8fe334707c42aa1fab7d666863
|
Layer80: reshape
reshape-c53ed8f4461d23c7ebd954c34d3c57e0
|
Layer81: rechunk-merge
rechunk-merge-66e36401d2b1c49ca3a230805a925cf5
|
Layer82: mul
mul-5e4f49d33f63d5c2f72ce9b0bbdf8e21
|
Layer83: gt
gt-2481b305d9c15f689866ffb0f3bf11c6
|
Layer84: getitem
getitem-02f215f79233272e8f0168d9de521604
|
Layer85: rechunk-merge
rechunk-merge-2684f280822b484c1f4febef0688c055
|
Layer86: where
where-a182f8a7441cb395a9c9ed2e978d138f
|
Layer87: astype
astype-8d5921df279cc1c405eea9d745486f9a
|
Layer88: mul
mul-0bbb5454cc8012573ecc63445ab58229
|
Layer89: reshape
reshape-fa23a3962ab137c85773fff9887994d5
|
Layer90: stack
stack-7346b1d429bc05ad93adb15aa351156d
|
Layer91: rechunk-merge
rechunk-merge-2d6414c6955e2456ad166a35de2b5b86
|
Layer92: transpose
transpose-7ed647a21285f85ba195090fcb1b511e
|
Layer93: process_chunk
process_chunk-7a238b1372282577511f2d8341242cbf
|
Layer94: mul
mul-befb2f73189c31afd70f4201f377d875
|
Layer95: isnan
isnan-565e29b258bca2d41b2a203a09e55a19
|
Layer96: invert
invert-5936ffb462982691dc8b3e0e1b6047c7
|
Layer97: where
where-d9ef01b0937e0d9baf88a75a145bb775
|
Layer98: mul
mul-d41466ff9b33588af99ed0c9a909c4ba
|
Layer99: mul
mul-ce58644364f4881c1ebe530c7c57fa30
|
Layer100: getitem
getitem-8ea364a7ec1894dcddb49e4afb99d497
|
Layer101: getitem
getitem-275bc939f4aab9b31f579bd4004d71fe
|
Layer102: add
add-603e51474a205031e9c17f38c89ded9f
|
Layer103: mul
mul-0696da3a86b0624ee6d192d5f7f0b737
|
Layer104: mul
mul-a23599eb2d31aadf83c177d22f14e946
|
Layer105: getitem
getitem-b4587e58ecd55d4a6efb123e31ea6bc8
|
Layer106: getitem
getitem-ec98b86a6f07a2f8c5c7d16ef6b5e43e
|
Layer107: add
add-29dabd84dba7f1d95dcd4543ec4de0af
|
Layer108: mul
mul-0f5493316264d9c3a8ac913a18f73adf
|
Layer109: mul
mul-d1c96c590f94d3367481843e6ed52199
|
Layer110: mul
mul-8f201cd1a2790267d22a396dd93a2c6f
|
Layer111: getitem
getitem-fc39eead6d64d9800869f471525b38ed
|
Layer112: getitem
getitem-16dd50a15d3685f15c70f720b0f4a610
|
Layer113: add
add-ce061bf4e6d3214a913cf1fbb3ccb888
|
Layer114: mul
mul-7c6b78a3e7fb40888d270c9b198c7b94
|
Layer115: getitem
getitem-fbc126dd5e0c625184963f756ae27c1f
|
Layer116: getitem
getitem-e9ff3e61626a0e2156b5f674dee95a48
|
Layer117: add
add-88c08c48c87af72d835922cef40f779b
|
Layer118: mul
mul-1572a67fff571dcc8daac83cd7b2e0b8
|
Layer119: mul
mul-308c078c874740b15079fbc5ca071377
|
Layer120: getitem
getitem-25685c22a0bf6166b9f314dea31f49cc
|
Layer121: getitem
getitem-f09ec59b5b02d4c5c0b3ad95c4c1a499
|
Layer122: add
add-338aec371ad5e95aabe711b333c2f62a
|
Layer123: mul
mul-7c1659b860c09a99fb541a21b2cb4382
|
Layer124: getitem
getitem-9a6cd9172c99d26616cf2ca109105322
|
Layer125: getitem
getitem-87fff8f41cdbc53d068d1507176b4f88
|
Layer126: add
add-ecb3e74ba524d379d03388a217aa55f7
|
Layer127: mul
mul-ac2a2ed00032eaff459c840e03b56d6d
|
Layer128: mul
mul-c284897c9a7e13f403a466bd769b5166
|
Layer129: mul
mul-33b07c54524d5836f93db385e8b8b87a
|
Layer130: getitem
getitem-d99ae4c96700e00e2d91b5682aeece36
|
Layer131: getitem
getitem-f33a64f1847d7ad23b1ef32609ad9fb1
|
Layer132: add
add-a1452054ef47c356f8060e3ff19433d1
|
Layer133: mul
mul-0ee214d1c411e1b4a6356d1fca76b455
|
Layer134: mul
mul-722c0fc1b5b9e074b8a2703d82671db3
|
Layer135: getitem
getitem-de405e820895881e45080cbdb02167e9
|
Layer136: getitem
getitem-27814f6051bd81c3512e237dd35f2d48
|
Layer137: add
add-c80df8a5edf51ebda5c284d190103567
|
Layer138: mul
mul-26df3bdedb6427601e7ce975ac85eff3
|
Layer139: getitem
getitem-d37bee5d5db63cf25f6d6f89c6b94c7d
|
Layer140: getitem
getitem-c5679288b568e8373510f2d80c172c72
|
Layer141: add
add-a1bada10483cf3696b028956e0be8db5
|
Layer142: mul
mul-9dbf7ccda245ea8a332e34639527fd4c
|
Layer143: mul
mul-52b082a97ddbaa161579c85ea538a645
|
Layer144: getitem
getitem-caae0f187192f8a647caf64a55719e7b
|
Layer145: getitem
getitem-a0867215790ee4af1ad2aa8ba002ed8d
|
Layer146: add
add-70daf14e4349e58289776df6dfac5329
|
Layer147: array
array-afc9c8c9465717444a8495ee8201142f
|
Layer148: multiply
multiply-2efc4bd11e2b99aa02652ebf969be457
|
Layer149: sum
sum-3fd4854d6ec0d6a2bfd81ff5558b5f1e
|
Layer150: sum-aggregate
sum-aggregate-b7380d4b9448c88b8d52a8744926d68d
|
Layer151: getitem
getitem-868b44ceacc1782ec95b5c891eb7e102
|
Layer152: getitem
getitem-4f07e1cb29dc68712c86107d08f70204
|
Layer153: add
add-7b81a62c0f5688cfbfebf13e15da99f2
|
Layer154: multiply
multiply-cac3193e09c44a4d1b2e32018c154e9f
|
Layer155: sum
sum-9852b6d59c6a0925d9a4a6d1812d3b6a
|
Layer156: sum-aggregate
sum-aggregate-d59d1c00c173ae91c375fb69f4ca2d23
|
Layer157: getitem
getitem-d9358c37c6c3e47a5c4611df27114472
|
Layer158: getitem
getitem-fbb24df836ce0c5c3633bac1bf3ec8fc
|
Layer159: add
add-a7f4bac4f991adbd913871f4e5657c64
|
Layer160: multiply
multiply-3bd684432e6623fa89986d97145ee311
|
Layer161: sum
sum-ac6897eac685d9ea6b03db4dce8ff7aa
|
Layer162: sum-aggregate
sum-aggregate-a0841c35ee818d4b8c4d622f31617db6
|
Layer163: getitem
getitem-bbe12a0c4f565422b83a32cd3618a8a2
|
Layer164: getitem
getitem-b4b29e587020e7052b808f084babeeb0
|
Layer165: add
add-6ae58b7a82dfb17d0296824fb2b23369
|
Layer166: multiply
multiply-17fe54b92105cfc75299663de62701d5
|
Layer167: sum
sum-0cacb2118b4c5f7f6326bbc5283f9d77
|
Layer168: sum-aggregate
sum-aggregate-b04e9ee528330725d1ee61421e6d59a5
|
Layer169: getitem
getitem-b9e70448d09b0d35208fb4782e00783f
|
Layer170: getitem
getitem-ab8b4a499154379cfaa0bb76caf9c370
|
Layer171: add
add-798550e38f20df12385a19200ee4df97
|
Layer172: multiply
multiply-2587c43b6c53e4251d40ceb94aed42eb
|
Layer173: sum
sum-f1b3c0a88fe803eaff5dbc5ace5ffd0f
|
Layer174: sum-aggregate
sum-aggregate-978bd799803d9346d89270249e975916
|
Layer175: getitem
getitem-cf063083851dab205b8a6a7a4d8b3f61
|
Layer176: getitem
getitem-25decae93a13e6adb9ed65715cd617a3
|
Layer177: add
add-e739abb007995df0194272dd2e4cbc4d
|
Layer178: multiply
multiply-2e42a8b6a5fc5ec590745f402427e37a
|
Layer179: sum
sum-be67186da372be3912f0e9f5b2862a4a
|
Layer180: sum-aggregate
sum-aggregate-c4cdd0372533b1af1e33134c8cef4418
|
Layer181: getitem
getitem-5b108a3e1e4072cc47c06c1aaac662db
|
Layer182: getitem
getitem-e73be42c00f58fa8ca31464bb63ae5b5
|
Layer183: add
add-efbcbb821649b48599f494317fa99577
|
Layer184: multiply
multiply-ec35dcba4906745a268d19b89472ac2d
|
Layer185: sum
sum-b577efc306f5c627f3a224b7beb5b617
|
Layer186: sum-aggregate
sum-aggregate-fe5f257bb07bc0bb639530c5be5673a0
|
Layer187: getitem
getitem-dbcd983007d48e0f970b3447648cf5b2
|
Layer188: getitem
getitem-ad1ad921c59c52473fac7e5f6aa6e9c2
|
Layer189: add
add-a24aca471e6d60e469e046d0227d2dc1
|
Layer190: multiply
multiply-1a1ebda55de0d48ed86e17d2efd1cb2f
|
Layer191: sum
sum-62deb25c9c63c2901e7d28d3a94ae78a
|
Layer192: sum-aggregate
sum-aggregate-69447e3f764abd425f2b3a19fa11af71
|
Layer193: getitem
getitem-b61982381efbc04164fb69b5d626b902
|
Layer194: getitem
getitem-55df993a4c9dcf8a4de0a39fc3a820f7
|
Layer195: add
add-ea65e1dbf1687787bfca5e64d0d626b8
|
Layer196: multiply
multiply-2234adcfc490e90d6285f70021988621
|
Layer197: sum
sum-febfe7e859ec96d7e458459dda15eed0
|
Layer198: sum-aggregate
sum-aggregate-592734b1ee9c378a703629ae96f7ac26
|
Layer199: getitem
getitem-017abafd55bd4304681acc7e305246b5
|
Layer200: getitem
getitem-75ab7d1c6f9a4d9c9b4aef829205dc76
|
Layer201: add
add-62c8214a5afbf91614424b307b68d4ca
|
Layer202: multiply
multiply-29fd8c72189fadaaf07acb35e203cc13
|
Layer203: sum
sum-1c69ca47732fe6f84c694aeeba62bed4
|
Layer204: sum-aggregate
sum-aggregate-12eac2989dadb178265bef4ccaa9308c
|
Layer205: getitem
getitem-8a1cdf5a8ac921987f18b13244a1c0ff
|
Layer206: getitem
getitem-a3cc96cc88846571c5566e6737346d1f
|
Layer207: add
add-aa1786ceae790f745600cb36ee9bf808
|
Layer208: array
array-9f192be871f3d2282671dc2fad357805
|
Layer209: multiply
multiply-771dd0d4f277899bccd056d9b1d3e324
|
Layer210: sum
sum-49854221f0d6cfcc82d517f3358f0877
|
Layer211: sum-aggregate
sum-aggregate-2313211a7e66387f53c33d6af36dad66
|
Layer212: getitem
getitem-c938abef8e8e773b6d1d6a32e6a3cbcf
|
Layer213: getitem
getitem-dff2d6dfab5a6851104ffcc8334569f7
|
Layer214: add
add-4543919fc2c70ab48e09b89f3625d1d4
|
Layer215: multiply
multiply-58fc29695d3c06520f0b39ae67d23b39
|
Layer216: sum
sum-c8b80988ed274d2b9b5e124db0b3e094
|
Layer217: sum-aggregate
sum-aggregate-56899aec52fb335575067ae9d2f91bc8
|
Layer218: getitem
getitem-3a7d9f22558df194554bce7b251b29c6
|
Layer219: getitem
getitem-8cddbea32e1263c7ab6e401d2ec68666
|
Layer220: add
add-bb8eddff1a1341193057f9b639f21a8f
|
Layer221: multiply
multiply-46c1db2d64bf71b0d55984269f248c8e
|
Layer222: sum
sum-003e5203103f9f1e5cf69839477ac1ad
|
Layer223: sum-aggregate
sum-aggregate-16e5ce7d60258001e934a636e0d2bbdc
|
Layer224: getitem
getitem-ced8b13f0f34a49d43fbbe2e76dd420d
|
Layer225: getitem
getitem-099c81c2b899e595b8fb6c31fe1563d6
|
Layer226: add
add-910616d0a99de737b789ab7f88f19b3d
|
Layer227: multiply
multiply-831c6ebdc4148b987f29c17e90e246e4
|
Layer228: sum
sum-1d74fb9f9408325d1df49fc75e934720
|
Layer229: sum-aggregate
sum-aggregate-b3da699bc8363e8d8f0d9e6d90b31128
|
Layer230: getitem
getitem-58a89b72d6c7d4f4ca636cdf823ad602
|
Layer231: getitem
getitem-ab6291d7d4c4c7f1e95e112b452fadfa
|
Layer232: add
add-efaaec68d5ba535f98623a4b53cdf189
|
Layer233: multiply
multiply-18af3737d2543f64d703c204fd4574b1
|
Layer234: sum
sum-27137a62727bd258acf28edbbee48e8b
|
Layer235: sum-aggregate
sum-aggregate-003736212c78dbf9513d86f006d5ef7c
|
Layer236: getitem
getitem-f1007fc69777b9467e70804b64f15c26
|
Layer237: getitem
getitem-373adf2125db6add737df871b8d4b659
|
Layer238: add
add-4fb99347ebb58344b724f98d3046b873
|
Layer239: multiply
multiply-20a38735120a24ca7a43d75b04758ef0
|
Layer240: sum
sum-91194dd4572bbf2175ab3eae2f7d08b1
|
Layer241: sum-aggregate
sum-aggregate-5aa265a8c150b4fa6c8208285efd8d3b
|
Layer242: getitem
getitem-6c810d9d3e7000e38a29391404637440
|
Layer243: getitem
getitem-632764e5090166e4d5b42ca41cd2e814
|
Layer244: add
add-496fcd9ad0ba71a342e48b882f9ddf39
|
Layer245: multiply
multiply-3af8ae4dd42193355c46b51f02a4e490
|
Layer246: sum
sum-78ed0c361a8ca93efafff1468af8fa64
|
Layer247: sum-aggregate
sum-aggregate-0276ce5e5c2914be3cb900c877f91a2e
|
Layer248: getitem
getitem-059a90705debb04e8e9123a5e358da39
|
Layer249: getitem
getitem-301b1eef6b14f9a27c76cb6947c8e98f
|
Layer250: add
add-91eed02262ea27292c7e39437cff0164
|
Layer251: multiply
multiply-5ff9af5963d89c674b43f4b7bf109892
|
Layer252: sum
sum-082543bcdbb9251d83045ca6de7f651f
|
Layer253: sum-aggregate
sum-aggregate-19dd6fd36763a9d967be7cd8ec6a8d14
|
Layer254: getitem
getitem-01017ad38d5d5c5e9cfcb693e68d5718
|
Layer255: getitem
getitem-ec2c19a21506465502c07760a7abdd35
|
Layer256: add
add-446f7b21be0c08461adab8a2846f289a
|
Layer257: multiply
multiply-964db08c38a7f27397d4d831be60398c
|
Layer258: sum
sum-d11a1c754e283d0e5f06f0850b794742
|
Layer259: sum-aggregate
sum-aggregate-426cb38ca1023552f5fe04353d6a7dd3
|
Layer260: getitem
getitem-acf18aba9e5c2bd2fdd9ab88a6664453
|
Layer261: getitem
getitem-ff6882fb7506357254908f4a030dc719
|
Layer262: add
add-99cade90787393fabb33d64b4dcdfaca
|
Layer263: multiply
multiply-e407c3d37d776214cb318ba57907ad59
|
Layer264: sum
sum-5ca3de2d2ab43f9294bba9083ee1fba9
|
Layer265: sum-aggregate
sum-aggregate-aa1b3439c602f8c8f70dcfdf7af54a4b
|
Layer266: getitem
getitem-258c0c55b9d5ed8fcc2d47207899e1f5
|
Layer267: getitem
getitem-404ed605d3c23c2f841fc9b63582711a
|
Layer268: add
add-7e57dbbe4764da1d788269738ef33596
|
Layer269: array
array-541c5e1a827085565b5f5734f2dc8ea3
|
Layer270: multiply
multiply-00a43bc8528a5cf3457af6e167e8abd5
|
Layer271: sum
sum-5856e066fd641c58e90b0f96a4765f25
|
Layer272: sum-aggregate
sum-aggregate-364f7d498661c1bccd1146f324ec798a
|
Layer273: multiply
multiply-bb78b9fce89f5c39dcdb6f4c4833eff0
|
Layer274: sum
sum-52887505fb0b39297e1c4a608ceb1ebd
|
Layer275: sum-aggregate
sum-aggregate-8e3019511783256dee3928e8bce62e89
|
Layer276: multiply
multiply-335b830473245499bd8a8c7542b0e146
|
Layer277: sum
sum-7b432541c5e38d3b63048fe180d9f53f
|
Layer278: sum-aggregate
sum-aggregate-9abbf54c7a646ba85f4c23ecdc92b639
|
Layer279: multiply
multiply-92a4f20f6acc6f9f5a7713c1058774d3
|
Layer280: sum
sum-e5f985f305fae35b1c9860f425bf8321
|
Layer281: sum-aggregate
sum-aggregate-dc00366df2b82fd7c977955ef7b3abf9
|
Layer282: multiply
multiply-adbb6b9b8aa51c7216dc7d720e5fafba
|
Layer283: sum
sum-4173c27213ae642fd01f6ce25cf1c6e7
|
Layer284: sum-aggregate
sum-aggregate-1b61d85d43eb3f21176791ed56ffdd7e
|
Layer285: multiply
multiply-0d421f3af64225d8e910fa46fd1883b7
|
Layer286: sum
sum-d28297e6642072f1044bafe73527b184
|
Layer287: sum-aggregate
sum-aggregate-c08fe3364583cdb70e2a9b2b0960b0ef
|
Layer288: multiply
multiply-ef2c8340a6a790d43a472c29ad232268
|
Layer289: sum
sum-609e26f48749e60752d019052baf9b88
|
Layer290: sum-aggregate
sum-aggregate-a277865ec790c6041cbb9f220a9e2d96
|
Layer291: multiply
multiply-cfe836673dfdae4c5575ebe1618ee7a6
|
Layer292: sum
sum-85f93279dc9e253ea1da5934a3faa871
|
Layer293: sum-aggregate
sum-aggregate-7fa5fed58794e548abdd3c718e45dbc4
|
Layer294: multiply
multiply-6ec00a70f81d3fb86f416e44c9821d2f
|
Layer295: sum
sum-da335118ebe4947a12ae06fe4d7c6cb0
|
Layer296: sum-aggregate
sum-aggregate-377b3b3a1ec4e59461c5542d6235c605
|
Layer297: mul
mul-4909e0b5df5b0209eff9e1867e73e7eb
|
Layer298: gt
gt-b721fe94dc399d9d7b33b1fd3323f1cd
|
Layer299: where
where-d38726e9a8751af94b2f3bb735e5cf99
|
Layer300: truediv
truediv-bc8a51e06f98946fec4d9f9ba93b13ba
|
Layer301: mul
mul-5f4a8e882325bd7efafae869bfec87b1
|
Layer302: mul
mul-dbcc230462847665a58802f88000b29b
|
Layer303: mul
mul-ad715588725986f7e6bc4cd01e850e7d
|
Layer304: sub
sub-fe1df7a71f75867096589d5eec0eb198
|
Layer305: multiply
multiply-b42ed9257d3d886a6ba0e7e01e5ddcd0
|
Layer306: getitem
getitem-2146d151a96f0807ec7b8a67e899ce36
|
Layer307: truediv
truediv-607c0286e404c300a874eed48b848cbf
|
Layer308: mul
mul-44bd24654a1f930c59dedc3d8967f5a1
|
Layer309: mul
mul-b28756760714015ae11854f8f669b08e
|
Layer310: mul
mul-5aff438fd054519158ea84bf96e50be1
|
Layer311: sub
sub-446f8ac15f27d2ed1d068942b095f129
|
Layer312: multiply
multiply-af79d746263624c06679f85844fb469d
|
Layer313: getitem
getitem-6df505a4534d6f0c692a251c4d165164
|
Layer314: mul
mul-56846e824e57cd533d7e49697503ec59
|
Layer315: mul
mul-8c3146abe2547972fb631d96b7ada72b
|
Layer316: sub
sub-44cf03e272bf2e3c96257979f1d70829
|
Layer317: multiply
multiply-65d5a1d7b6193886b8ebbbbe59436d1f
|
Layer318: getitem
getitem-fb57e7a7ac59c52e7a9fa100c51defdb
|
Layer319: truediv
truediv-29fc51c886702f1e0859761cb73d26d9
|
Layer320: mul
mul-534057bfe3a4939de9c0b9c841706ab6
|
Layer321: mul
mul-983c9e10c06445be34cca8f10eaac103
|
Layer322: mul
mul-ba40b1a6df6edcc22082934054ce329c
|
Layer323: sub
sub-f70f8ce2c7c451c12eca4cbbf7489700
|
Layer324: multiply
multiply-a912a200c1597a56ac37324a0e638d54
|
Layer325: getitem
getitem-0effde36b9feea929137cdcf2bf34e97
|
Layer326: mul
mul-f2a124bb33fc4052c7cdf4a5b29c2416
|
Layer327: mul
mul-b41bcb783c2c45fd4e092c4d5ae03747
|
Layer328: sub
sub-0c9860eec5011cc7a337013c54aeaf7f
|
Layer329: multiply
multiply-8c209a6050faf47fedc7d7444957240a
|
Layer330: getitem
getitem-b1880ffb019fed810cd24066b09b175c
|
Layer331: mul
mul-af807e05e70c97776e5f6aca90a87972
|
Layer332: mul
mul-d93b54dd01620deaa6e9d875cab94bc2
|
Layer333: multiply
multiply-d9073a5b206cd59b43049d06c1ac364e
|
Layer334: sum
sum-37446f54aca5042d87574cc6b943130e
|
Layer335: sum-aggregate
sum-aggregate-9492be95dd50c605ede96a7380559648
|
Layer336: sub
sub-7cc20225c9340f8e6f8d31d07f0abdb8
|
Layer337: multiply
multiply-af3f3ed64bf03874ebe394973972e54b
|
Layer338: getitem
getitem-a3b55df7451c299399ab436edb79fe83
|
Layer339: concatenate
concatenate-a6c663ecdef7b9744e0859959d6bea8a
|
Layer340: mul
mul-3f77ac46fefeb65bb353e52cca3913d2
|
Layer341: transpose
transpose-26f7f5f6920474ae7dd9b605b70a5816
|
Call compute to get final data. This is efficient if we plan to make multiple plots, since it avoids multiple evaluations of the task graph:
ion_int_moments = ion_int_moments.compute()
elc_int_moments = elc_int_moments.compute()
Validating the results#
Let us first compare the L2 and integrated density:
fig, axes = plt.subplots(2, 1, figsize=(12, 8), sharex=True)
axes[0].plot(ion_moments.time, ion_moments.numberdensity, "-k", label="L2 density")
axes[0].plot(ion_int_moments.time, ion_int_moments.N, "-r", label="Integrated density")
axes[1].plot(elc_moments.time, elc_moments.numberdensity, "-k")
axes[1].plot(elc_int_moments.time, elc_int_moments.N, "-r")
mms.plot.add_panel_label(axes[0], x=0.02, y=0.95, text="Ion", va="top")
mms.plot.add_panel_label(axes[1], x=0.02, y=0.95, text="Electron", va="top")
axes[0].legend(frameon=False, loc="upper right")
for i, ax in enumerate(axes):
ax.set_ylabel(f"{ion_moments.numberdensity.pint.units:latex}")
mms.plot.autoformat(axes)
plt.show()
Note
The discrepancies are because the grid is different from what
the FPI team uses to integrate for L2 moments. But also, the integration
method is different. xarray.DataArray.integrate uses trapezoidal
integration. However, this is quite good agreement!
fig, axes = plt.subplots(6, 1, figsize=(12, 10), sharex=True)
axes[0].plot(ion_moments.time, ion_moments.bulkv_dbcs.sel(rank_1="x"), "-k", label="L2")
axes[1].plot(ion_moments.time, ion_moments.bulkv_dbcs.sel(rank_1="y"), "-k")
axes[2].plot(ion_moments.time, ion_moments.bulkv_dbcs.sel(rank_1="z"), "-k")
axes[3].plot(elc_moments.time, elc_moments.bulkv_dbcs.sel(rank_1="x"), "-k")
axes[4].plot(elc_moments.time, elc_moments.bulkv_dbcs.sel(rank_1="y"), "-k")
axes[5].plot(elc_moments.time, elc_moments.bulkv_dbcs.sel(rank_1="z"), "-k")
axes[0].plot(ion_int_moments.time, ion_int_moments.V.sel(rank_1="x"), "-r", label="Integrated")
axes[1].plot(ion_int_moments.time, ion_int_moments.V.sel(rank_1="y"), "-r")
axes[2].plot(ion_int_moments.time, ion_int_moments.V.sel(rank_1="z"), "-r")
axes[3].plot(elc_int_moments.time, elc_int_moments.V.sel(rank_1="x"), "-r")
axes[4].plot(elc_int_moments.time, elc_int_moments.V.sel(rank_1="y"), "-r")
axes[5].plot(elc_int_moments.time, elc_int_moments.V.sel(rank_1="z"), "-r")
labels = ["$V_{ix}$", "$V_{iy}$", "$V_{iz}$", "$V_{ex}$", "$V_{ey}$", "$V_{ez}$"]
axes[0].legend(frameon=False, loc="upper right")
for i, ax in enumerate(axes):
mms.plot.add_panel_label(axes[i], x=0.01, y=0.91, text=labels[i], va="top")
mms.plot.autoformat(axes)
plt.show()
For ions:
fig, axes = plt.subplots(6, 1, figsize=(12, 12), sharex=True)
axes[0].plot(ion_moments.time, ion_moments.prestensor_dbcs.sel(rank_2="xx"), "-k", label="L2")
axes[1].plot(ion_moments.time, ion_moments.prestensor_dbcs.sel(rank_2="yy"), "-k")
axes[2].plot(ion_moments.time, ion_moments.prestensor_dbcs.sel(rank_2="zz"), "-k")
axes[3].plot(ion_moments.time, ion_moments.prestensor_dbcs.sel(rank_2="xy"), "-k")
axes[4].plot(ion_moments.time, ion_moments.prestensor_dbcs.sel(rank_2="xz"), "-k")
axes[5].plot(ion_moments.time, ion_moments.prestensor_dbcs.sel(rank_2="yz"), "-k")
axes[0].plot(ion_int_moments.time, ion_int_moments.P.sel(rank_2="xx"), "-r", label="Integrated")
axes[1].plot(ion_int_moments.time, ion_int_moments.P.sel(rank_2="yy"), "-r")
axes[2].plot(ion_int_moments.time, ion_int_moments.P.sel(rank_2="zz"), "-r")
axes[3].plot(ion_int_moments.time, ion_int_moments.P.sel(rank_2="xy"), "-r")
axes[4].plot(ion_int_moments.time, ion_int_moments.P.sel(rank_2="xz"), "-r")
axes[5].plot(ion_int_moments.time, ion_int_moments.P.sel(rank_2="yz"), "-r")
labels = ["$P_{xx}$", "$P_{yy}$", "$P_{zz}$", "$P_{xy}$", "$P_{xz}$", "$P_{yz}$"]
axes[0].legend(frameon=False, loc="upper right")
for i, ax in enumerate(axes):
mms.plot.add_panel_label(axes[i], x=0.01, y=0.91, text=labels[i], va="top")
mms.plot.autoformat(axes)
plt.show()
For electrons:
fig, axes = plt.subplots(6, 1, figsize=(12, 10), sharex=True)
axes[0].plot(elc_moments.time, elc_moments.prestensor_dbcs.sel(rank_2="xx"), "-k", label="L2")
axes[1].plot(elc_moments.time, elc_moments.prestensor_dbcs.sel(rank_2="yy"), "-k")
axes[2].plot(elc_moments.time, elc_moments.prestensor_dbcs.sel(rank_2="zz"), "-k")
axes[3].plot(elc_moments.time, elc_moments.prestensor_dbcs.sel(rank_2="xy"), "-k")
axes[4].plot(elc_moments.time, elc_moments.prestensor_dbcs.sel(rank_2="xz"), "-k")
axes[5].plot(elc_moments.time, elc_moments.prestensor_dbcs.sel(rank_2="yz"), "-k")
axes[0].plot(elc_int_moments.time, elc_int_moments.P.sel(rank_2="xx"), "-r", label="Integrated")
axes[1].plot(elc_int_moments.time, elc_int_moments.P.sel(rank_2="yy"), "-r")
axes[2].plot(elc_int_moments.time, elc_int_moments.P.sel(rank_2="zz"), "-r")
axes[3].plot(elc_int_moments.time, elc_int_moments.P.sel(rank_2="xy"), "-r")
axes[4].plot(elc_int_moments.time, elc_int_moments.P.sel(rank_2="xz"), "-r")
axes[5].plot(elc_int_moments.time, elc_int_moments.P.sel(rank_2="yz"), "-r")
labels = ["$P_{xx}$", "$P_{yy}$", "$P_{zz}$", "$P_{xy}$", "$P_{xz}$", "$P_{yz}$"]
axes[0].legend(frameon=False, loc="upper right")
for i, ax in enumerate(axes):
mms.plot.add_panel_label(axes[i], x=0.01, y=0.91, text=labels[i], va="top")
mms.plot.autoformat(axes)
plt.show()
Note
The electron moments have better agreement here. That means the defined
grid fits the electron distribution. One needs to play around more
with the ion grid.