1. Introduction / Opening WelDX Files#

NEXT TUTORIAL >>

1.1. Introduction#

This tutorial is the first one of a whole series that has the purpose to teach you how to work with WelDX files using the weldx Python package. In each tutorial, we will focus on a small feature set and learn step by step how you can find, extract and process data stored in a WelDX file. In this tutorial series, we will only focus on reading from already existing files. How to write and modify a WelDX file will be covered in a follow up-series.

Note that we will only cover the most common features and not all possible tools the weldx package provides. For more in-depth information, read the dedicated API tutorials or have a look at the API documentation page.

1.2. Jupyter notebooks and online documentation#

All tutorials are written as jupyter notebooks so that you can always run and test the code on your local machine. You can find them in the tutorials subdirectory of our GitHub repository. To learn how to install the weldx package and all required dependencies to run the tutorials, visit the installation guide page of our online documentation.

All tutorials are also contained on the “Getting Started” page of the online documentation so that you can read a nicely rendered version online.

However, we strongly recommend to run and read the tutorials in a running jupyter-lab session. Some features like interactive plots can only be displayed correctly by a jupyter server. This will start a virtual machine with everything set up correctly that you can access through your browser.

1.3. Opening and navigating through WelDX Files#

1.3.1. Opening a WelDX File#

The first lesson we will learn is how to open a WelDX file and to get an overview of its content. Opening a file using the weldx package is rather simple. First we import the WeldxFile class from weldx:

# download the example file for this tutorial

from util import download_tutorial_input_file

download_tutorial_input_file(print_status=False)
from weldx import WeldxFile

WelDX files usually have the extension .weldx or .wx, but any other is also possible as long as the content is valid. For the purpose of this tutorial series, we will deal with a single file called single_pass_weld.wx. To open it, simply create a new instance of the WeldxFile class and pass the file path to it:

wxfile = WeldxFile("single_pass_weld.wx")
/home/docs/checkouts/readthedocs.org/user_builds/weldx/conda/latest/lib/python3.10/site-packages/asdf/asdf.py:340: AsdfWarning: File 'file:///home/docs/checkouts/readthedocs.org/user_builds/weldx/checkouts/latest/doc/src/tutorials/single_pass_weld.wx' was created with extension URI 'asdf://weldx.bam.de/weldx/extensions/weldx-0.1.1' (from package weldx==0.6.0), which is not currently installed
  warnings.warn(msg, AsdfWarning)

1.3.2. Inspecting the file content in a Jupyter session#

If you are running a jupyter notebook, you can use the header method of WeldxFile to get a nicely rendered overview of the file content. The output might vary if you are running the classic notebook environment or a Jupyter-Lab environment. In the latter case, you will get an interactive, clickable tree view to navigate through the file content. Uncomment the code in the next cell to try it out:

