def dec_sexegesimal_to_decimal(<EOL>self,<EOL>dec):
self.log.info(<EOL>'<STR_LIT>')<EOL>import re<EOL>try:<EOL><INDENT>dec = float(dec)<EOL>if dec > -<NUM_LIT> and dec < <NUM_LIT>:<EOL><INDENT>self.log.info(<EOL>'<STR_LIT>' % locals())<EOL>return float(dec)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>dec = str(dec).strip()<EOL>regex = re.compile(<EOL>'<STR_LIT>')<EOL>decMatch = regex.match(dec)<EOL>if decMatch:<EOL><INDENT>degrees = decMatch.group(<NUM_LIT:1>)<EOL>minutes = decMatch.group(<NUM_LIT:3>)<EOL>seconds = decMatch.group(<NUM_LIT:4>)<EOL>if degrees[<NUM_LIT:0>] == '<STR_LIT:->':<EOL><INDENT>sgn = -<NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>sgn = <NUM_LIT:1><EOL><DEDENT>degrees = abs(float(degrees))<EOL>minutes = float(minutes)<EOL>seconds = float(seconds)<EOL>decimalLen = len(repr(seconds).split("<STR_LIT:.>")[-<NUM_LIT:1>])<EOL>precision = decimalLen + <NUM_LIT:4><EOL>decDeg = (degrees + (minutes / <NUM_LIT>)<EOL>+ (seconds / <NUM_LIT>)) * sgn<EOL>decDeg = "<STR_LIT>" % (precision, decDeg)<EOL><DEDENT>else:<EOL><INDENT>raise IOError(<EOL>"<STR_LIT>" % locals())<EOL><DEDENT>decDeg = float(decDeg)<EOL>self.log.debug('<STR_LIT>' % locals())<EOL>self.log.info(<EOL>'<STR_LIT>')<EOL>return float(decDeg)<EOL>
*Convert a declination from sexegesimal format to decimal degrees.*

Precision should be respected. If a float is passed to this method, the same float will be returned (useful if unclear which format coordinates are in).

The code will attempt to read the sexegesimal value in whatever form it is passed. Any of the following should be handled correctly:

- ``+1:58:05.45341``
- ``01:5:05``
- ``+1 58 05.45341``
- ``-23h53m05s``

**Key Arguments:**
    - ``dec`` - DEC in sexegesimal format.

**Return:**
    - ``decDeg`` -- declination converted to decimal degrees

**Usage:**

    .. todo::

        - replace dryxPython declination_sexegesimal_to_decimal with this version in all my code
        - replace coords_sex_to_dec in all code

    .. code-block:: python

        from astrocalc.coords import unit_conversion
        converter = unit_conversion(
            log=log
        )
        dec = converter.dec_sexegesimal_to_decimal(
            dec="-23:45:21.23232"
        )
        print dec

        # OUTPUT: -23.7558978667