Skip to content

Output files #982

Jan 18, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi Philippe,

you can simply use particle.delete(). This will remove the particle from the active particleset, which means that the output will contain only the observations of that particle up until that moment. An example of this is an 'ageing' kernel:

def Ageing(particle, fieldset, time):
    particle.age += particle.dt
    if particle.age >= fieldset.maxage:
        particle.delete()

In this example, a constant has been added to the fieldset: fieldset.add_constant('maxage', <time-in-seconds>)

If your particles exit the domain and throw an out-of-bounds error, you can also implement the following:

def delete_particle(particle, fieldset, time):
    particle.delete()

pset.execute(Advect…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by reint-fischer
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