Skip to content

How to define a color scheme for each element added in the seed_elements. #1442

Answered by knutfrode
GuiCruz asked this question in Q&A
Discussion options

You must be logged in to vote

You can use element property origin_marker for this purpose:

from datetime import datetime
from opendrift.models.oceandrift import OceanDrift

lon_e  =[-52.068594, -52.067167, -52.065834, -52.064216, -52.062979]
lat_e = [-32.164484, -32.168863, -32.173146, -32.177524, -32.181902]

lon_w = [-52.098480, -52.096291, -52.094102, -52.091723, -52.089534, -52.087249, -52.085060, -52.082586, -52.080492]
lat_w = [-32.167340, -32.171337, -32.175335, -32.179332, -32.183425, -32.187232, -32.191229, -32.195322, -32.199224]

time = datetime.now()
o = OceanDrift()
num_per_location = 30
o.seed_elements(lon=lon_e*num_per_location, lat=lat_e*num_per_location, 
                time=time, radius=100, origin_…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@GuiCruz
Comment options

Answer selected by GuiCruz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants