Skip to content
OceanTracker 0.5.3.0 documentation
⌘ K
OceanTracker 0.5.3.0 documentation

Contents:

  • Overview
    • About
    • Gallery
  • Getting started
    • Beginners guide
    • Installing
    • Tutorials
    • Troubleshooting
  • Documentation
    • Features
    • API Reference
    • Change log
OceanTracker 0.5.3.0 documentation
/
Overview
/
Gallery

Gallery#

These demo plots and animations were created with standard postprocessing plot methods.

Particle properties#

Particle properties can easily add to computation via parameters, eg decaying concentrations, by listing in particle_properties parameters. Standard properties include, status, tide, water_depth and particle age.

Decaying particle#

Decaying particle property used to size and colour particles. decay_time_scale parameter = 3.5 hours.

  • particle_properties.age_decay.AgeDecay

  • demo60_SCHISM_3D_decaying_particle.py

json parameters
/../dev/demo_param_files/demo60_SCHISM_3D_decaying_particle.json#
{
    "output_file_base": "demo60_SCHISM_3D_decaying_particle",
    "debug": true,
    "time_step": 120,
    "NUMBA_cache_code": false,
    "use_A_Z_profile": false,
    "regrid_z_to_uniform_sigma_levels": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "demo_hindcast_schisim3D_00.nc",
        "load_fields": [
            "water_temperature"
        ]
    },
    "dispersion": {
        "A_H": 0.2,
        "A_V": 0.001
    },
    "release_groups": [
        {
            "name": "P1",
            "points": [
                [
                    1594500,
                    5487000,
                    -1
                ],
                [
                    1594500,
                    5483000,
                    -1
                ],
                [
                    1598000,
                    5486100,
                    -1
                ]
            ],
            "pulse_size": 1,
            "release_interval": 150.0,
            "max_age": 17280.000000000004
        }
    ],
    "particle_properties": [
        {
            "name": "age_decay",
            "class_name": "oceantracker.particle_properties.age_decay.AgeDecay",
            "decay_time_scale": 25714.28571428571
        }
    ]
}
yaml parameters
/../dev/demo_param_files/demo60_SCHISM_3D_decaying_particle.yaml#
NUMBA_cache_code: false
debug: true
dispersion:
  A_H: 0.2
  A_V: 0.001
output_file_base: demo60_SCHISM_3D_decaying_particle
particle_properties:
- class_name: oceantracker.particle_properties.age_decay.AgeDecay
  decay_time_scale: 25714.28571428571
  name: age_decay
reader:
  file_mask: demo_hindcast_schisim3D_00.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
  load_fields:
  - water_temperature
regrid_z_to_uniform_sigma_levels: true
release_groups:
- max_age: 17280.000000000004
  name: P1
  points:
  - - 1594500
    - 5487000
    - -1
  - - 1594500
    - 5483000
    - -1
  - - 1598000
    - 5486100
    - -1
  pulse_size: 1
  release_interval: 150.0
time_step: 120
use_A_Z_profile: false

Polygon aware particles#

Particles with additional inside polygon property, with optional logging of polygon entry and exit events

  • class: particle_properties.inside_polygons.InsidePolygonsNonOverlapping2D

  • class: event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit

json parameters
/../dev/demo_param_files/demo07_inside_polygon_events.json#
{
    "output_file_base": "demo07_inside_polygon_events",
    "root_output_dir": "C:\\Auck_work\\oceantracker_output\\demos",
    "add_date_to_run_output_dir": false,
    "NUMBA_cache_code": false,
    "time_buffer_size": 15,
    "time_step": 600,
    "debug": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "Random_order_*.nc"
    },
    "user_note": "test of notes",
    "dispersion": {
        "A_H": 0.1
    },
    "tracks_writer": {
        "write_dry_cell_flag": true
    },
    "release_groups": [
        {
            "name": "P1",
            "points": [
                [
                    1594500,
                    5490000
                ],
                [
                    1598000,
                    5488500
                ]
            ],
            "pulse_size": 10,
            "release_interval": 10800
        }
    ],
    "particle_properties": [
        {
            "name": "age_decay",
            "class_name": "oceantracker.particle_properties.age_decay.AgeDecay",
            "decay_time_scale": 86400.0
        }
    ],
    "block_dry_cells": true,
    "event_loggers": [
        {
            "name": "in_out_poly",
            "class_name": "oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit",
            "particle_prop_to_write_list": [
                "ID",
                "x",
                "IDrelease_group",
                "status",
                "age"
            ],
            "polygon_list": [
                {
                    "user_polygon_name": "A",
                    "points": [
                        [
                            1592682.1237,
                            5489972.7479
                        ],
                        [
                            1593604.1667,
                            5490275.5488
                        ],
                        [
                            1593886.4247,
                            5489464.0424
                        ],
                        [
                            1592917.3387,
                            5489000.0
                        ],
                        [
                            1592300.0,
                            5489000.0
                        ],
                        [
                            1592682.1237,
                            5489972.7479
                        ]
                    ]
                },
                {
                    "user_polygon_name": "B",
                    "points": [
                        [
                            1597682.1237,
                            5489972.7479
                        ],
                        [
                            1598604.1667,
                            5490275.5488
                        ],
                        [
                            1598886.4247,
                            5489464.0424
                        ],
                        [
                            1597917.3387,
                            5487000
                        ],
                        [
                            1597300,
                            5487000
                        ],
                        [
                            1597682.1237,
                            5489972.7479
                        ]
                    ]
                }
            ]
        }
    ]
}
yaml parameters
/../dev/demo_param_files/demo07_inside_polygon_events.yaml#
NUMBA_cache_code: false
add_date_to_run_output_dir: false
block_dry_cells: true
debug: true
dispersion:
  A_H: 0.1
