Skip to content

Commit 30cf21e

Browse files
author
ci-build
committed
[skip ci] Updates
1 parent 8bcab35 commit 30cf21e

File tree

368 files changed

+487908
-478805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+487908
-478805
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

_downloads/328bb9a2268c424591c715d1fd64b02c/example_wind_measurements.ipynb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"from datetime import datetime, timedelta, date\nfrom opendrift.readers import reader_netCDF_CF_generic\nfrom opendrift.models.openoil import OceanDrift\nfrom opendrift.readers import reader_timeseries\nfrom opendrift.readers.operators import ops\nimport opendrift.models.physics_methods as phy\nimport xarray as xr\nimport numpy as np\nimport pyproj\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\n\n# Preparation of figsize, dpi, fontsize and font style\n# Could also be done using mpl style sheet\n# https://matplotlib.org/stable/users/explain/customizing.html\nmpl.rcParams['figure.figsize'] = (5, 5)\nmpl.rcParams['savefig.dpi'] = 300\nmpl.rcParams['font.family'] = \"sans-serif\"\nmpl.rcParams['font.sans-serif'] = \"DejaVu Sans\"\nmpl.rcParams['font.size'] = 22\nmpl.rcParams['mathtext.fontset'] = \"dejavusans\""
18+
"from datetime import datetime, timedelta, date\nfrom opendrift.readers import reader_netCDF_CF_generic\nfrom opendrift.models.openoil import OceanDrift\nfrom opendrift.readers import reader_timeseries\nfrom opendrift.readers.operators import ops\nimport opendrift.models.physics_methods as phy\nimport xarray as xr\nimport trajan as _\nimport numpy as np\nimport pyproj\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\n\n# Preparation of figsize, dpi, fontsize and font style\n# Could also be done using mpl style sheet\n# https://matplotlib.org/stable/users/explain/customizing.html\nmpl.rcParams['figure.figsize'] = (5, 5)\nmpl.rcParams['savefig.dpi'] = 300\nmpl.rcParams['font.family'] = \"sans-serif\"\nmpl.rcParams['font.sans-serif'] = \"DejaVu Sans\"\nmpl.rcParams['font.size'] = 22\nmpl.rcParams['mathtext.fontset'] = \"dejavusans\""
1919
]
2020
},
2121
{
@@ -148,7 +148,25 @@
148148
},
149149
"outputs": [],
150150
"source": [
151-
"radius = 100\nnumber = 100\n \no = OceanDrift(loglevel=20)\no.add_reader([reader_norkyst])\no.seed_elements(lon=lon, lat=lat, radius=radius, number=number, time=time_start, wind_drift_factor=wind_drift_factor)\no.run(end_time=time_end, time_step=time_step, time_step_output=time_step_output)\n\no2 = OceanDrift(loglevel=20)\no2.set_config('drift:max_speed', 10) #Necessary for the moment because of a bug to be solved\no2.add_reader([c, reader_norkyst])\no2.seed_elements(lon=lon, lat=lat, radius=radius, number=number, time=time_start, wind_drift_factor=wind_drift_factor)\no2.run(end_time=time_end, time_step=time_step, time_step_output=time_step_output)\n\no.plot(fast = False, compare=o2, background=['x_sea_water_velocity', 'y_sea_water_velocity'], legend=['Norkyst only', 'Gaussian measurement'], buffer = .023, markersize = 70, linewidth = 1, title = \"\", xlocs = mpl.ticker.MaxNLocator(5), ylocs = mpl.ticker.MaxNLocator(5), clabel = r\"Wind speed $\\mathrm{(m.s^{-1})}$\", cpad = 0.08, text=text)\n\nskillscores = phy.skillscore_liu_weissberg(o.result.lon, o.result.lat, o2.result.lon, o2.result.lat)\n\nplt.figure()\nplt.hist(skillscores, bins = 100, range = (0, 1), facecolor = 'none', edgecolor = 'C0')\nplt.xlabel(\"Skillscore\")\nplt.ylabel(\"Histogram (percentages)\")\nplt.show()\n\nplt.figure()\nplt.hist(skillscores, bins = 100, range = (0.9, 0.95), facecolor = 'none', edgecolor = 'C0')\nplt.xlabel(\"Skillscore\")\nplt.ylabel(\"Histogram (percentages)\")\nplt.show()"
151+
"radius = 100\nnumber = 100\n \no = OceanDrift(loglevel=20)\no.add_reader([reader_norkyst])\no.seed_elements(lon=lon, lat=lat, radius=radius, number=number, time=time_start, wind_drift_factor=wind_drift_factor)\no.run(end_time=time_end, time_step=time_step, time_step_output=time_step_output)\n\no2 = OceanDrift(loglevel=20)\no2.set_config('drift:max_speed', 10) #Necessary for the moment because of a bug to be solved\no2.add_reader([c, reader_norkyst])\no2.seed_elements(lon=lon, lat=lat, radius=radius, number=number, time=time_start, wind_drift_factor=wind_drift_factor)\no2.run(end_time=time_end, time_step=time_step, time_step_output=time_step_output)\n\no.plot(fast = False, compare=o2, background=['x_sea_water_velocity', 'y_sea_water_velocity'], legend=['Norkyst only', 'Gaussian measurement'], buffer = .023, markersize = 70, linewidth = 1, title = \"\", xlocs = mpl.ticker.MaxNLocator(5), ylocs = mpl.ticker.MaxNLocator(5), clabel = r\"Wind speed $\\mathrm{(m.s^{-1})}$\", cpad = 0.08, text=text)"
152+
]
153+
},
154+
{
155+
"cell_type": "markdown",
156+
"metadata": {},
157+
"source": [
158+
"Calculating skillscores with TrajAn\n\n"
159+
]
160+
},
161+
{
162+
"cell_type": "code",
163+
"execution_count": null,
164+
"metadata": {
165+
"collapsed": false
166+
},
167+
"outputs": [],
168+
"source": [
169+
"skillscores = o.result.traj.skill(o2.result, method='liu-weissberg', tolerance_threshold=1)\n\nplt.figure()\nplt.hist(skillscores, bins = 100, range = (0, 1), facecolor = 'none', edgecolor = 'C0')\nplt.xlabel(\"Skillscore\")\nplt.ylabel(\"Histogram (percentages)\")\nplt.show()\n\nplt.figure()\nplt.hist(skillscores, bins = 100, range = (0.9, 0.95), facecolor = 'none', edgecolor = 'C0')\nplt.xlabel(\"Skillscore\")\nplt.ylabel(\"Histogram (percentages)\")\nplt.show()"
152170
]
153171
}
154172
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

_downloads/849b51a02e8ee7bce2932982bb58260e/example_wind_drift_coefficient_from_trajectory.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"import trajan as _\nfrom datetime import datetime, timedelta\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cmocean\nfrom opendrift.models.oceandrift import OceanDrift\nfrom opendrift.models.physics_methods import wind_drift_factor_from_trajectory, distance_between_trajectories, skillscore_liu_weissberg"
18+
"import trajan as _\nfrom datetime import datetime, timedelta\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cmocean\nfrom opendrift.models.oceandrift import OceanDrift\nfrom opendrift.models.physics_methods import wind_drift_factor_from_trajectory"
1919
]
2020
},
2121
{
Binary file not shown.
Binary file not shown.

_downloads/88e407aefe00a8e42f7b6bc12d926652/example_wind_drift_coefficient_from_trajectory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import matplotlib.pyplot as plt
1212
import cmocean
1313
from opendrift.models.oceandrift import OceanDrift
14-
from opendrift.models.physics_methods import wind_drift_factor_from_trajectory, distance_between_trajectories, skillscore_liu_weissberg
14+
from opendrift.models.physics_methods import wind_drift_factor_from_trajectory
1515

1616
#%%
1717
# A very simple drift model is: current + wind_drift_factor*wind

_downloads/8ac542afa1e32b71afad6106a301122e/example_wind_measurements.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from opendrift.readers.operators import ops
1212
import opendrift.models.physics_methods as phy
1313
import xarray as xr
14+
import trajan as _
1415
import numpy as np
1516
import pyproj
1617
import matplotlib.pyplot as plt
@@ -161,7 +162,9 @@
161162

162163
o.plot(fast = False, compare=o2, background=['x_sea_water_velocity', 'y_sea_water_velocity'], legend=['Norkyst only', 'Gaussian measurement'], buffer = .023, markersize = 70, linewidth = 1, title = "", xlocs = mpl.ticker.MaxNLocator(5), ylocs = mpl.ticker.MaxNLocator(5), clabel = r"Wind speed $\mathrm{(m.s^{-1})}$", cpad = 0.08, text=text)
163164

164-
skillscores = phy.skillscore_liu_weissberg(o.result.lon, o.result.lat, o2.result.lon, o2.result.lat)
165+
#%%
166+
# Calculating skillscores with TrajAn
167+
skillscores = o.result.traj.skill(o2.result, method='liu-weissberg', tolerance_threshold=1)
165168

166169
plt.figure()
167170
plt.hist(skillscores, bins = 100, range = (0, 1), facecolor = 'none', edgecolor = 'C0')
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

_images/example_2d_0.gif

-5.61 KB

_images/example_biodegradation_0.gif

-12.5 KB

_images/example_chemicaldrift_0.gif

34.9 KB

_images/example_chemicaldrift_1.gif

627 KB
-23.1 KB
42.3 KB
-40.4 KB
309 KB

_images/example_codegg_0.gif

6.15 KB

_images/example_codegg_1.gif

16.4 KB

_images/example_cone_0.gif

38.8 KB

_images/example_depth_0.gif

558 KB

_images/example_dominating_0.gif

266 KB

_images/example_ensemble_0.gif

205 KB
195 Bytes
-35.7 KB

_images/example_fvcom_0.gif

770 KB

_images/example_huge_output_0.gif

-58 KB

_images/example_huge_output_1.gif

75.5 KB
326 KB
16.8 KB
-30.9 KB
-30.1 KB

_images/example_oil_ice_0.gif

177 KB

_images/example_oil_thickness_0.gif

167 KB

_images/example_oil_thickness_1.gif

45.6 KB
-69.7 KB
-91.4 KB

_images/example_plot_0.gif

252 KB

_images/example_river_runoff_0.gif

2.72 KB

_images/example_sediments_0.gif

1.31 MB
-221 KB
-17.5 KB

_images/example_shipdrift_0.gif

107 KB
35.8 KB
1.28 KB

_images/sphx_glr_example_2d_001.png

-88 Bytes

_images/sphx_glr_example_2d_thumb.png

57 Bytes
-352 Bytes
-9 Bytes
34 Bytes
344 Bytes
-30.9 KB
-1.37 KB

_images/sphx_glr_example_cone_001.png

-5.12 KB
-1.01 KB
73.9 KB
5.28 KB
11.5 KB
5.61 KB
3.22 KB
-75 Bytes
-414 Bytes
26 Bytes
7.29 KB
1.48 KB
-208 Bytes
-138 Bytes
-16 Bytes
-8.92 KB
-282 Bytes
-2.48 KB
-561 Bytes
-20 Bytes
-228 Bytes
67 KB
18 KB
9.77 KB
-323 Bytes
244 Bytes
-115 Bytes

_modules/opendrift/models/oceandrift.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ <h1>Source code for opendrift.models.oceandrift</h1><div class="highlight"><pre>
118118
<span class="kn">import</span><span class="w"> </span><span class="nn">logging</span><span class="p">;</span> <span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
119119
<span class="kn">from</span><span class="w"> </span><span class="nn">opendrift.models.basemodel</span><span class="w"> </span><span class="kn">import</span> <span class="n">OpenDriftSimulation</span>
120120
<span class="kn">from</span><span class="w"> </span><span class="nn">opendrift.elements</span><span class="w"> </span><span class="kn">import</span> <span class="n">LagrangianArray</span>
121-
<span class="kn">from</span><span class="w"> </span><span class="nn">opendrift.models.physics_methods</span><span class="w"> </span><span class="kn">import</span> <span class="n">verticaldiffusivity_Large1994</span><span class="p">,</span> <span class="n">verticaldiffusivity_Sundby1983</span><span class="p">,</span> <span class="n">gls_tke</span><span class="p">,</span> <span class="n">skillscore_liu_weissberg</span>
121+
<span class="kn">from</span><span class="w"> </span><span class="nn">opendrift.models.physics_methods</span><span class="w"> </span><span class="kn">import</span> <span class="n">verticaldiffusivity_Large1994</span><span class="p">,</span> <span class="n">verticaldiffusivity_Sundby1983</span><span class="p">,</span> <span class="n">gls_tke</span>
122122
<span class="kn">from</span><span class="w"> </span><span class="nn">opendrift.config</span><span class="w"> </span><span class="kn">import</span> <span class="n">CONFIG_LEVEL_ESSENTIAL</span><span class="p">,</span> <span class="n">CONFIG_LEVEL_BASIC</span><span class="p">,</span> <span class="n">CONFIG_LEVEL_ADVANCED</span>
123123

124124
<span class="c1"># Defining the oil element properties</span>

0 commit comments

Comments
 (0)