zs2decode reads Zwick Roell zs2
and zp2
file formats. It can generate XML files for convenient extraction of measurements and meta data. The proprietory zs2
file format is generated by testXpert II
and testXpert III
, the control software of Zwick Roell Materials Testing Machines.
zs2
files contain data in a compressed, binary-encoded XML-like structure. The binary data stream is comprised of chunks similar to PNG files.
zs2decode is a Python (2.7, 3.4 - 3.10) implementation of a zs2
file decoder. It can be obtained from the GitHub repository. In order to convert a zs2
file into XML, the following script can be used:
import zs2decode.parser
import zs2decode.util
zs2_file_name = 'my_data_file.zs2'
xml_output_file = 'my_data_file.xml'
# load and decompress file
data_stream = zs2decode.parser.load(zs2_file_name)
# separate binary data stream into chunks
raw_chunks = zs2decode.parser.data_stream_to_chunks(data_stream)
# convert binary chunk data into lists of Python objects
chunks = zs2decode.parser.parse_chunks(raw_chunks)
# output as XML file
with open(xml_output_file, 'wb') as f:
f.write( zs2decode.util.chunks_to_XML(chunks) )
The output of zs2decode can be used to extract meta data, acquision parameters and measurements. An example script is provided to extract raw measurements from the XML output.
The zs2
file format specification is not distributed publicly. All information in this document comes from reverse-engineering of files written by testXpert II
version 3.1 and user feedback on the github issue tracker. This project is not associated with Zwick Roell.
The zs2
file format is unrelated to the zs file format for compressed sets of Nathaniel J. Smith.
format special_chunks
genindex
modindex
search