event_loggers:
- class_name: oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit
  name: in_out_poly
  particle_prop_to_write_list:
  - ID
  - x
  - IDrelease_group
  - status
  - age
  polygon_list:
  - points:
    - - 1592682.1237
      - 5489972.7479
    - - 1593604.1667
      - 5490275.5488
    - - 1593886.4247
      - 5489464.0424
    - - 1592917.3387
      - 5489000.0
    - - 1592300.0
      - 5489000.0
    - - 1592682.1237
      - 5489972.7479
    user_polygon_name: A
  - points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5487000
    - - 1597300
      - 5487000
    - - 1597682.1237
      - 5489972.7479
    user_polygon_name: B
output_file_base: demo07_inside_polygon_events
particle_properties:
- class_name: oceantracker.particle_properties.age_decay.AgeDecay
  decay_time_scale: 86400.0
  name: age_decay
reader:
  file_mask: Random_order_*.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
release_groups:
- name: P1
  points:
  - - 1594500
    - 5490000
  - - 1598000
    - 5488500
  pulse_size: 10
  release_interval: 10800
root_output_dir: C:\Auck_work\oceantracker_output\demos
time_buffer_size: 15
time_step: 600
tracks_writer:
  write_dry_cell_flag: true
user_note: test of notes

Particle Status#

Particles coloured by their status property. Status can be one of following strings

['unknown', 'bad_cord', 'cell_search_failed', 'notReleased', 'dead', 'outside_open_boundary', 'frozen', 'stranded_by_tide', 'on_bottom', 'moving']

