code: def observed_data_to_xarray(self):
          
          observed_data_raw = _read_data(self.observed_data)
          variables = self.observed_data_var
          if isinstance(variables, str):
              variables = [variables]
          observed_data = {}
          for key, vals in observed_data_raw.items():
              if variables is not None and key not in variables:
                  continue
              vals = np.atleast_1d(vals)
              val_dims = self.dims.get(key)
              val_dims, coords = generate_dims_coords(
                  vals.shape, key, dims=val_dims, coords=self.coords
              )
              observed_data[key] = xr.DataArray(vals, dims=val_dims, coords=coords)
          return xr.Dataset(data_vars=observed_data)
docs: Convert observed data to xarray.