Matrix Translation#

This section explains the CLI functionality for translating matrix data from one zone system to another.

See also

Translation for translations of vector based data.

Zone translation can be called using one of the following sub-commands:

  • matrix-translate: provide all inputs as arguments; or

  • matrix-translate-config: provide the path to a config file containing inputs.

More details on both commands are explained below in Sub-Commands.

Note

Both commands perform the exact same translation but they allow the inputs to be provided in slightly different ways.

Sub-Commands#

matrix-translate#

Translate a matrix file to a new zoning system, using given translation lookup file. Matrix CSV file should be in the long format i.e. 3 columns.

usage: caf.toolkit matrix-translate [options] data_file translation_file

Positional Arguments#

data_file

CSV file containing data to be translated

translation_file

CSV file defining how to translate and the weightings to use

Named Arguments#

--output_file

Location to save the translated output

Default: translated.csv

--from_column

The column (name or position) in the translation file containing the zone ids to translate from

Default: 0

--to_column

The column (name or position) in the translation file containing the zone ids to translate to

Default: 1

--factor_column

The column (name or position) in the translation file containing the weightings between from and to zones

Default: 2

--zone_column

The 2 columns (name or position) in the matrix file containing the zone ids

Default: (0, 1)

--value_column

The column (name or position) in the CSV file containing the matrix values

Default: 2

matrix-translate-config#

Translate a matrix file to a new zoning system, using given translation lookup file. Matrix CSV file should be in the long format i.e. 3 columns.

usage: caf.toolkit matrix-translate-config [options] config_path

Positional Arguments#

config_path

path to YAML config file containing run parameters