Skip to content
Lori Garzio edited this page May 22, 2024 · 3 revisions

RU‐COOL glider track .kmz generation

The main script gliderkmz.py in this repository uses Jinja templates to generate .kmz files of glider tracks. This python script can take a specific deployment name (format: glidername-YYYYMMDDTHHMM) OR "active" as the main argument. For example:

> python ./gliderkmz.py ru34-20240301T1336 -t templates -c configuration_directory -s savedir

Generates a .kmz file for ru34-20240301T1336 with the default input "-kml_type deployed", which is the default glider track with pop-ups for all surfacings containing pertinent information parsed from the surface dialog files that are accessed via the RU-COOL glider API.

Other options for -kml_type:

  • deployed_ts: same as "deployed" with the option to filter the glider track by time
  • deployed_uv: same as "deployed" with vectors at each glider surfacing that depict the final location of the glider if drifting for 24-hours (an indication of strength and direction of depth-averaged currents)
  • deployed_uv_ts: combination of "deployed_ts" and "deployed_uv"

Alternatively, a .kmz file containing all active glider deployments can be generated by first running the following script to generate/update a configuration file that identifies all active deployments (determined by querying the Active Deployments API) and specifies the deployment track color.

> python ./setup_active_deployments_yaml.py configuration_directory

This ensures that glider tracks for active deployments won't change color when the .kmzs are rendered in Google Earth if another glider was either recovered or deployed. After the active_deployments config file is up-to-date, the active .kmzs can be generated using the following command:

> python ./gliderkmz.py active -t templates -c configuration_directory -s savedir

Required arguments for the script are:

There are example shell scripts that illustrate how to run the gliderkmz.py script for active deployments and individual deployments.

Clone this wiki locally