Skip to content

pygmt.x2sys_init: Initialize a new x2sys track database #4570

Closed

Description

@seisman

This issue serves as the central place for discussing and tracking the implementation of the pygmt.x2sys_init function in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at PyGMT: Wrapping GMT modules.

Documentation

GMT Option Flags and Modifiers

☑️: Implemented; ⬜: To be implemented/discussed; Strikethrough: Won't implement.

  • ☑️ -D (fmtfile): Format definition file prefix for this data type; several built-in formats are provided (e.g., "mgd77", "xyz", "geo").
  • ☑️ -E (suffix): File extension (suffix) for the track data files.
  • ☑️ -F (force): Force a re-initialization of an existing TAG, overwriting the previous settings.
  • ☑️ -G (discontinuity): d|g. Select geographic coordinates and the longitude discontinuity convention (d for dateline, g for Greenwich).
  • ☑️ -I (spacing): dx[/dy]. Grid spacing for the track bin-index database.
  • ☑️ -N (units): d|s unit. Set the distance and speed units.
  • ☑️ -R (region): The region covered by the track data.
  • ☑️ -V (verbose): Verbosity level.
  • ☑️ -W (gap): t|d gap. Maximum time or distance gap between consecutive data points before a data gap is declared.
  • ☑️ -j (distcalc): Distance calculation mode (great circle, rhumb, Cartesian).
  • --PAR=value: Use pygmt.config instead.

Notes on Input Formats

  • tag (positional): The unique name for this x2sys TAG; all subsequent x2sys_cross calls reference this TAG.
  • x2sys_init does not take a data table as input; it creates configuration files in the directory pointed to by the X2SYS_HOME environment variable.
  • The X2SYS_HOME environment variable must be set to a writable directory before calling x2sys_init; otherwise GMT will raise an error.
  • Commonly used built-in fmtfile prefixes include "mgd77" (ASCII MGD77 marine geophysical data), "mgd77+" (enhanced MGD77+ netCDF), "xyz" (plain ASCII x,y,z), and "geo" (lon,lat).

Linked Pull Requests

  • Initial feature implementation – Wrap x2sys_init and x2sys_cross #546
  • Add a gallery or tutorial example (e.g., setting up an MGD77 TAG and running a crossover analysis with pygmt.x2sys_cross)

Related Issues and Discussions

  • pygmt.x2sys_init is always called first in an x2sys workflow; it must be run once to create the TAG before any pygmt.x2sys_cross calls.
  • All options currently appear to be implemented; this issue primarily tracks gallery examples and future maintenance tasks.
  • The force=True option is useful in automated testing or batch workflows where the TAG directory may already exist from a previous run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions