def P_to_a(P, Mstar):
    """
    Convenience function to convert periods to semimajor axis from Kepler's Law
    
    Parameters
    ----------
    P : array-like
        orbital periods [days]
    Mstar : float
        stellar mass [solar masses]
        
    Returns
    -------
    a : array-like
        semi-major axis [stellar radii]
    """
    Pearth = 365.24    # [days]
    aearth = 215.05    # [solar radii]
    
    return aearth * ((P/Pearth)**2 *(1/Mstar))**(1/3)