json parameters
/../dev/demo_param_files/demo56_SCHISM_3D_resupend_crtitical_friction_vel.json#
{
    "output_file_base": "demo56_SCHISM_3D_resupend_crtitical_frictn_vel",
    "debug": true,
    "time_step": 120,
    "NUMBA_cache_code": false,
    "use_A_Z_profile": false,
    "regrid_z_to_uniform_sigma_levels": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "demo_hindcast_schisim3D_00.nc",
        "load_fields": [
            "water_temperature"
        ]
    },
    "dispersion": {
        "A_H": 0.2,
        "A_V": 0.001
    },
    "release_groups": [
        {
            "name": "poly1",
            "class_name": "oceantracker.release_groups.polygon_release.PolygonRelease",
            "points": [
                [
                    1597682.1237,
                    5489972.7479
                ],
                [
                    1598604.1667,
                    5490275.5488
                ],
                [
                    1598886.4247,
                    5489464.0424
                ],
                [
                    1597917.3387,
                    5489000
                ],
                [
                    1597300,
                    5489000
                ],
                [
                    1597682.1237,
                    5489972.7479
                ]
            ],
            "z_min": -1,
            "z_max": -1,
            "release_interval": 3660,
            "start": "2017-01-01T00:31:30",
            "pulse_size": 10
        },
        {
            "name": "P1",
            "points": [
                [
                    1594500,
                    5487000,
                    -1
                ],
                [
                    1594500,
                    5483000,
                    -1
                ],
                [
                    1598000,
                    5486100,
                    -1
                ]
            ],
            "release_interval": 3600,
            "pulse_size": 10
        }
    ],
    "particle_properties": [
        {
            "name": "age_decay",
            "class_name": "oceantracker.particle_properties.age_decay.AgeDecay",
            "decay_time_scale": 86400.0
        }
    ],
    "event_loggers": [
        {
            "name": "inoutpoly",
            "class_name": "oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit",
            "particle_prop_to_write_list": [
                "ID",
                "x",
                "IDrelease_group",
                "status",
                "age"
            ],
            "polygon_list": [
                {
                    "user_polygon_name": "A",
                    "points": [
                        [
                            1592682.1237,
                            5489972.7479
                        ],
                        [
                            1593604.1667,
                            5490275.5488
                        ],
                        [
                            1593886.4247,
                            5489464.0424
                        ],
                        [
                            1592917.3387,
                            5489000.0
                        ],
                        [
                            1592300.0,
                            5489000.0
                        ],
                        [
                            1592682.1237,
                            5489972.7479
                        ]
                    ]
                },
                {
                    "user_polygon_name": "B",
                    "points": [
                        [
                            1597682.1237,
                            5489972.7479
                        ],
                        [
                            1598604.1667,
                            5490275.5488
                        ],
                        [
                            1598886.4247,
                            5489464.0424
                        ],
                        [
                            1597917.3387,
                            5487000
                        ],
                        [
                            1597300,
                            5487000
                        ],
                        [
                            1597682.1237,
                            5489972.7479
                        ]
                    ]
                }
            ]
        }
    ],
    "particle_statistics": [
        {
            "name": "grid1",
            "class_name": "oceantracker.particle_statistics.gridded_statistics2D.GriddedStats2D_timeBased",
            "update_interval": 3600,
            "particle_property_list": [
                "water_depth"
            ],
            "status_list": [
                "moving"
            ],
            "z_min": -2,
            "grid_span": [
                10000,
                10000
            ],
            "grid_size": [
                120,
                121
            ]
        }
    ],
    "resuspension": {
        "critical_friction_velocity": 0.005
    },
    "velocity_modifiers": [
        {
            "name": "terminal_velocity",
            "class_name": "oceantracker.velocity_modifiers.terminal_velocity.TerminalVelocity",
            "value": -0.001
        }
    ]
}
yaml parameters
/../dev/demo_param_files/demo56_SCHISM_3D_resupend_crtitical_friction_vel.yaml#
NUMBA_cache_code: false
debug: true
dispersion:
  A_H: 0.2
  A_V: 0.001
event_loggers:
- class_name: oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit
  name: inoutpoly
  particle_prop_to_write_list:
  - ID
  - x
  - IDrelease_group
  - status
  - age
  polygon_list:
  - points:
    - - 1592682.1237
      - 5489972.7479
    - - 1593604.1667
      - 5490275.5488
    - - 1593886.4247
      - 5489464.0424
    - - 1592917.3387
      - 5489000.0
    - - 1592300.0
      - 5489000.0
    - - 1592682.1237
      - 5489972.7479
    user_polygon_name: A
  - points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5487000
    - - 1597300
      - 5487000
    - - 1597682.1237
      - 5489972.7479
    user_polygon_name: B
output_file_base: demo56_SCHISM_3D_resupend_crtitical_frictn_vel
particle_properties:
- class_name: oceantracker.particle_properties.age_decay.AgeDecay
  decay_time_scale: 86400.0
  name: age_decay
particle_statistics:
- class_name: oceantracker.particle_statistics.gridded_statistics2D.GriddedStats2D_timeBased
  grid_size:
  - 120
  - 121
  grid_span:
  - 10000
  - 10000
  name: grid1
  particle_property_list:
  - water_depth
  status_list:
  - moving
  update_interval: 3600
  z_min: -2
reader:
  file_mask: demo_hindcast_schisim3D_00.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
  load_fields:
  - water_temperature
regrid_z_to_uniform_sigma_levels: true
release_groups:
- class_name: oceantracker.release_groups.polygon_release.PolygonRelease
  name: poly1
  points:
  - - 1597682.1237
    - 5489972.7479
  - - 1598604.1667
    - 5490275.5488
  - - 1598886.4247
    - 5489464.0424
  - - 1597917.3387
    - 5489000
  - - 1597300
    - 5489000
  - - 1597682.1237
    - 5489972.7479
  pulse_size: 10
  release_interval: 3660
  start: '2017-01-01T00:31:30'
  z_max: -1
  z_min: -1
- name: P1
  points:
  - - 1594500
    - 5487000
    - -1
  - - 1594500
    - 5483000
    - -1
  - - 1598000
    - 5486100
    - -1
  pulse_size: 10
  release_interval: 3600
resuspension:
  critical_friction_velocity: 0.005
