def distance_to_redshift(<EOL>self,<EOL>mpc):
self.log.info('<STR_LIT>')<EOL>lowerLimit = <NUM_LIT:0.><EOL>upperLimit = <NUM_LIT><EOL>redshift = upperLimit - lowerLimit<EOL>distGuess = float(self.redshift_to_distance(redshift)['<STR_LIT>'])<EOL>distDiff = mpc - distGuess<EOL>while math.fabs(distDiff) > <NUM_LIT>:<EOL><INDENT>if distGuess < mpc:<EOL><INDENT>lowerLimit = redshift<EOL>redshift = lowerLimit + (upperLimit - lowerLimit) / <NUM_LIT><EOL>distGuess = float(<EOL>self.redshift_to_distance(redshift)['<STR_LIT>'])<EOL><DEDENT>elif distGuess > mpc:<EOL><INDENT>upperLimit = redshift<EOL>redshift = lowerLimit + (upperLimit - lowerLimit) / <NUM_LIT><EOL>distGuess = float(<EOL>self.redshift_to_distance(redshift)['<STR_LIT>'])<EOL><DEDENT>distDiff = mpc - distGuess<EOL><DEDENT>redshift = float("<STR_LIT>" % (redshift,))<EOL>self.log.info('<STR_LIT>')<EOL>return redshift<EOL>
*Convert a distance from MPC to redshift*

        The code works by iteratively converting a redshift to a distance, correcting itself and honing in on the true answer (within a certain precision)

        **Key Arguments:**
            - ``mpc`` -- distance in MPC (assumes a luminousity distance).

        **Return:**
            - ``redshift``

        .. todo::

            - replace convert_mpc_to_redshift in all code

        **Usage:**

            .. code-block:: python

                from astrocalc.distances import converter
                c = converter(log=log)
                z = c.distance_to_redshift(
                    mpc=500
                )

                print z

                # OUTPUT: 0.108