Swarm-NG  1.1
swarm-query.py command-line interface

swarm-query.py (located at SOURCE_DIRECTORY/py/bin/swarm-query.py) is a utility written in Python that provides a command-line interface to the basic querying functionalities of BDB log querying API (refer to Query API).

The only required option is the database name specified through -d option. If no querying option is specified, all of the records up to MAX_RECORDS (default 10000) is printed to the output.

One or more querying options can be specified to retrieve specific records from the log database. time and system ranges are the usual cases.

There are two special queries: initial and final conditions:

  • initial condition of a system is the the record with smallest timestamp for the system, usually at time 0.
  • final condition of a system is the record with largest timestamp for the system, usually the last recorded state of a system before it is disabled (when it goes unstable)

Log database options:

  • -d DATABASE : specify a path to the BDB database file generated from an integration using bdb_writer.
  • -m MAX_RECORDS: maximum number of records to view (a record is one event, usually a snapshot of the state of one planetry system)

Querying criteria:

  • -s SYSTEM_RANGE: Range of systems to show; it can be a single number or a range like 12..6
  • -t TIME_RANGE: Time range to show; e.g. 1.0..30.0
  • -b BODY_RANGE: Range of number of planets to show in the output; e.g. 1..3 or 2
  • -e EVT_ID: Type of events to show in the output.
  • –initial-conditions : display initial conditions of the specified systems (overrides time range)
  • –final-conditions: display final conditions of the specified systems (overrides time range)

Output options:

  • -k CENTER: Output using Keplerian coordinates, 4 different interpretation of center exists: – astrocentric: The star (body number 0) – barycentric: Barycenter of whole system – jacobi: For body number i, barycenter of bodies 0..i-1 is the center – origin: Origin (0,0,0)