stilt.particles.write_particles#

stilt.particles.write_particles(path, particles, receptor, settings, met_files, metadata=None)[source]#

Write a particle table to a Parquet file that read_particles() reads alone.

age and particle are stored as int32, and time is left out since it is the receptor time plus age. A receptor column holds the receptor id, so a scan of many files can tell receptors apart. The receptor, the run’s settings, and the met files go in the file’s metadata, so the file reads alone.

Parameters:
  • path (str | Path | UPath) – File to write.

  • particles (DataFrame) – The particle table.

  • receptor (stilt.receptor.Receptor) – Receptor the particles were released from.

  • settings (Mapping[str, Any]) – The run’s settings, as its folder records them (stilt.config.Variant.run_settings).

  • met_files (list[Path]) – Meteorology files the run used.

  • metadata (dict[bytes, bytes] | None) – More file metadata, such as the settings hash.

Returns:

The path written to.

Return type:

Path | UPath

Raises:

ValueError – If age or particle holds a value that is not a whole number.