Skip to content

Commit 96f30ba

Browse files
authored
Merge pull request #1632 from knutfrode/dev
[run-ex] Dev
2 parents 351cbd9 + 5e8b23f commit 96f30ba

21 files changed

+76
-33
lines changed

examples/example_codegg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#%%
2727
# spawn NEA cod eggs at defined position and time
28-
time = datetime.utcnow()
28+
time = datetime.now()
2929
o.seed_elements(14. , 68.1, z=-40, radius=2000, number=500,
3030
time=time, diameter=0.0014, neutral_buoyancy_salinity=31.25)
3131
o.seed_elements(12.5, 68., z=-40, radius=2000, number=500,

examples/example_depth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Seed 1000 elements at random depths
2424
z = -np.random.rand(2000)*50
2525
o.seed_elements(lon=4.8, lat=60.0, z=z, radius=0, number=2000,
26-
time=datetime.utcnow())
26+
time=datetime.now())
2727

2828
print(o)
2929

examples/example_entrainment_rate_oil_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
o2.set_config('wave_entrainment:droplet_size_distribution', 'Johansen et al. (2015)')
2424
o2.set_config('processes:evaporation', False)
2525
o2.set_config('processes:dispersion', False)
26-
o2.seed_elements(lon=4, lat=60, time=datetime.utcnow(), number=1000,
26+
o2.seed_elements(lon=4, lat=60, time=datetime.now(), number=1000,
2727
radius=100, z=0, oil_type='TIA JUANA HEAVY')
2828
o2.run(duration=timedelta(hours=12), time_step=900, time_step_output=3600)
2929

@@ -39,7 +39,7 @@
3939
o3.set_config('wave_entrainment:droplet_size_distribution', 'Johansen et al. (2015)')
4040
o3.set_config('processes:evaporation', False)
4141
o3.set_config('processes:dispersion', False)
42-
o3.seed_elements(lon=4, lat=60, time=datetime.utcnow(), number=1000,
42+
o3.seed_elements(lon=4, lat=60, time=datetime.now(), number=1000,
4343
radius=100, z=0, oil_type='TIA JUANA LIGHT') #'EKOFISK BLEND, STATOIL' similar ent.
4444
o3.run(duration=timedelta(hours=12), time_step=900, time_step_output=3600)
4545

examples/example_long_vietnam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
"""
33
Vietnam
4-
==================================
4+
========
55
"""
66

77
from datetime import datetime, timedelta
@@ -19,7 +19,7 @@
1919
# Seed some particles
2020
object_type = 26 # 26 = Life-raft, no ballast
2121
o.seed_elements(lon=107.8, lat=10.0, radius=1000, number=1000,
22-
object_type=object_type, time=datetime.utcnow())
22+
object_type=object_type, time=datetime.now())
2323

2424
# Run model
2525
o.run(duration=timedelta(days=3),

examples/example_oil_ice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#%%
2727
# Imaginary oil spill in Hinlopen strait
2828
o.seed_elements(lon=19.1909, lat=79.5986, radius=50,
29-
number=3000, time=datetime.utcnow() - timedelta(days=7))
29+
number=3000, time=datetime.now() - timedelta(days=7))
3030

3131
#%%
3232
# Running model

examples/example_oil_thickness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
o1.seed_elements(lon=4.5, lat=60, number=number,
4343
mass_oil=mass_oil, radius=1000,
4444
oil_type=oil_type,
45-
time=datetime.utcnow())
45+
time=datetime.now())
4646
o1.run(time_step=timestep, time_step_output=timestep_output,
4747
duration=duration)
4848

@@ -78,7 +78,7 @@
7878
o2.seed_elements(lon=4.5, lat=60, number=number,
7979
mass_oil=mass_oil, radius=1000,
8080
oil_type=oil_type,
81-
time=datetime.utcnow())
81+
time=datetime.now())
8282
o2.run(time_step=timestep, time_step_output=timestep_output,
8383
duration=duration)
8484

examples/example_sediments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
lat=59.169194
3232
lon=10.962920
3333
o.seed_elements(lon=lon, lat=lat, number=10000,
34-
time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=48)],
34+
time=[datetime.now(), datetime.now()+timedelta(hours=48)],
3535
terminal_velocity=-.001) # 1 mm/s settling speed
3636

3737
o.run(time_step=600, time_step_output=1800, duration=timedelta(hours=36))

examples/example_sediments_resuspension.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#%%
1212
# Constructing an artificial current field where x- and y-components are oscilating with different amplitude and period
1313
reader_oscx = reader_oscillating.Reader('x_sea_water_velocity',
14-
amplitude=0.6, zero_time=datetime.utcnow())
14+
amplitude=0.6, zero_time=datetime.now())
1515
reader_oscy = reader_oscillating.Reader('y_sea_water_velocity',
16-
amplitude=.3, period_seconds=3600*5, zero_time=datetime.utcnow())
16+
amplitude=.3, period_seconds=3600*5, zero_time=datetime.now())
1717

1818
o = SedimentDrift(loglevel=50) # 0 for debug output
1919

@@ -39,7 +39,7 @@
3939
#%%
4040
# Seeding sediments
4141
o.seed_elements(lon=4.65, lat=60, number=10000,
42-
time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=6)],
42+
time=[datetime.now(), datetime.now()+timedelta(hours=6)],
4343
terminal_velocity=-.01) # 1 cm/s settling speed
4444

4545
o.run(time_step=1800, time_step_output=1800, duration=timedelta(hours=72))

examples/example_seed_from_shapefile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
# Seed particles within all polygons from shapefile
1717
o.seed_from_shapefile(test_data_folder +
1818
'shapefile_spawning_areas/Torsk.shp',
19-
number=1000, time=datetime.utcnow())
19+
number=1000, time=datetime.now())
2020

2121

2222
#%%
2323
# Alternative by using GeoPandas and selecting a subset of two polygons
2424
gdf = gpd.read_file(test_data_folder + 'shapefile_spawning_areas/Torsk.shp')
2525
gdf = gdf.iloc[[1, 5]]
26-
o.seed_from_geopandas(gdf, number=2000, time=datetime.utcnow())
26+
o.seed_from_geopandas(gdf, number=2000, time=datetime.now())
2727

2828
o.plot(fast=True)

examples/example_shipdrift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Seed ship elements at defined position and time
2020
# Note: beam/length ratio is larger than allowed, but is then clipped internally
2121
o.seed_elements(lon=5.0, lat=63.0, radius=1000, number=1000,
22-
time=datetime.utcnow(),
22+
time=datetime.now(),
2323
length=80.0, beam=20.0, height=9.0, draft=4.0)
2424

2525
#%%

0 commit comments

Comments
 (0)