wxfile.header(use_widgets=True)
  • "/":
    {
    • "asdf_library":
      {
      • "author": "The ASDF Developers",
      • "homepage": "http://github.com/asdf-format/asdf",
      • "name": "asdf",
      • "version": "2.15.1"
      },
    • "history":
      {
      • "extensions":
        [
        • {
          • "extension_class": "asdf.extension.BuiltinExtension",
          • "software":
            {
            • "name": "asdf",
            • "version": "2.15.1"
            }
          },
        • {
          • "extension_class": "weldx.asdf.extension.WeldxExtension",
          • "extension_uri": "asdf://weldx.bam.de/weldx/extensions/weldx-0.1.2",
          • "software":
            {
            • "name": "weldx",
            • "version": "0.7.4.dev6+g2331a004c.d20260507"
            }
          }
        ]
      },
    • "TCP":
      {
      • "reference_time": "2021-03-17T11:06:42.334400",
      • "time":
        {
        • "values":
          {
          • "data": [],
          • "datatype": "int64",
          • "shape":
            [
            • 2
            ]
          },
        • "start": "P0DT0H0M0S",
        • "end": "P0DT0H0M41.333333333S",
        • "min": "P0DT0H0M0S",
        • "max": "P0DT0H0M41.333333333S"
        },
      • "coordinates":
        {
        • "name": "coordinates",
        • "dimensions":
          [
          • "time",
          • "c"
          ],
        • "dtype": ",
        • "units": "millimeter",
        • "data":
          {
          • "data": [],
          • "datatype": "float64",
          • "shape":
            [
            • 2,
            • 3
            ]
          }
        }
      },
    • "coordinate_systems":
      {
      • "name": "Robot Trace",
      • "reference_time": "2021-03-17T11:06:42.334400",
      • "graph":
        {
        • "root_node":
          {
          • "name": "user_frame",
          • "attributes":
            {
            • "data": {}
            },
          • "edges":
            [
            • {
              • "direction": "fwd",
              • "attributes":
                {
                • "defined": true,
                • "transformation":
                  {
                  • "coordinates":
                    {
                    • "name": "coordinates",
                    • "dimensions":
                      [
                      • "c"
                      ],
                    • "dtype": ",
                    • "units": "millimeter",
                    • "data":
                      {
                      • "data": [],
                      • "datatype": "float64",
                      • "shape":
                        [
                        • 3
                        ]
                      }
                    }
                  }
                },
              • "target_node":
                {
                • "name": "workpiece",
                • "attributes":
                  {
                  • "data":
                    {
                    • "scan_0":
                      {
                      • "coordinates":
                        {
                        • "value":
                          {
                          • "data": [],
                          • "datatype": "float64",
                          • "shape":
                            [
                            • 277977,
                            • 3
                            ]
                          },
                        • "units": "millimeter"
                        },
                      • "triangles":
                        {
                        • "data": [],
                        • "datatype": "uint64",
                        • "shape":
                          [
                          • 553800,
                          • 3
                          ]
                        }
                      },
                    • "scan_1":
                      {
                      • "coordinates":
                        {
                        • "value":
                          {
                          • "data": [],
                          • "datatype": "float64",
                          • "shape":
                            [
                            • 249368,
                            • 3
                            ]
                          },
                        • "units": "millimeter"
                        },
                      • "triangles":
                        {
                        • "data": [],
                        • "datatype": "uint64",
                        • "shape":
                          [
                          • 496716,
                          • 3
                          ]
                        }
                      }
                    }
                  },
                • "edges":
                  [
                  • {
                    • "direction": "bwd",
                    • "attributes":
                      {
                      • "defined": true,
                      • "transformation":
                        {
                        • "time":
                          {
                          • "values":
                            {
                            • "data": [],
                            • "datatype": "int64",
                            • "shape":
                              [
                              • 2
                              ]
                            },
                          • "start": "P0DT0H0M0S",
                          • "end": "P0DT0H0M41.333333333S",
                          • "min": "P0DT0H0M0S",
                          • "max": "P0DT0H0M41.333333333S"
                          },
                        • "coordinates":
                          {
                          • "name": "coordinates",
                          • "dimensions":
                            [
                            • "time",
                            • "c"
                            ],
                          • "dtype": ",
                          • "units": "millimeter",
                          • "data":
                            {
                            • "data": [],
                            • "datatype": "float64",
                            • "shape":
                              [
                              • 2,
                              • 3
                              ]
                            }
                          }
                        }
                      },
                    • "target_node":
                      {
                      • "name": "TCP design",
                      • "attributes":
                        {
                        • "data": {}
                        }
                      }
                    },
                  • {
                    • "direction": "bwd",
                    • "attributes":
                      {
                      • "defined": true,
                      • "transformation":
                        {
                        • "coordinates":
                          {
                          • "name": "coordinates",
                          • "dimensions":
                            [
                            • "c"
                            ],
                          • "dtype": ",
                          • "units": "millimeter",
                          • "data":
                            {
                            • "data": [],
                            • "datatype": "float64",
                            • "shape":
                              [
                              • 3
                              ]
                            }
                          }
                        }
                      },
                    • "target_node":
                      {
                      • "name": "T1",
                      • "attributes":
                        {
                        • "data": {}
                        },
                      • "edges":
                        [
                        • {
                          • "direction": "bwd",
                          • "attributes":
                            {
                            • "defined": true,
                            • "transformation":
                              {
                              • "coordinates":
                                {
                                • "name": "coordinates",
                                • "dimensions":
                                  [
                                  • "c"
                                  ],
                                • "dtype": ",
                                • "units": "millimeter",
                                • "data":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 3
                                    ]
                                  }
                                }
                              }
                            },
                          • "target_node":
                            {
                            • "name": "T2",
                            • "attributes":
                              {
                              • "data": {}
                              }
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              },
            • {
              • "direction": "bwd",
              • "attributes":
                {
                • "defined": true,
                • "transformation":
                  {
                  • "reference_time": "2021-03-17T11:06:41.849400",
                  • "time":
                    {
                    • "start": "P0DT0H0M0S",
                    • "end": "P0DT0H0M41.4S",
                    • "freq": "8ms",
                    • "min": "P0DT0H0M0S",
                    • "max": "P0DT0H0M41.4S"
                    },
                  • "coordinates":
                    {
                    • "name": "coordinates",
                    • "dimensions":
                      [
                      • "time",
                      • "c"
                      ],
                    • "dtype": ",
                    • "units": "millimeter",
                    • "data":
                      {
                      • "data": [],
                      • "datatype": "float64",
                      • "shape":
                        [
                        • 5176,
                        • 3
                        ]
                      }
                    }
                  }
                },
              • "target_node":
                {
                • "name": "TCP",
                • "attributes":
                  {
                  • "data": {}
                  },
                • "edges":
                  [
                  • {
                    • "direction": "fwd",
                    • "attributes":
                      {
                      • "defined": true,
                      • "transformation":
                        {
                        • "orientations":
                          {
                          • "name": "orientations",
                          • "dimensions":
                            [
                            • "c",
                            • "v"
                            ],
                          • "dtype": ",
                          • "data":
                            {
                            • "data": [],
                            • "datatype": "float64",
                            • "shape":
                              [
                              • 3,
                              • 3
                              ]
                            }
                          },
                        • "coordinates":
                          {
                          • "name": "coordinates",
                          • "dimensions":
                            [
                            • "c"
                            ],
                          • "dtype": ",
                          • "units": "millimeter",
                          • "data":
                            {
                            • "data": [],
                            • "datatype": "float64",
                            • "shape":
                              [
                              • 3
                              ]
                            }
                          }
                        }
                      },
                    • "target_node":
                      {
                      • "name": "flange",
                      • "attributes":
                        {
                        • "data": {}
                        },
                      • "edges":
                        [
                        • {
                          • "direction": "bwd",
                          • "attributes":
                            {
                            • "defined": true,
                            • "transformation":
                              {
                              • "orientations":
                                {
                                • "name": "orientations",
                                • "dimensions":
                                  [
                                  • "c",
                                  • "v"
                                  ],
                                • "dtype": ",
                                • "data":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 3,
                                    • 3
                                    ]
                                  }
                                },
                              • "coordinates":
                                {
                                • "name": "coordinates",
                                • "dimensions":
                                  [
                                  • "c"
                                  ],
                                • "dtype": ",
                                • "units": "millimeter",
                                • "data":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 3
                                    ]
                                  }
                                }
                              }
                            },
                          • "target_node":
                            {
                            • "name": "LLT_1",
                            • "attributes":
                              {
                              • "data": {}
                              }
                            }
                          },
                        • {
                          • "direction": "bwd",
                          • "attributes":
                            {
                            • "defined": true,
                            • "transformation":
                              {
                              • "orientations":
                                {
                                • "name": "orientations",
                                • "dimensions":
                                  [
                                  • "c",
                                  • "v"
                                  ],
                                • "dtype": ",
                                • "data":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 3,
                                    • 3
                                    ]
                                  }
                                },
                              • "coordinates":
                                {
                                • "name": "coordinates",
                                • "dimensions":
                                  [
                                  • "c"
                                  ],
                                • "dtype": ",
                                • "units": "millimeter",
                                • "data":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 3
                                    ]
                                  }
                                }
                              }
                            },
                          • "target_node":
                            {
                            • "name": "XIRIS_1",
                            • "attributes":
                              {
                              • "data": {}
                              }
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
      • "subsystems":
        [
        • {
          • "common_node": "TCP",
          • "data": [],
          • "members":
            [
            • "flange",
            • "TCP",
            • "LLT_1",
            • "XIRIS_1"
            ],
          • "name": "TOOL config",
          • "root_node": "flange",
          • "subsystems": []
          },
        • {
          • "common_node": "user_frame",
          • "data": [],
          • "members":
            [
            • "T1",
            • "TCP design",
            • "workpiece",
            • "T2",
            • "user_frame"
            ],
          • "name": "TCP trace design",
          • "root_node": "workpiece",
          • "subsystems": []
          }
        ]
      },
    • "equipment":
      [
      • {
        • "name": "HKS P1000-S3",
        • "sources":
          [
          • {
            • "name": "Current Sensor",
            • "output_signal":
              {
              • "signal_type": "analog",
              • "units": "volt"
              },
            • "error":
              {
              • "deviation":
                {
                • "value": 0.1,
                • "units": "percent"
                }
              }
            },
          • {
            • "name": "Voltage Sensor",
            • "output_signal":
              {
              • "signal_type": "analog",
              • "units": "volt"
              },
            • "error":
              {
              • "deviation":
                {
                • "value": 0.1,
                • "units": "percent"
                }
              }
            }
          ],
        • "transformations": []
        },
      • {
        • "name": "Beckhoff ELM3002-0000",
        • "sources": [],
        • "transformations":
          [
          • {
            • "name": "AD current conversion",
            • "error":
              {
              • "deviation":
                {
                • "value": 0.01,
                • "units": "percent"
                }
              },
            • "func":
              {
              • "expression": "a*x + b",
              • "parameters":
                {
                • "a":
                  {
                  • "value": 3276.8,
                  • "units": "1 / volt"
                  },
                • "b":
                  {
                  • "value": 0.0,
                  • "units": "dimensionless"
                  }
                }
              },
            • "type_transformation": "AD"
            },
          • {
            • "name": "AD voltage conversion",
            • "error":
              {
              • "deviation":
                {
                • "value": 0.01,
                • "units": "percent"
                }
              },
            • "func":
              {
              • "expression": "a*x + b",
              • "parameters":
                {
                • "a":
                  {
                  • "value": 3276.8,
                  • "units": "1 / volt"
                  },
                • "b":
                  {
                  • "value": 0.0,
                  • "units": "dimensionless"
                  }
                }
              },
            • "type_transformation": "AD"
            }
          ]
        },
      • {
        • "name": "Beckhoff EL3314-0010",
        • "sources": [],
        • "transformations":
          [
          • {
            • "name": "AD temperature conversion T1",
            • "error":
              {
              • "deviation":
                {
                • "value": 0.25,
                • "units": "microvolt"
                }
              },
            • "func":
              {
              • "expression": "a*x",
              • "parameters":
                {
                • "a":
                  {
                  • "value": 1,
                  • "units": "1 / volt"
                  }
                }
              },
            • "type_transformation": "AD"
            },
          • {
            • "name": "AD temperature conversion T2",
            • "error":
              {
              • "deviation":
                {
                • "value": 0.25,
                • "units": "microvolt"
                }
              },
            • "func":
              {
              • "expression": "a*x",
              • "parameters":
                {
                • "a":
                  {
                  • "value": 1,
                  • "units": "1 / volt"
                  }
                }
              },
            • "type_transformation": "AD"
            }
          ]
        }
      ],
    • "measurements":
      [
      • {
        • "name": "welding current",
        • "data":
          [
          • {
            • "values":
              {
              • "data": [],
              • "datatype": "float64",
              • "shape":
                [
                • 414091
                ]
              },
            • "time":
              {
              • "values":
                {
                • "values":
                  {
                  • "data": [],
                  • "datatype": "int64",
                  • "shape":
                    [
                    • 414091
                    ]
                  },
                • "start": "P-1DT23H59M59.512S",
                • "end": "P0DT0H0M40.921S",
                • "min": "P-1DT23H59M59.512S",
                • "max": "P0DT0H0M40.921S"
                }
              },
            • "units": "ampere",
            • "shape":
              [
              • 414091
              ],
            • "interpolation": "step"
            }
          ],
        • "measurement_chain":
          {
          • "name": "welding current measurement chain",
          • "data_source":
            {
            • "name": "Current Sensor",
            • "output_signal":
              {
              • "signal_type": "analog",
              • "units": "volt"
              },
            • "error":
              {
              • "deviation":
                {
                • "value": 0.1,
                • "units": "percent"
                }
              }
            },
          • "graph":
            {
            • "root_node":
              {
              • "name": "Current Sensor",
              • "attributes":
                {
                • "signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  }
                },
              • "edges":
                [
                • {
                  • "direction": "fwd",
                  • "attributes":
                    {
                    • "equipment":
                      {
                      • "name": "Beckhoff ELM3002-0000",
                      • "sources": [],
                      • "transformations":
                        [
                        • {
                          • "name": "AD current conversion",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.01,
                              • "units": "percent"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x + b",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 3276.8,
                                • "units": "1 / volt"
                                },
                              • "b":
                                {
                                • "value": 0.0,
                                • "units": "dimensionless"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          },
                        • {
                          • "name": "AD voltage conversion",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.01,
                              • "units": "percent"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x + b",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 3276.8,
                                • "units": "1 / volt"
                                },
                              • "b":
                                {
                                • "value": 0.0,
                                • "units": "dimensionless"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          }
                        ]
                      },
                    • "transformation":
                      {
                      • "name": "AD current conversion",
                      • "error":
                        {
                        • "deviation":
                          {
                          • "value": 0.01,
                          • "units": "percent"
                          }
                        },
                      • "func":
                        {
                        • "expression": "a*x + b",
                        • "parameters":
                          {
                          • "a":
                            {
                            • "value": 3276.8,
                            • "units": "1 / volt"
                            },
                          • "b":
                            {
                            • "value": 0.0,
                            • "units": "dimensionless"
                            }
                          }
                        },
                      • "type_transformation": "AD"
                      }
                    },
                  • "target_node":
                    {
                    • "name": "AD current conversion",
                    • "attributes":
                      {
                      • "signal":
                        {
                        • "signal_type": "digital",
                        • "units": "dimensionless"
                        }
                      },
                    • "edges":
                      [
                      • {
                        • "direction": "fwd",
                        • "attributes":
                          {
                          • "transformation":
                            {
                            • "name": "current calibration",
                            • "error":
                              {
                              • "deviation": 0.0
                              },
                            • "func":
                              {
                              • "expression": "a*x + b",
                              • "parameters":
                                {
                                • "a":
                                  {
                                  • "value": 0.030517578125,
                                  • "units": "ampere"
                                  },
                                • "b":
                                  {
                                  • "value": 0.0,
                                  • "units": "ampere"
                                  }
                                }
                              },
                            • "meta":
                              {
                              • "name": "Beckhoff TwinCAT ScopeView",
                              • "version": "3.4.3143"
                              }
                            }
                          },
                        • "target_node":
                          {
                          • "name": "current calibration",
                          • "attributes":
                            {
                            • "signal":
                              {
                              • "signal_type": "digital",
                              • "units": "ampere",
                              • "data":
                                {
                                • "values":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 414091
                                    ]
                                  },
                                • "time":
                                  {
                                  • "values":
                                    {
                                    • "values":
                                      {
                                      • "data": [],
                                      • "datatype": "int64",
                                      • "shape":
                                        [
                                        • 414091
                                        ]
                                      },
                                    • "start": "P-1DT23H59M59.512S",
                                    • "end": "P0DT0H0M40.921S",
                                    • "min": "P-1DT23H59M59.512S",
                                    • "max": "P0DT0H0M40.921S"
                                    }
                                  },
                                • "units": "ampere",
                                • "shape":
                                  [
                                  • 414091
                                  ],
                                • "interpolation": "step"
                                }
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
          • "source_equipment":
            {
            • "name": "HKS P1000-S3",
            • "sources":
              [
              • {
                • "name": "Current Sensor",
                • "output_signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  },
                • "error":
                  {
                  • "deviation":
                    {
                    • "value": 0.1,
                    • "units": "percent"
                    }
                  }
                },
              • {
                • "name": "Voltage Sensor",
                • "output_signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  },
                • "error":
                  {
                  • "deviation":
                    {
                    • "value": 0.1,
                    • "units": "percent"
                    }
                  }
                }
              ],
            • "transformations": []
            }
          }
        },
      • {
        • "name": "welding voltage",
        • "data":
          [
          • {
            • "values":
              {
              • "data": [],
              • "datatype": "float64",
              • "shape":
                [
                • 414091
                ]
              },
            • "time":
              {
              • "values":
                {
                • "values":
                  {
                  • "data": [],
                  • "datatype": "int64",
                  • "shape":
                    [
                    • 414091
                    ]
                  },
                • "start": "P-1DT23H59M59.512S",
                • "end": "P0DT0H0M40.921S",
                • "min": "P-1DT23H59M59.512S",
                • "max": "P0DT0H0M40.921S"
                }
              },
            • "units": "volt",
            • "shape":
              [
              • 414091
              ],
            • "interpolation": "step"
            }
          ],
        • "measurement_chain":
          {
          • "name": "welding voltage measurement chain",
          • "data_source":
            {
            • "name": "Voltage Sensor",
            • "output_signal":
              {
              • "signal_type": "analog",
              • "units": "volt"
              },
            • "error":
              {
              • "deviation":
                {
                • "value": 0.1,
                • "units": "percent"
                }
              }
            },
          • "graph":
            {
            • "root_node":
              {
              • "name": "Voltage Sensor",
              • "attributes":
                {
                • "signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  }
                },
              • "edges":
                [
                • {
                  • "direction": "fwd",
                  • "attributes":
                    {
                    • "equipment":
                      {
                      • "name": "Beckhoff ELM3002-0000",
                      • "sources": [],
                      • "transformations":
                        [
                        • {
                          • "name": "AD current conversion",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.01,
                              • "units": "percent"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x + b",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 3276.8,
                                • "units": "1 / volt"
                                },
                              • "b":
                                {
                                • "value": 0.0,
                                • "units": "dimensionless"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          },
                        • {
                          • "name": "AD voltage conversion",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.01,
                              • "units": "percent"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x + b",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 3276.8,
                                • "units": "1 / volt"
                                },
                              • "b":
                                {
                                • "value": 0.0,
                                • "units": "dimensionless"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          }
                        ]
                      },
                    • "transformation":
                      {
                      • "name": "AD voltage conversion",
                      • "error":
                        {
                        • "deviation":
                          {
                          • "value": 0.01,
                          • "units": "percent"
                          }
                        },
                      • "func":
                        {
                        • "expression": "a*x + b",
                        • "parameters":
                          {
                          • "a":
                            {
                            • "value": 3276.8,
                            • "units": "1 / volt"
                            },
                          • "b":
                            {
                            • "value": 0.0,
                            • "units": "dimensionless"
                            }
                          }
                        },
                      • "type_transformation": "AD"
                      }
                    },
                  • "target_node":
                    {
                    • "name": "AD voltage conversion",
                    • "attributes":
                      {
                      • "signal":
                        {
                        • "signal_type": "digital",
                        • "units": "dimensionless"
                        }
                      },
                    • "edges":
                      [
                      • {
                        • "direction": "fwd",
                        • "attributes":
                          {
                          • "transformation":
                            {
                            • "name": "voltage calibration",
                            • "error":
                              {
                              • "deviation": 0.0
                              },
                            • "func":
                              {
                              • "expression": "a*x + b",
                              • "parameters":
                                {
                                • "a":
                                  {
                                  • "value": 0.0030517578125,
                                  • "units": "volt"
                                  },
                                • "b":
                                  {
                                  • "value": 0.0,
                                  • "units": "volt"
                                  }
                                }
                              },
                            • "meta":
                              {
                              • "name": "Beckhoff TwinCAT ScopeView",
                              • "version": "3.4.3143"
                              }
                            }
                          },
                        • "target_node":
                          {
                          • "name": "voltage calibration",
                          • "attributes":
                            {
                            • "signal":
                              {
                              • "signal_type": "digital",
                              • "units": "volt",
                              • "data":
                                {
                                • "values":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 414091
                                    ]
                                  },
                                • "time":
                                  {
                                  • "values":
                                    {
                                    • "values":
                                      {
                                      • "data": [],
                                      • "datatype": "int64",
                                      • "shape":
                                        [
                                        • 414091
                                        ]
                                      },
                                    • "start": "P-1DT23H59M59.512S",
                                    • "end": "P0DT0H0M40.921S",
                                    • "min": "P-1DT23H59M59.512S",
                                    • "max": "P0DT0H0M40.921S"
                                    }
                                  },
                                • "units": "volt",
                                • "shape":
                                  [
                                  • 414091
                                  ],
                                • "interpolation": "step"
                                }
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
          • "source_equipment":
            {
            • "name": "HKS P1000-S3",
            • "sources":
              [
              • {
                • "name": "Current Sensor",
                • "output_signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  },
                • "error":
                  {
                  • "deviation":
                    {
                    • "value": 0.1,
                    • "units": "percent"
                    }
                  }
                },
              • {
                • "name": "Voltage Sensor",
                • "output_signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  },
                • "error":
                  {
                  • "deviation":
                    {
                    • "value": 0.1,
                    • "units": "percent"
                    }
                  }
                }
              ],
            • "transformations": []
            }
          }
        },
      • {
        • "name": "temperature T1",
        • "data":
          [
          • {
            • "values":
              {
              • "data": [],
              • "datatype": "float64",
              • "shape":
                [
                • 459092
                ]
              },
            • "time":
              {
              • "values":
                {
                • "start": "P-1DT23H58M57.797S",
                • "end": "P0DT0H6M36.888S",
                • "freq": "ms",
                • "min": "P-1DT23H58M57.797S",
                • "max": "P0DT0H6M36.888S"
                }
              },
            • "units": "degree_Celsius",
            • "shape":
              [
              • 459092
              ],
            • "interpolation": "step"
            }
          ],
        • "measurement_chain":
          {
          • "name": "temperature measurement chain T1",
          • "data_source":
            {
            • "name": "Thermocouple T1",
            • "output_signal":
              {
              • "signal_type": "analog",
              • "units": "volt"
              },
            • "error":
              {
              • "deviation":
                {
                • "value": 0.25,
                • "units": "microvolt"
                }
              }
            },
          • "graph":
            {
            • "root_node":
              {
              • "name": "Thermocouple T1",
              • "attributes":
                {
                • "signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  }
                },
              • "edges":
                [
                • {
                  • "direction": "fwd",
                  • "attributes":
                    {
                    • "equipment":
                      {
                      • "name": "Beckhoff EL3314-0010",
                      • "sources": [],
                      • "transformations":
                        [
                        • {
                          • "name": "AD temperature conversion T1",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.25,
                              • "units": "microvolt"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 1,
                                • "units": "1 / volt"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          },
                        • {
                          • "name": "AD temperature conversion T2",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.25,
                              • "units": "microvolt"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 1,
                                • "units": "1 / volt"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          }
                        ]
                      },
                    • "transformation":
                      {
                      • "name": "AD temperature conversion T1",
                      • "error":
                        {
                        • "deviation":
                          {
                          • "value": 0.25,
                          • "units": "microvolt"
                          }
                        },
                      • "func":
                        {
                        • "expression": "a*x",
                        • "parameters":
                          {
                          • "a":
                            {
                            • "value": 1,
                            • "units": "1 / volt"
                            }
                          }
                        },
                      • "type_transformation": "AD"
                      }
                    },
                  • "target_node":
                    {
                    • "name": "AD temperature conversion T1",
                    • "attributes":
                      {
                      • "signal":
                        {
                        • "signal_type": "digital",
                        • "units": "dimensionless"
                        }
                      },
                    • "edges":
                      [
                      • {
                        • "direction": "fwd",
                        • "attributes":
                          {
                          • "transformation":
                            {
                            • "name": "temperature conversion",
                            • "error":
                              {
                              • "deviation": 0.0
                              },
                            • "func":
                              {
                              • "expression": "a*x + b",
                              • "parameters":
                                {
                                • "a":
                                  {
                                  • "value": 0.1,
                                  • "units": "delta_degree_Celsius"
                                  },
                                • "b":
                                  {
                                  • "value": 0,
                                  • "units": "degree_Celsius"
                                  }
                                }
                              },
                            • "meta":
                              {
                              • "name": "Beckhoff TwinCAT ScopeView",
                              • "version": "3.4.3143"
                              }
                            }
                          },
                        • "target_node":
                          {
                          • "name": "temperature conversion",
                          • "attributes":
                            {
                            • "signal":
                              {
                              • "signal_type": "digital",
                              • "units": "degree_Celsius",
                              • "data":
                                {
                                • "values":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 459092
                                    ]
                                  },
                                • "time":
                                  {
                                  • "values":
                                    {
                                    • "start": "P-1DT23H58M57.797S",
                                    • "end": "P0DT0H6M36.888S",
                                    • "freq": "ms",
                                    • "min": "P-1DT23H58M57.797S",
                                    • "max": "P0DT0H6M36.888S"
                                    }
                                  },
                                • "units": "degree_Celsius",
                                • "shape":
                                  [
                                  • 459092
                                  ],
                                • "interpolation": "step"
                                }
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
          • "source_equipment":
            {
            • "name": "Thermocouple T1",
            • "sources":
              [
              • {
                • "name": "Thermocouple T1",
                • "output_signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  },
                • "error":
                  {
                  • "deviation":
                    {
                    • "value": 0.25,
                    • "units": "microvolt"
                    }
                  }
                }
              ],
            • "transformations": []
            }
          }
        },
      • {
        • "name": "temperature T2",
        • "data":
          [
          • {
            • "values":
              {
              • "data": [],
              • "datatype": "float64",
              • "shape":
                [
                • 459092
                ]
              },
            • "time":
              {
              • "values":
                {
                • "start": "P-1DT23H58M57.797S",
                • "end": "P0DT0H6M36.888S",
                • "freq": "ms",
                • "min": "P-1DT23H58M57.797S",
                • "max": "P0DT0H6M36.888S"
                }
              },
            • "units": "degree_Celsius",
            • "shape":
              [
              • 459092
              ],
            • "interpolation": "step"
            }
          ],
        • "measurement_chain":
          {
          • "name": "temperature measurement chain T2",
          • "data_source":
            {
            • "name": "Thermocouple T1",
            • "output_signal":
              {
              • "signal_type": "analog",
              • "units": "volt"
              },
            • "error":
              {
              • "deviation":
                {
                • "value": 0.25,
                • "units": "microvolt"
                }
              }
            },
          • "graph":
            {
            • "root_node":
              {
              • "name": "Thermocouple T1",
              • "attributes":
                {
                • "signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  }
                },
              • "edges":
                [
                • {
                  • "direction": "fwd",
                  • "attributes":
                    {
                    • "equipment":
                      {
                      • "name": "Beckhoff EL3314-0010",
                      • "sources": [],
                      • "transformations":
                        [
                        • {
                          • "name": "AD temperature conversion T1",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.25,
                              • "units": "microvolt"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 1,
                                • "units": "1 / volt"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          },
                        • {
                          • "name": "AD temperature conversion T2",
                          • "error":
                            {
                            • "deviation":
                              {
                              • "value": 0.25,
                              • "units": "microvolt"
                              }
                            },
                          • "func":
                            {
                            • "expression": "a*x",
                            • "parameters":
                              {
                              • "a":
                                {
                                • "value": 1,
                                • "units": "1 / volt"
                                }
                              }
                            },
                          • "type_transformation": "AD"
                          }
                        ]
                      },
                    • "transformation":
                      {
                      • "name": "AD temperature conversion T2",
                      • "error":
                        {
                        • "deviation":
                          {
                          • "value": 0.25,
                          • "units": "microvolt"
                          }
                        },
                      • "func":
                        {
                        • "expression": "a*x",
                        • "parameters":
                          {
                          • "a":
                            {
                            • "value": 1,
                            • "units": "1 / volt"
                            }
                          }
                        },
                      • "type_transformation": "AD"
                      }
                    },
                  • "target_node":
                    {
                    • "name": "AD temperature conversion T2",
                    • "attributes":
                      {
                      • "signal":
                        {
                        • "signal_type": "digital",
                        • "units": "dimensionless"
                        }
                      },
                    • "edges":
                      [
                      • {
                        • "direction": "fwd",
                        • "attributes":
                          {
                          • "transformation":
                            {
                            • "name": "temperature conversion",
                            • "error":
                              {
                              • "deviation": 0.0
                              },
                            • "func":
                              {
                              • "expression": "a*x + b",
                              • "parameters":
                                {
                                • "a":
                                  {
                                  • "value": 0.1,
                                  • "units": "delta_degree_Celsius"
                                  },
                                • "b":
                                  {
                                  • "value": 0,
                                  • "units": "degree_Celsius"
                                  }
                                }
                              },
                            • "meta":
                              {
                              • "name": "Beckhoff TwinCAT ScopeView",
                              • "version": "3.4.3143"
                              }
                            }
                          },
                        • "target_node":
                          {
                          • "name": "temperature conversion",
                          • "attributes":
                            {
                            • "signal":
                              {
                              • "signal_type": "digital",
                              • "units": "degree_Celsius",
                              • "data":
                                {
                                • "values":
                                  {
                                  • "data": [],
                                  • "datatype": "float64",
                                  • "shape":
                                    [
                                    • 459092
                                    ]
                                  },
                                • "time":
                                  {
                                  • "values":
                                    {
                                    • "start": "P-1DT23H58M57.797S",
                                    • "end": "P0DT0H6M36.888S",
                                    • "freq": "ms",
                                    • "min": "P-1DT23H58M57.797S",
                                    • "max": "P0DT0H6M36.888S"
                                    }
                                  },
                                • "units": "degree_Celsius",
                                • "shape":
                                  [
                                  • 459092
                                  ],
                                • "interpolation": "step"
                                }
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
          • "source_equipment":
            {
            • "name": "Thermocouple T1",
            • "sources":
              [
              • {
                • "name": "Thermocouple T1",
                • "output_signal":
                  {
                  • "signal_type": "analog",
                  • "units": "volt"
                  },
                • "error":
                  {
                  • "deviation":
                    {
                    • "value": 0.25,
                    • "units": "microvolt"
                    }
                  }
                }
              ],
            • "transformations": []
            }
          }
        }
      ],
    • "process":
      {
      • "shielding_gas":
        {
        • "use_torch_shielding_gas": true,
        • "torch_shielding_gas":
          {
          • "gas_component":
            [
            • {
              • "gas_chemical_name": "argon",
              • "gas_percentage":
                {
                • "value": 82,
                • "units": "percent"
                }
              },
            • {
              • "gas_chemical_name": "carbon dioxide",
              • "gas_percentage":
                {
                • "value": 18,
                • "units": "percent"
                }
              }
            ],
          • "common_name": "corgon 18"
          },
        • "torch_shielding_gas_flowrate":
          {
          • "value": 20,
          • "units": "liter / minute"
          }
        },
      • "weld_speed":
        {
        • "units": "centimeter / minute",
        • "value": 45
        },
      • "welding_process":
        {
        • "base_process": "pulse",
        • "manufacturer": "Fronius",
        • "parameters":
          {
          • "base_voltage":
            {
            • "units": "volt",
            • "value": 25
            },
          • "pulse_current":
            {
            • "units": "ampere",
            • "value": 480
            },
          • "pulse_duration":
            {
            • "units": "millisecond",
            • "value": 4
            },
          • "pulse_frequency":
            {
            • "units": "hertz",
            • "value": 200
            },
          • "wire_feedrate":
            {
            • "units": "meter / minute",
            • "value": 12
            }
          },
        • "power_source": "TPS 500i",
        • "tag": "GMAW"
        },
      • "welding_wire":
        {
        • "class": "G 42 2 C/M G4Si1",
        • "diameter":
          {
          • "value": 1.2,
          • "units": "millimeter"
          },
        • "wx_user":
          {
          • "charge id": "00349764",
          • "manufacturer": "WDI"
          }
        }
      },
    • "reference_timestamp": "2021-03-17T11:06:42.334400",
    • "welding_current":
      {
      • "values":
        {
        • "data": [],
        • "datatype": "float64",
        • "shape":
          [
          • 414091
          ]
        },
      • "time":
        {
        • "values":
          {
          • "values":
            {
            • "data": [],
            • "datatype": "int64",
            • "shape":
              [
              • 414091
              ]
            },
          • "start": "P-1DT23H59M59.512S",
          • "end": "P0DT0H0M40.921S",
          • "min": "P-1DT23H59M59.512S",
          • "max": "P0DT0H0M40.921S"
          }
        },
      • "units": "ampere",
      • "shape":
        [
        • 414091
        ],
      • "interpolation": "step"
      },
    • "welding_voltage":
      {
      • "values":
        {
        • "data": [],
        • "datatype": "float64",
        • "shape":
          [
          • 414091
          ]
        },
      • "time":
        {
        • "values":
          {
          • "values":
            {
            • "data": [],
            • "datatype": "int64",
            • "shape":
              [
              • 414091
              ]
            },
          • "start": "P-1DT23H59M59.512S",
          • "end": "P0DT0H0M40.921S",
          • "min": "P-1DT23H59M59.512S",
          • "max": "P0DT0H0M40.921S"
          }
        },
      • "units": "volt",
      • "shape":
        [
        • 414091
        ],
      • "interpolation": "step"
      },
    • "workpiece":
      {
      • "base_metal":
        {
        • "common_name": "S355J2+N",
        • "standard": "DIN EN 10225-2:2011"
        },
      • "geometry":
        {
        • "groove_shape":
          {
          • "t":
            {
            • "value": 8,
            • "units": "millimeter"
            },
          • "alpha":
            {
            • "value": 45,
            • "units": "degree"
            },
          • "b":
            {
            • "value": 1,
            • "units": "millimeter"
            },
          • "c":
            {
            • "value": 1,
            • "units": "millimeter"
            },
          • "code_number":
            [
            • "1.3",
            • "1.5"
            ]
          },
        • "seam_length":
          {
          • "value": 350,
          • "units": "millimeter"
          }
        }
      },
    • "wx_user":
      {
      • "WID": 417,
      • "operator": "C. Schippereit",
      • "project": "WelDX presentation"
      }
    }

1.3.3. Inspecting the File content with pure Python#

You can also utilize the header method to visualize the file content when using weldx in a pure Python script. This will print the human-readable part of the file that is stored in YAML format directly to console. However, while the interactive output in a jupyter notebook is quite handy, the console output can get pretty large. This might be simply too much information if you just want to get a simple overview of the file content.

Alternatively, we can get a quick overview over the top level items of the file structure by using the info method:

wxfile.info()
root (dict)
├─TCP (LocalCoordinateSystem)
├─coordinate_systems (CoordinateSystemManager)
├─equipment (list)
│ ├─[0] (MeasurementEquipment)
│ ├─[1] (MeasurementEquipment)
│ └─[2] (MeasurementEquipment)
├─measurements (list)
│ ├─[0] (Measurement)
│ ├─[1] (Measurement)
│ ├─[2] (Measurement)
│ └─[3] (Measurement)
├─process (dict)
│ ├─shielding_gas (ShieldingGasForProcedure)
│ ├─weld_speed (TimeSeries)
│ ├─welding_process (GmawProcess)
│ └─welding_wire (dict)
│   ├─class (str)
│   ├─diameter (Quantity)
│   └─wx_user (dict)
│     ├─charge id (str)
│     └─manufacturer (str)
├─reference_timestamp (Timestamp)
├─welding_current (TimeSeries)
├─welding_voltage (TimeSeries)
├─workpiece (dict)
│ ├─base_metal (dict)
│ │ ├─common_name (str)
│ │ └─standard (str)
│ └─geometry (dict)
│   ├─groove_shape (VGroove)
│   └─seam_length (Quantity)
└─wx_user (dict)
  ├─WID (int)
  ├─operator (str)
  └─project (str)

The info method lists the internal file structure converted to python objects. This makes it easy to identify where we find a specific piece of information, how to access it and which object type we can expect. For example, we can see that the item groove_shape is an VGroove object, that we can access as follows:

groove = wxfile["workpiece"]["geometry"]["groove_shape"]
print(type(groove))
<class 'weldx.welding.groove.iso_9692_1.VGroove'>

The output confirms that the object we got is truly of type VGroove. We will discuss in more detail in the upcoming tutorials, what you can do with the individual objects that you may find in a WeldxFile.

1.4. Conclusion#

This concludes the first tutorial about opening and navigating through WelDX Files. You should now be able to read any given WelDX file and to inspect its structure. In the next tutorials, we will learn how to access the actual data and what we can do with it.

NEXT TUTORIAL >>