code: def to_gdal(self):
      """Serialize RPC attribute name and values in a form expected by GDAL.
  
      Returns
      -------
      dict
  
      Notes
      -----
      The `err_bias` and `err_rand` are optional, and are not written to datasets by GDAL.
      """
  
      out = {
          "HEIGHT_OFF": str(self.height_off),
          "HEIGHT_SCALE": str(self.height_scale),
          "LAT_OFF": str(self.lat_off),
          "LAT_SCALE": str(self.lat_scale),
          "LINE_DEN_COEFF": " ".join(map(str, self.line_den_coeff)),
          "LINE_NUM_COEFF": " ".join(map(str, self.line_num_coeff)),
          "LINE_OFF": str(self.line_off),
          "LINE_SCALE": str(self.line_scale),
          "LONG_OFF": str(self.long_off),
          "LONG_SCALE": str(self.long_scale),
          "SAMP_DEN_COEFF": " ".join(map(str, self.samp_den_coeff)),
          "SAMP_NUM_COEFF": " ".join(map(str, self.samp_num_coeff)),
          "SAMP_OFF": str(self.samp_off),
          "SAMP_SCALE": str(self.samp_scale),
      }
  
      if self.err_bias:
          out.update(ERR_BIAS=str(self.err_bias))
      if self.err_rand:
          out.update(ERR_RAND=str(self.err_rand))
  
      return out
  
imports: import attr
label_desc: Use image node_id 2 for calling the RPC obj's underlying member method code with example usage: obj.to_gdal() and returns: out