time_step: 120
use_A_Z_profile: false
velocity_modifiers:
- class_name: oceantracker.velocity_modifiers.terminal_velocity.TerminalVelocity
  name: terminal_velocity
  value: -0.001

Trajectory modifiers#

Trajectory modifiers classes change the path of particles, examples from standard trajectory_modifiers classes below.

Particle behaviour#

Particles with a random fraction temporarily frozen on a polygon shaped reef.

  • class: trajectory_modifiers.settlement_in_polygon.SettleInPolygon

json parameters
/../dev/demo_param_files/demo06_reefstranding.json#
{
    "output_file_base": "demo06_reefstranding",
    "root_output_dir": "C:\\Auck_work\\oceantracker_output\\demos",
    "add_date_to_run_output_dir": false,
    "NUMBA_cache_code": false,
    "time_buffer_size": 15,
    "time_step": 600,
    "debug": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "Random_order_*.nc"
    },
    "user_note": "test of notes",
    "dispersion": {
        "A_H": 0.1
    },
    "tracks_writer": {
        "write_dry_cell_flag": true
    },
    "release_groups": [
        {
            "name": "P1",
            "points": [
                [
                    1594500,
                    5482700
                ],
                [
                    1598000,
                    5486100
                ],
                [
                    1595500,
                    5489700
                ]
            ],
            "pulse_size": 10,
            "release_interval": 10800
        },
        {
            "name": "poly1",
            "class_name": "oceantracker.release_groups.polygon_release.PolygonRelease",
            "points": [
                [
                    1597682.1237,
                    5489972.7479
                ],
                [
                    1598604.1667,
                    5490275.5488
                ],
                [
                    1598886.4247,
                    5489464.0424
                ],
                [
                    1597917.3387,
                    5489000
                ],
                [
                    1597300,
                    5489000
                ],
                [
                    1597682.1237,
                    5489972.7479
                ]
            ],
            "pulse_size": 1,
            "release_interval": 0
        }
    ],
    "particle_properties": [
        {
            "name": "Oxygen",
            "class_name": "AgeDecay",
            "decay_time_scale": 86400.0,
            "initial_value": 20.0
        },
        {
            "name": "distance_travelled",
            "class_name": "DistanceTravelled"
        },
        {
            "name": "age_decay",
            "class_name": "AgeDecay",
            "decay_time_scale": 86400.0
        },
        {
            "name": "my_constant_prop",
            "class_name": "ParticleLoad",
            "initial_value": 100
        }
    ],
    "block_dry_cells": true,
    "trajectory_modifiers": [
        {
            "name": "settle_in_polygon",
            "class_name": "oceantracker.trajectory_modifiers.settle_in_polygon.SettleInPolygon",
            "polygon": {
                "points": [
                    [
                        1597682.1237,
                        5489972.7479
                    ],
                    [
                        1598604.1667,
                        5490275.5488
                    ],
                    [
                        1598886.4247,
                        5489464.0424
                    ],
                    [
                        1597917.3387,
                        5489000
                    ],
                    [
                        1597300,
                        5489000
                    ],
                    [
                        1597682.1237,
                        5489972.7479
                    ]
                ]
            },
            "probability_of_settlement": 0.1,
            "settlement_duration": 10800.0
        }
    ],
    "backtracking": true,
    "particle_statistics": [
        {
            "name": "polystats1",
            "class_name": "oceantracker.particle_statistics.polygon_statistics.PolygonStats2D_timeBased",
            "update_interval": 1800,
            "particle_property_list": [
                "water_depth"
            ],
            "use_release_group_polygons": true,
            "polygon_list": [
                {
                    "points": [
                        [
                            1597682.1237,
                            5489972.7479
                        ],
                        [
                            1598604.1667,
                            5490275.5488
                        ],
                        [
                            1598886.4247,
                            5489464.0424
                        ],
                        [
                            1597917.3387,
                            5489000
                        ],
                        [
                            1597300,
                            5489000
                        ],
                        [
                            1597682.1237,
                            5489972.7479
                        ]
                    ]
                }
            ]
        }
    ]
}
yaml parameters
/../dev/demo_param_files/demo06_reefstranding.yaml#
NUMBA_cache_code: false
add_date_to_run_output_dir: false
backtracking: true
block_dry_cells: true
debug: true
dispersion:
  A_H: 0.1
output_file_base: demo06_reefstranding
particle_properties:
- class_name: AgeDecay
  decay_time_scale: 86400.0
  initial_value: 20.0
  name: Oxygen
- class_name: DistanceTravelled
  name: distance_travelled
