add material, fixups in deg.py

This commit is contained in:
Motiejus Jakštys 2019-11-24 22:34:43 +02:00
parent 8da4071f7d
commit 60e237afb4
2 changed files with 1 additions and 4 deletions

Binary file not shown.

View File

@ -7,13 +7,10 @@ class Deg(namedtuple('Deg', ['deg', 'mm', 'ss'])):
return "%03d-%02d-%.1f" % (self.deg, self.mm, self.ss)
def guess(inp):
if isinstance(inp, Dec):
return inp
if isinstance(inp, str) and '-' in inp:
deg, mm, ss = inp.split('-')
ddeg, dmm, dss = Dec(deg), Dec(mm), Dec(ss)
return deg + dmm/60 + dss/3600
return ddeg + dmm/60 + dss/3600
else:
return Dec(instr)