*Convert a declination between decimal degrees and sexegesimal.*

        Precision should be respected.

        **Key Arguments:**
            - ``dec`` -- DEC in decimal degrees. Will try and convert to float before performing calculation.
            - ``delimiter`` -- how to delimit the RA units. Default *:*

        **Return:**
            - ``sexegesimal`` -- ra in sexegesimal units

        **Usage:**
            ..  todo::

                - replace dec_to_sex in dryxPython in all code

            .. code-block:: python 

                from astrocalc.coords import unit_conversion
                converter = unit_conversion(
                    log=log
                )
                dec = converter.dec_decimal_to_sexegesimal(
                    dec="-3.454676456",
                    delimiter=":"
                )
                print dec

                # OUT: -03:27:16.8

def dec_decimal_to_sexegesimal(
            self,
            dec,
            delimiter=":"):
        """
        *Convert a declination between decimal degrees and sexegesimal.*

        Precision should be respected.

        **Key Arguments:**
            - ``dec`` -- DEC in decimal degrees. Will try and convert to float before performing calculation.
            - ``delimiter`` -- how to delimit the RA units. Default *:*

        **Return:**
            - ``sexegesimal`` -- ra in sexegesimal units

        **Usage:**
            ..  todo::

                - replace dec_to_sex in dryxPython in all code

            .. code-block:: python 

                from astrocalc.coords import unit_conversion
                converter = unit_conversion(
                    log=log
                )
                dec = converter.dec_decimal_to_sexegesimal(
                    dec="-3.454676456",
                    delimiter=":"
                )
                print dec

                # OUT: -03:27:16.8
        """
        self.log.info('starting the ``dec_decimal_to_sexegesimal`` method')

        import math

        # CONVERT DEC TO FLOAT
        try:
            self.log.debug("attempting to convert RA to float")
            dec = float(dec)
        except Exception, e:
            self.log.error(
                "could not convert RA to float - failed with this error: %s " % (str(e),))
            return -1

        # COMPLAIN IF DEC NOT BETWEEN -90 - 90
        if dec > -90. and dec < 90.:
            pass
        else:
            self.log.error(
                "DEC must be between -90 - 90 degrees")
            return -1

        if (dec >= 0):
            hemisphere = '+'
        else:
            hemisphere = '-'
            dec *= -1

        # PRECISION TEST
        # 1s = .000277778 DEGREE
        # THEREFORE REPORT SECONDS TO A PRECISION = INPUT PRECISION - 4
        decimalLen = len(repr(dec).split(".")[-1])
        precision = decimalLen - 4

        dec_deg = int(dec)
        dec_mm = int((dec - dec_deg) * 60)
        dec_ss = int(((dec - dec_deg) * 60 - dec_mm) * 60)
        dec_f = (((dec - dec_deg) * 60 - dec_mm) * 60) - dec_ss

        # SET PRECISION
        dec_f = repr(dec_f)[2:]
        dec_f = dec_f[:precision]
        if len(dec_f):
            dec_f = "." + dec_f
        if precision < 0:
            dec_f = ""

        sexegesimal = hemisphere + '%02d' % dec_deg + delimiter + \
            '%02d' % dec_mm + delimiter + '%02d' % dec_ss + dec_f

        self.log.info('completed the ``dec_decimal_to_sexegesimal`` method')
        return sexegesimal