- class_name: AgeDecay
  decay_time_scale: 86400.0
  name: age_decay
- class_name: ParticleLoad
  initial_value: 100
  name: my_constant_prop
particle_statistics:
- class_name: oceantracker.particle_statistics.polygon_statistics.PolygonStats2D_timeBased
  name: polystats1
  particle_property_list:
  - water_depth
  polygon_list:
  - points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5489000
    - - 1597300
      - 5489000
    - - 1597682.1237
      - 5489972.7479
  update_interval: 1800
  use_release_group_polygons: true
reader:
  file_mask: Random_order_*.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
release_groups:
- name: P1
  points:
  - - 1594500
    - 5482700
  - - 1598000
    - 5486100
  - - 1595500
    - 5489700
  pulse_size: 10
  release_interval: 10800
- class_name: oceantracker.release_groups.polygon_release.PolygonRelease
  name: poly1
  points:
  - - 1597682.1237
    - 5489972.7479
  - - 1598604.1667
    - 5490275.5488
  - - 1598886.4247
    - 5489464.0424
  - - 1597917.3387
    - 5489000
  - - 1597300
    - 5489000
  - - 1597682.1237
    - 5489972.7479
  pulse_size: 1
  release_interval: 0
root_output_dir: C:\Auck_work\oceantracker_output\demos
time_buffer_size: 15
time_step: 600
tracks_writer:
  write_dry_cell_flag: true
trajectory_modifiers:
- class_name: oceantracker.trajectory_modifiers.settle_in_polygon.SettleInPolygon
  name: settle_in_polygon
  polygon:
    points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5489000
    - - 1597300
      - 5489000
    - - 1597682.1237
      - 5489972.7479
  probability_of_settlement: 0.1
  settlement_duration: 10800.0
user_note: test of notes

Resuspension#

Particles with fall velocity and resuspension based on critical friction velocity.

  • class trajectory_modifiers.resuspension.BasicResuspension

../_images/demo59_crit_shear_resupension_section.jpeg

Vertical slice showing one example of a falling particle and resuspension, with particle on bottom during low flows around low and high tides. Blue line is particle status, 10= moving, 6 = on the bottom.

json parameters
/../dev/demo_param_files/demo58_bottomBounce.json#
{
    "output_file_base": "demo58_bottomBounce",
    "debug": true,
    "time_step": 120,
    "NUMBA_cache_code": false,
    "use_A_Z_profile": false,
    "regrid_z_to_uniform_sigma_levels": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "demo_hindcast_schisim3D_00.nc",
        "load_fields": [
            "water_temperature"
        ]
    },
    "dispersion": {
        "A_H": 0.1,
        "A_V": 0.005
    },
    "release_groups": [
        {
            "name": "P11",
            "pulse_size": 10,
            "release_interval": 0,
            "points": [
                [
                    1593000.0,
                    5486000.0,
                    -1
                ]
            ],
            "release_at_surface": true
        }
    ],
    "particle_properties": [
        {
            "name": "age_decay",
            "class_name": "oceantracker.particle_properties.age_decay.AgeDecay",
            "decay_time_scale": 86400.0
        }
    ],
    "event_loggers": [
        {
            "name": "inoutpoly",
            "class_name": "oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit",
            "particle_prop_to_write_list": [
                "ID",
                "x",
                "IDrelease_group",
                "status",
                "age"
            ],
            "polygon_list": [
                {
                    "user_polygon_name": "A",
                    "points": [
                        [
                            1592682.1237,
                            5489972.7479
                        ],
                        [
                            1593604.1667,
                            5490275.5488
                        ],
                        [
                            1593886.4247,
                            5489464.0424
                        ],
                        [
                            1592917.3387,
                            5489000.0
                        ],
                        [
                            1592300.0,
                            5489000.0
                        ],
                        [
                            1592682.1237,
                            5489972.7479
                        ]
                    ]
                },
                {
                    "user_polygon_name": "B",
                    "points": [
                        [
                            1597682.1237,
                            5489972.7479
                        ],
                        [
                            1598604.1667,
                            5490275.5488
                        ],
                        [
                            1598886.4247,
                            5489464.0424
                        ],
                        [
                            1597917.3387,
                            5487000
                        ],
                        [
                            1597300,
                            5487000
                        ],
                        [
                            1597682.1237,
                            5489972.7479
                        ]
                    ]
                }
            ]
        }
    ],
    "particle_statistics": [
        {
            "name": "grid1",
            "class_name": "oceantracker.particle_statistics.gridded_statistics2D.GriddedStats2D_timeBased",
            "update_interval": 3600,
            "particle_property_list": [
                "water_depth"
            ],
            "status_list": [
                "moving"
            ],
            "z_min": -2,
            "grid_span": [
                10000,
                10000
            ],
            "grid_size": [
                120,
                121
            ]
        }
    ],
    "resuspension": {
        "critical_friction_velocity": 0.005
    },
    "velocity_modifiers": [
        {
            "name": "terminal_velocity",
            "class_name": "oceantracker.velocity_modifiers.terminal_velocity.TerminalVelocity",
            "value": -0.002,
            "variance": 0.0002
        }
    ],
    "backtracking": false
}
yaml parameters
/../dev/demo_param_files/demo58_bottomBounce.yaml#
NUMBA_cache_code: false
backtracking: false
debug: true
dispersion:
  A_H: 0.1
  A_V: 0.005
