Add B streamline plot
This commit is contained in:
+38
-12
@@ -313,21 +313,33 @@ class PostProcessor(HDF5Container):
|
||||
datamap_rho = slicing.SliceMap(self._amr, self._cam[ax_los], self._rho_op, z=z)
|
||||
return (datamap_rho.map).T
|
||||
|
||||
def _speed_h(self, ax_los, z=0.0):
|
||||
vh_op = ScalarOperator(
|
||||
lambda dset: dset["vel"][:, self._ax_nb[self._axes_h[ax_los]]],
|
||||
self._ro.info["unit_velocity"],
|
||||
def _vector_h(self, name, unit, ax_los, z=0.0):
|
||||
h_op = ScalarOperator(
|
||||
lambda dset: dset[name][:, self._ax_nb[self._axes_h[ax_los]]],
|
||||
self._ro.info[unit],
|
||||
)
|
||||
dmap_vh = slicing.SliceMap(self._amr, self._cam[ax_los], vh_op, z=z).map.T
|
||||
return dmap_vh
|
||||
dmap_h = slicing.SliceMap(self._amr, self._cam[ax_los], h_op, z=z).map.T
|
||||
return dmap_h
|
||||
|
||||
def _vector_v(self, name, unit, ax_los, z=0.0):
|
||||
v_op = ScalarOperator(
|
||||
lambda dset: dset[name][:, self._ax_nb[self._axes_v[ax_los]]],
|
||||
self._ro.info[unit],
|
||||
)
|
||||
dmap_v = slicing.SliceMap(self._amr, self._cam[ax_los], v_op, z=z).map.T
|
||||
return dmap_v
|
||||
|
||||
def _speed_h(self, ax_los, z=0.0):
|
||||
return self._vector_h("vel", "unit_velocity", ax_los, z)
|
||||
|
||||
def _speed_v(self, ax_los, z=0.0):
|
||||
vv_op = ScalarOperator(
|
||||
lambda dset: dset["vel"][:, self._ax_nb[self._axes_v[ax_los]]],
|
||||
self._ro.info["unit_velocity"],
|
||||
)
|
||||
dmap_vv = slicing.SliceMap(self._amr, self._cam[ax_los], vv_op, z=z).map.T
|
||||
return dmap_vv
|
||||
return self._vector_v("vel", "unit_velocity", ax_los, z)
|
||||
|
||||
def _B_h(self, ax_los, z=0.0):
|
||||
return self._vector_h("Br", "unit_mag", ax_los, z)
|
||||
|
||||
def _B_v(self, ax_los, z=0.0):
|
||||
return self._vector_v("Br", "unit_mag", ax_los, z)
|
||||
|
||||
def _temperature(self, ax_los, z=0.0):
|
||||
P_op = ScalarOperator(lambda dset: dset["P"], self._ro.info["unit_pressure"])
|
||||
@@ -654,6 +666,20 @@ class PostProcessor(HDF5Container):
|
||||
"/maps",
|
||||
unit=self.info["unit_velocity"],
|
||||
),
|
||||
"B_h": Rule(
|
||||
self,
|
||||
self._speed_h,
|
||||
"Horizontal slice of the magnetic field wrt the line of sight",
|
||||
"/maps",
|
||||
unit=self.info["unit_mag"],
|
||||
),
|
||||
"B_v": Rule(
|
||||
self,
|
||||
self._speed_v,
|
||||
"Vertical slice of the magnetic field wrt the line of sight",
|
||||
"/maps",
|
||||
unit=self.info["unit_mag"],
|
||||
),
|
||||
"T": Rule(
|
||||
self,
|
||||
self._temperature,
|
||||
|
||||
Reference in New Issue
Block a user