Skip to content

Commit 628e4bc

Browse files
authored
Merge pull request #172 from knutfrode/dev
Fixed some misprints
2 parents 00fbf44 + db1fe36 commit 628e4bc

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

examples/example_concentration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
plt.show()
3737

3838
#%%
39-
# We see that the cell area decreases slightly sway from equator.
39+
# We see that the cell area decreases slightly away from equator.
4040
# This is accounted for when calculating area/volume concentration.
4141
ds_c.cell_area.plot()
4242
plt.show()
@@ -49,9 +49,8 @@
4949

5050
#%%
5151
# Calculate the concentration of elements for this new grid, also weighted with element property "mass_oil"
52-
weights = 'mass_oil'
5352
ds = ds.isel(time=12) # Pre-selecting a single time before calculating concentrations
54-
ds_c = ds.traj.concentration(grid3d, weights=weights)
53+
ds_c = ds.traj.concentration(grid3d, weights='mass_oil')
5554

5655
#%%
5756
# Plot the oil concentration (mass/volume, kg/m3) at depths 1-3m and 20-30m

trajan/traj.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,15 +1301,15 @@ def concentration(self, grid, weights=None):
13011301
The same grid Xarray Dataset as input, with the following variables added:
13021302
- number: the number of elements within each grid cell
13031303
- number_area_concentration: the number of elements per area of each grid cell
1304-
(only if grid does not contain z)
1304+
(only if grid does not contain z)
13051305
- number_volume_concentration: the number of elements per volume of each grid cell
1306-
(only if grid does not contain z)
1306+
(only if grid does not contain z)
13071307
- <weights>_sum: the sum of property <weights> within each grid cell
13081308
- <weights>_mean: the mean of property <weights> within each grid cell
13091309
- <weights>_area_concentration: the concentration of <weights> per area of each grid cell
1310-
(only if grid does not contain z)
1310+
(only if grid does not contain z)
13111311
- <weights>_volume_concentration: the volume concentration of <weights> per volume of each grid cell
1312-
(only if grid contains z)
1312+
(only if grid contains z)
13131313
"""
13141314

13151315
# TODO: support other projections

0 commit comments

Comments
 (0)