event_loggers:
- class_name: oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit
  name: inoutpoly
  particle_prop_to_write_list:
  - ID
  - x
  - IDrelease_group
  - status
  - age
  polygon_list:
  - points:
    - - 1592682.1237
      - 5489972.7479
    - - 1593604.1667
      - 5490275.5488
    - - 1593886.4247
      - 5489464.0424
    - - 1592917.3387
      - 5489000.0
    - - 1592300.0
      - 5489000.0
    - - 1592682.1237
      - 5489972.7479
    user_polygon_name: A
  - points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5487000
    - - 1597300
      - 5487000
    - - 1597682.1237
      - 5489972.7479
    user_polygon_name: B
output_file_base: demo58_bottomBounce
particle_properties:
- class_name: oceantracker.particle_properties.age_decay.AgeDecay
  decay_time_scale: 86400.0
  name: age_decay
particle_statistics:
- class_name: oceantracker.particle_statistics.gridded_statistics2D.GriddedStats2D_timeBased
  grid_size:
  - 120
  - 121
  grid_span:
  - 10000
  - 10000
  name: grid1
  particle_property_list:
  - water_depth
  status_list:
  - moving
  update_interval: 3600
  z_min: -2
reader:
  file_mask: demo_hindcast_schisim3D_00.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
  load_fields:
  - water_temperature
regrid_z_to_uniform_sigma_levels: true
release_groups:
- name: P11
  points:
  - - 1593000.0
    - 5486000.0
    - -1
  pulse_size: 10
  release_at_surface: true
  release_interval: 0
resuspension:
  critical_friction_velocity: 0.005
time_step: 120
use_A_Z_profile: false
velocity_modifiers:
- class_name: oceantracker.velocity_modifiers.terminal_velocity.TerminalVelocity
  name: terminal_velocity
  value: -0.002
  variance: 0.0002

Splitting particles#

Particles with splitting in two every 6 hours and a 5% chance of dying every 6 hours.

  • class: trajectory_modifiers.split_particles.SplitParticles

  • class: trajectory_modifiers.cull_particles.CullParticles

json parameters
/../dev/demo_param_files/demo08_particle_splitting.json#
{
    "output_file_base": "demo08_particle_splitting",
    "root_output_dir": "C:\\Auck_work\\oceantracker_output\\demos",
    "add_date_to_run_output_dir": false,
    "NUMBA_cache_code": false,
    "time_buffer_size": 15,
    "time_step": 600,
    "debug": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "Random_order_*.nc"
    },
    "user_note": "test of notes",
    "dispersion": {
        "A_H": 0.1
    },
    "tracks_writer": {
        "write_dry_cell_flag": true
    },
    "release_groups": [
        {
            "name": "P1",
            "points": [
                [
                    1594500,
                    5483500
                ],
                [
                    1594500,
                    5486500
                ]
            ],
            "pulse_size": 1,
            "release_interval": 0
        }
    ],
    "particle_properties": [
        {
            "name": "age_decay",
            "class_name": "oceantracker.particle_properties.age_decay.AgeDecay",
            "decay_time_scale": 86400.0
        }
    ],
    "block_dry_cells": true,
    "event_loggers": [
        {
            "name": "in_out_poly",
            "class_name": "oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit",
            "particle_prop_to_write_list": [
                "ID",
                "x",
                "IDrelease_group",
                "status",
                "age"
            ],
            "polygon_list": [
                {
                    "user_polygon_name": "A",
                    "points": [
                        [
                            1592682.1237,
                            5489972.7479
                        ],
                        [
                            1593604.1667,
                            5490275.5488
                        ],
                        [
                            1593886.4247,
                            5489464.0424
                        ],
                        [
                            1592917.3387,
                            5489000.0
                        ],
                        [
                            1592300.0,
                            5489000.0
                        ],
                        [
                            1592682.1237,
                            5489972.7479
                        ]
                    ]
                },
                {
                    "user_polygon_name": "B",
                    "points": [
                        [
                            1597682.1237,
                            5489972.7479
                        ],
                        [
                            1598604.1667,
                            5490275.5488
                        ],
                        [
                            1598886.4247,
                            5489464.0424
                        ],
                        [
                            1597917.3387,
                            5487000
                        ],
                        [
                            1597300,
                            5487000
                        ],
                        [
                            1597682.1237,
                            5489972.7479
                        ]
                    ]
                }
            ]
        }
    ],
    "max_particles": 1000,
    "trajectory_modifiers": [
        {
            "name": "part_spliting",
            "class_name": "oceantracker.trajectory_modifiers.split_particles.SplitParticles",
            "interval": 21600,
            "statuses": [
                "moving"
            ]
        },
        {
            "name": "part_culling",
            "class_name": "oceantracker.trajectory_modifiers.cull_particles.CullParticles",
            "interval": 21600,
            "statuses": [
                "moving"
            ],
            "probability": 0.05
        }
    ]
}
yaml parameters
/../dev/demo_param_files/demo08_particle_splitting.yaml#
NUMBA_cache_code: false
add_date_to_run_output_dir: false
block_dry_cells: true
debug: true
dispersion:
  A_H: 0.1
