Skip to content

Releasing several particles from each location #1531

Discussion options

You must be logged in to vote

Hi Mark,

Thank you so much for you reply.

A friend of mine suggested something similar using the itertools module.

#Load module
import itertools

#Multiply lat/lons by number of particles I want to release per site 
n= 10

lat=list(itertools.chain.from_iterable(itertools.repeat(x,n) for x in lats))
lon=list(itertools.chain.from_iterable(itertools.repeat(x,n) for x in lons))

This has worked great for anyone looking to do something similar.

Cheers!

Replies: 1 comment 1 reply

Comment options

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

Answer selected by michaeldenes
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