code: def custom_to_pmrapmdec(pmphi1,pmphi2,phi1,phi2,T=None,degree=False):
      
      if T is None: raise ValueError("Must set T= for custom_to_pmrapmdec")
      return pmrapmdec_to_custom(pmphi1, pmphi2, phi1, phi2,
                                 T=nu.transpose(T),  # T.T = inv(T)
                                 degree=degree)
docs: NAME:
  
         custom_to_pmrapmdec
  
      PURPOSE:
  
         rotate proper motions in a custom set of sky coordinates (phi1,phi2) to ICRS (ra,dec)
  
      INPUT:
  
         pmphi1 - proper motion in custom (multplied with cos(phi2)) [mas/yr]
  
         pmphi2 - proper motion in phi2 [mas/yr]
  
         phi1 - custom longitude
  
         phi2 - custom latitude
  
         T= matrix defining the transformation in cartesian coordinates:
            new_rect = T dot old_rect
            where old_rect = [cos(dec)cos(ra), cos(dec)sin(ra), sin(dec)] and similar for new_rect
  
         degree= (False) if True, phi1 and phi2 are given in degrees (default=False)
  
      OUTPUT:
  
         (pmra x cos(dec), dec) for vector inputs [:,2]
  
      HISTORY:
  
         2019-03-02 - Written - Nathaniel Starkman (UofT)