We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2e8fae commit c1de237Copy full SHA for c1de237
seaduck/eulerian.py
@@ -232,6 +232,7 @@ def from_bool_array(
232
The field where the Positions are defined on.
233
bool_array: numpy.ndarray, or xr.DataArray
234
Points are generated where it is True.
235
+ It could be an array of tracer concentration as well.
236
num: int
237
Total number of particles to seed (approximately).
238
random_seed: int optional
@@ -259,7 +260,7 @@ def from_bool_array(
259
260
self.tp = self.ocedata.tp
261
262
inds = np.where(bool_array)
- np_vol = np.array(data["Vol"])
263
+ np_vol = np.array(data["Vol"] * bool_array)
264
vols = np.array(np_vol[inds])
265
num_each = np.round(vols * num / np.sum(vols)).astype(int)
266
num = np.sum(num_each)
0 commit comments