code: def apply_model(refwcs):
      
      # apply distortion model to CD matrix
      if 'ocx10' in refwcs.__dict__ and refwcs.ocx10 is not None:
          linmat = np.array([[refwcs.ocx11,refwcs.ocx10],[refwcs.ocy11,refwcs.ocy10]])/refwcs.idcscale
          refwcs.wcs.cd = np.dot(refwcs.wcs.cd,linmat)
  
          refwcs.wcs.set()
          refwcs.setOrient()
          refwcs.setPscale()
docs: Apply distortion model to WCS, including modifying
          CD with linear distortion terms