runtraj.particles.add_release_heights#
- runtraj.particles.add_release_heights(particles, release, release_rows=None)[source]#
Return particles with each particle’s
release_height, for a column or multipoint release.Each particle’s release row says where it started: its row at
age = 0, or, for a transport model that writes none, the row release_rows gives (the model’srelease_rows,runtraj.models.TransportModel). For a multipoint releaserelease_heightis the altitude of the point the particle started at. For a column release it is the center of the particle’s slab: the column is split into slabs of equal depth, one per release row, and the slab is what the particle stands for, not the random height inside it. So the release rows must hold every particle released, including any missing from particles, such as one that left the met’s domain before its first row.A point release’s particles are returned as they are.
- Parameters:
particles (
DataFrame) – The particle table of one release.release (runtraj.releases.Release) – The release the particles started from.
release_rows (
Callable[[DataFrame, runtraj.releases.Release],DataFrame] |None) –release_rows(particles, release), which returns a table withRELEASE_ROW_COLUMNS, one row per particle released: where it started, itsheightin the release’s vertical reference. It holds each particle of particles once, and may hold particles released but not in particles. Used when the particles have no row atage = 0, or their heights above sea level cannot be known withoutzsfc.
- Raises:
ValueError – If the particles have no release rows and release_rows is not given, release_rows returns a table without its columns or without each particle once, or a release row’s height is needed and cannot be known (
zsfcmissing for a release above sea level).- Return type: