Releasing several particles from each location #1531
-
Hi everyone, I am fairly new to using Parcels so apologies if this question is is covered somewhere already. I could not find an answer unfortunately. I am trying to release multiple particles (10,000) per site (I have the lat/lons for 600 sites which I am passing into the ParticleSet using lat= (vector of lats) and lon=(vector of lons)) and include a random walk component for each particle. This should mimic larval dispersal. I try and set size = 10,000 but this leads to the following error: AssertionError: size and positions (lon, lat, depth) don't have the same lengths. I looked through the documentation and its seems size is only a valid parameter for the from_line constructor method but I do not think this method is applicable to my scenario as I want to release particles from set positions along a coastline. If anyone has any advice on how I could release multiple particles for each lat /lon and introduce natural variability (random walk component) into the trajectories of each of these particles it would be much appreciated. Many Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @LauraBachmaier, if you could provide some code on your particle set creation that would be helpful, but in the meantime, you could try the following: If you have a list of longitudes, latitudes, and depths of particles that you want to release, you could simply 'repeat' those lists using numpy's
Using Let us know if this solves your problem, cheers! |
Beta Was this translation helpful? Give feedback.
Hi Mark,
Thank you so much for you reply.
A friend of mine suggested something similar using the itertools module.
This has worked great for anyone looking to do something similar.
Cheers!