Validate TSDF file

Files can be validated using the validator module, which is also callable from the command line. The validator checks the metadata file and inspects whether the binary file is consistent with the metadata.

The validator can be called from the command line as follows:

pip install tsdf  # in case you didn't already do this
validate-tsdf file-to-check.json

The snippet below shows how to use the validator from code.

import os
from tsdf import validator

data_dir = "../tests/data"
# Verify the metadata file
path_to_metadata_file = os.path.join(data_dir, "ppp_format_meta.json")
result = validator.validate_tsdf_format(path_to_metadata_file)
Successfully loaded binary file ppp_format_time.bin, resulting shape: (17,)
Successfully loaded binary file ppp_format_samples.bin, resulting shape: (17, 6)