event_loggers:
- class_name: oceantracker.event_loggers.log_polygon_entry_and_exit.LogPolygonEntryAndExit
  name: in_out_poly
  particle_prop_to_write_list:
  - ID
  - x
  - IDrelease_group
  - status
  - age
  polygon_list:
  - points:
    - - 1592682.1237
      - 5489972.7479
    - - 1593604.1667
      - 5490275.5488
    - - 1593886.4247
      - 5489464.0424
    - - 1592917.3387
      - 5489000.0
    - - 1592300.0
      - 5489000.0
    - - 1592682.1237
      - 5489972.7479
    user_polygon_name: A
  - points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5487000
    - - 1597300
      - 5487000
    - - 1597682.1237
      - 5489972.7479
    user_polygon_name: B
max_particles: 1000
output_file_base: demo08_particle_splitting
particle_properties:
- class_name: oceantracker.particle_properties.age_decay.AgeDecay
  decay_time_scale: 86400.0
  name: age_decay
reader:
  file_mask: Random_order_*.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
release_groups:
- name: P1
  points:
  - - 1594500
    - 5483500
  - - 1594500
    - 5486500
  pulse_size: 1
  release_interval: 0
root_output_dir: C:\Auck_work\oceantracker_output\demos
time_buffer_size: 15
time_step: 600
tracks_writer:
  write_dry_cell_flag: true
trajectory_modifiers:
- class_name: oceantracker.trajectory_modifiers.split_particles.SplitParticles
  interval: 21600
  name: part_spliting
  statuses:
  - moving
- class_name: oceantracker.trajectory_modifiers.cull_particles.CullParticles
  interval: 21600
  name: part_culling
  probability: 0.05
  statuses:
  - moving
user_note: test of notes

Particle Statistics#

Heat maps#

Heatmaps built on the fly with no particle tracks recorded. Options for both time and aged based gridded heatmaps

  • class: particle_statistics.gridded_statistics.GriddedStats2D_timeBased

  • class: particle_statistics.gridded_statistics.GriddedStats2D_agedBased

along with counts of particles inside polygons

  • class: particle_statistics.polygon_statistics.PolygonStats2D_timeBased

  • class: particle_statistics.polygon_statistics.PolygonStats2D_ageBased

