ParX

Data File Format

ParX accepts two file formats for handling the measurement data. First, a JSON format that is mainly useful for interfacing with other data collection tools. Second, a “standard” Comma Separated Values (CSV) format that is more suitable for human data entry.

JSON format

The best explanation is by example:


                                        {
                                            "info": "simple quadratic data",
                                            "author": "me@me.com",
                                            "date": "2024/01/01",
                                            "version": "1.0.0",
                                            "header": [
                                                { "name": "x" }, { "name": "y" }
                                            ],
                                            "data": [
                                                {
                                                    "grpid": 0, "crvid": 1, "rowid": 1,
                                                    "val": [0.0, 0.0],
                                                    "err": [0.0, 0.0]
                                                }, {
                                                    "grpid": 0, "crvid": 1, "rowid": 2,
                                                    "val": [1.0, 1.0],
                                                    "err": [0.1, 0.1]
                                                }, {
                                                    "grpid": 0, "crvid": 1, "rowid": 3,
                                                    "val": [2.0, 4.0],
                                                    "err": [0.2, 0.4]
                                                }, {
                                                    "grpid": 0, "crvid": 1, "rowid": 4,
                                                    "val": [3.0, 9.0],
                                                    "err": [0.3, 0.9]
                                                }, {
                                                    "grpid": 0, "crvid": 1, "rowid": 5,
                                                    "val": [4.0, 16.0],
                                                    "err": [0.4, 1.60]
                                                }, {
                                                    "grpid": 0, "crvid": 1, "rowid": 6,
                                                    "val": [5.0, 25.0],
                                                    "err": [0.5, 2.50]
                                                }
                                            ]
                                        }
                                        

The info, author, date and version keys allow for some meta-information. The info-key will be displayed as the title of the graph, the others are shown in the data-pane. It is followed by the specification of the model interface variables under the header-key: x and y in this case. The order is important and must be matched in the data columns. Under the data-key sits an array of data points. Each data point has some optional meta-data, such as group, curve and row. The val-key has the array of measured values, and the err-key their associated error-intervals. The err-key is optional, with all zero’s as the default. Here, all errors are 10% of the measured value. The default text encoding for JSON is UTF8. The variable names in the header must obey the same rules as those in de model definition.

CSV format

The same data in a spreadsheet:

ParX data format Excel spreadsheet

Here the columns with the error intervals are specified with the suffix :err. (Instead of “err”, any abbreviation of “error”, “accuracy” or “precision” will do).

You can create compatible CSV-files from Microsoft Excel, Apple Numbers, or LibreOffice Calc. Care has been taken to allow for a wide range of CSV formats with different localizations. The column separator can be either a comma, a semicolon or a tab. The number decimal separator character can be either a comma or a period. The variable names in the header row must obey the same rules as those in the model definition. If required make sure the text encoding is set to UTF8 (or UTF16 for Excel). The file extension is .csv, .tsv or .txt to accommodate Excel style TSV files.

The meta-information can be added to the csv-file in the form of comments. Comments are not part of the formal format specification, but a generally accepted format is a line starting with a '#' character.


                                            #info "simple quadratic data"
                                            #author "me@me.com"
                                            #date "2024/01/01"
                                            #version "1.0.0"
                                        

For compatibility with other programs it is advised to put the comment block at the end of the CSV-file, as not to interfere with the parsing of the file header.