trap-manage.py

trap-manage.py is the command-line tool for initialising and running the TraP pipeline. Different tasks are handled via the use of ‘subcommands’ as detailed below.

When the TraP is correctly installed on the system you can issue the trap-manage.py command. Documentation of subcommands is also available on the command line. You can use the --help flag (also per subcommand) to explore all possible options.


A tool for managing TKP projects.

Use ‘initproject’ to create a project directory. Other Subcommands should be run from within a project directory.

NB: To overwrite the database settings in pipeline.cfg you can use these environment variables to configure the connection:

  • TKP_DBENGINE
  • TKP_DBNAME
  • TKP_DBUSER
  • TKP_DBPASSWORD
  • TKP_DBHOST
  • TKP_DBPORT

(This is useful for setting up test databases, etc.)

usage: trap-manage.py [-h] {initproject,initjob,run,initdb,deldataset} ...

Sub-commands:

initproject

Initialize a pipeline project directory, complete with config files which you can use to configure your pipeline.
trap-manage.py initproject [-h] [-t TARGET] name

Positional Arguments

name project folder name

Named Arguments

-t, --target location of new TKP project

initjob

Create a job folder, complete with job-specific config files which you will need to modify.
trap-manage.py initjob [-h] name

Positional Arguments

name Name of new job

run

Run a job by specifying the name of the job folder.

trap-manage.py run [-h] [-m MONITOR_COORDS] [-l MONITOR_LIST] name

Positional Arguments

name Name of job to run

Named Arguments

-m, --monitor-coords
 a list of RA,DEC coordinates to monitor in JSON format, (decimal degrees) example: “[[5, 6], [7, 8]]”
-l, --monitor-list
 Specify a file containing the JSON-formatted monitor co-ordinates.

initdb

Initialize a database with the TKP schema.

trap-manage.py initdb [-h] [-y] [-d]

Named Arguments

-y, --yes

don’t ask for confirmation

Default: False

-d, --destroy

remove all tables before population(only works with Postgres backend)

Default: False

deldataset

Delete a dataset from a database

trap-manage.py deldataset [-h] [-y] id

Positional Arguments

id dataset id

Named Arguments

-y, --yes

don’t ask for confirmation

Default: False