json parameters
/../dev/demo_param_files/demo03_heatmaps.json#
{
    "output_file_base": "demo03_heatmaps",
    "root_output_dir": "C:\\Auck_work\\oceantracker_output\\demos",
    "add_date_to_run_output_dir": false,
    "NUMBA_cache_code": false,
    "time_buffer_size": 15,
    "time_step": 900,
    "debug": true,
    "reader": {
        "input_dir": "C:\\Auck_work\\oceantracker\\tutorials_how_to\\demo_hindcast",
        "file_mask": "Random_order_*.nc"
    },
    "user_note": "test of notes",
    "dispersion": {
        "A_H": 0.1
    },
    "tracks_writer": {
        "turn_on_write_particle_properties_list": [
            "n_cell"
        ],
        "write_dry_cell_flag": true
    },
    "release_groups": [
        {
            "name": "myP1",
            "points": [
                [
                    1596000,
                    5486000
                ]
            ],
            "pulse_size": 2000,
            "release_interval": 7200,
            "release_radius": 100.0
        },
        {
            "name": "myP2",
            "points": [
                [
                    1596000,
                    5490000
                ]
            ],
            "pulse_size": 3000,
            "release_interval": 3600
        }
    ],
    "particle_properties": [
        {
            "name": "Oxygen",
            "class_name": "AgeDecay",
            "decay_time_scale": 86400.0,
            "initial_value": 20.0
        },
        {
            "name": "distance_travelled",
            "class_name": "DistanceTravelled"
        },
        {
            "name": "age_decay",
            "class_name": "AgeDecay",
            "decay_time_scale": 86400.0
        },
        {
            "name": "my_constant_prop",
            "class_name": "ParticleLoad",
            "initial_value": 100
        }
    ],
    "particle_statistics": [
        {
            "name": "gridstats1",
            "class_name": "oceantracker.particle_statistics.gridded_statistics2D.GriddedStats2D_timeBased",
            "update_interval": 1800,
            "particle_property_list": [
                "water_depth"
            ],
            "grid_span": [
                10000,
                10000
            ],
            "grid_size": [
                220,
                221
            ]
        },
        {
            "name": "polystats1",
            "class_name": "oceantracker.particle_statistics.polygon_statistics.PolygonStats2D_timeBased",
            "update_interval": 1800,
            "particle_property_list": [
                "water_depth"
            ],
            "polygon_list": [
                {
                    "points": [
                        [
                            1597682.1237,
                            5489972.7479
                        ],
                        [
                            1598604.1667,
                            5490275.5488
                        ],
                        [
                            1598886.4247,
                            5489464.0424
                        ],
                        [
                            1597917.3387,
                            5489000
                        ],
                        [
                            1597300,
                            5489000
                        ],
                        [
                            1597682.1237,
                            5489972.7479
                        ]
                    ]
                }
            ]
        }
    ],
    "particle_buffer_initial_size": 20000,
    "write_tracks": false,
    "max_run_duration": 259200
}
yaml parameters
/../dev/demo_param_files/demo03_heatmaps.yaml#
NUMBA_cache_code: false
add_date_to_run_output_dir: false
debug: true
dispersion:
  A_H: 0.1
max_run_duration: 259200
output_file_base: demo03_heatmaps
particle_buffer_initial_size: 20000
particle_properties:
- class_name: AgeDecay
  decay_time_scale: 86400.0
  initial_value: 20.0
  name: Oxygen
- class_name: DistanceTravelled
  name: distance_travelled
- class_name: AgeDecay
  decay_time_scale: 86400.0
  name: age_decay
- class_name: ParticleLoad
  initial_value: 100
  name: my_constant_prop
particle_statistics:
- class_name: oceantracker.particle_statistics.gridded_statistics2D.GriddedStats2D_timeBased
  grid_size:
  - 220
  - 221
  grid_span:
  - 10000
  - 10000
  name: gridstats1
  particle_property_list:
  - water_depth
  update_interval: 1800
- class_name: oceantracker.particle_statistics.polygon_statistics.PolygonStats2D_timeBased
  name: polystats1
  particle_property_list:
  - water_depth
  polygon_list:
  - points:
    - - 1597682.1237
      - 5489972.7479
    - - 1598604.1667
      - 5490275.5488
    - - 1598886.4247
      - 5489464.0424
    - - 1597917.3387
      - 5489000
    - - 1597300
      - 5489000
    - - 1597682.1237
      - 5489972.7479
  update_interval: 1800
reader:
  file_mask: Random_order_*.nc
  input_dir: C:\Auck_work\oceantracker\tutorials_how_to\demo_hindcast
release_groups:
- name: myP1
  points:
  - - 1596000
    - 5486000
  pulse_size: 2000
  release_interval: 7200
  release_radius: 100.0
- name: myP2
  points:
  - - 1596000
    - 5490000
  pulse_size: 3000
  release_interval: 3600
root_output_dir: C:\Auck_work\oceantracker_output\demos
time_buffer_size: 15
time_step: 900
tracks_writer:
  turn_on_write_particle_properties_list:
  - n_cell
  write_dry_cell_flag: true
user_note: test of notes
write_tracks: false
About
Getting started

On this page

  • Particle properties
    • Decaying particle
    • Polygon aware particles
    • Particle Status
  • Trajectory modifiers
    • Particle behaviour
    • Resuspension
  • Splitting particles
  • Particle Statistics
    • Heat maps

© 2026, R. Vennell Built with Sphinx 8.2.3