partpost is a specialized CLI tool designed to process Delft3D FM Particle Tracking output NetCDF files. It allows users to export particle track data to various spatial and tabular formats.
- Spatial: ESRI Shapefile (
.shp), GPKG (.gpkg), GeoJSON (.json,.geojson), GeoJSONSeq (.geojsonl), SQLite (.sqlite), GML (.gml), KML (.kml) - Tabular: CSV (
.csv), Excel (.xlsx)
You can install partpost using Conda.
This is the recommended approach to avoid conflicts.
-
Ensure you have
condainstalled (e.g., Anaconda or Miniconda). -
Navigate to the directory containing
environment.yml. -
Run the following command:
conda env create -f environment.yml
-
Activate the environment:
conda activate partpost
If you already have a working environment and want to add partpost to it:
- Activate your environment:
conda activate my_env
- Install the required dependencies (if not already present):
conda install -c conda-forge netcdf4 xarray dask bottleneck geopandas openpyxl
- Install the package in editable mode:
pip install -e .
The tool runs via the command line using a JSON configuration file.
partpost config.json
The configuration file can contain a single task object, or a list of task objects.
Example config.json:
[
{
"input_nc": "D:/model_output/marine-refuse_trk.nc",
"output_path": "D:/gis_data/particles_hourly.shp",
"mode": "point",
"downscale_hour": 1.0
},
{
"input_nc": "D:/model_output/marine-refuse_trk.nc",
"output_path": "D:/gis_data/tracks_summary.gpkg",
"mode": "line",
"downscale_hour": 2.0
},
{
"input_nc": "D:/model_output/marine-refuse_trk.nc",
"output_path": "D:/gis_data/particles_raw.csv",
"mode": "point",
"downscale_hour": 0.5
}
]
| Parameter | Type | Description |
|---|---|---|
input_nc |
string | Absolute path to the input NetCDF file. |
output_path |
string | Absolute path to the output file. The format is determined by the file extension (e.g., .shp, .gpkg, .csv). |
mode |
string | point for instantaneous locations, line for particle tracks. |
downscale_hour |
float | Time sampling interval in hours. Default is 1.0. Use 0.5 for 30 minutes. |
When exporting to ESRI Shapefile format, partpost explicitly converts all datetime fields to strings. This prevents compatibility issues with GIS software that may not correctly interpret Shapefile date/time fields.