eteq/astropysics — Issue #14: Problem with negative DMS AngularCoordinate
Author: rogerfc
Created: 2012-02-20 11:58:35+00:00
State: open

When creating an AngularCoordinate (astropysics.coords.coordsys.AngularCoordinate) using a negative DMS value (e.g. '-5:47:22'), I get an error when trying to get the output in string format.

I suspect this comes from line 270 in astropysics/coords/coordsys.py
> return -deg if self.degrees < 0 else deg,min,sec
where in my understanding it should read
> return (-deg,-min,sec) if self.degrees < 0 else deg,min,sec

Here's the traceback:
Traceback (most recent call last):
File "./coord_validation.py", line 103, in ?
sys.exit(main())
File "./coord_validation.py", line 25, in main
print dec, validateCoordinates(dec, 'DEC')
File "./coord_validation.py", line 73, in validateCoordinates
return AngularCoordinate(coordinate.split()[0], sghms=False).getDmsStr()
File "/nfs/magic/sw/magic/pic/datacenter/Database/lib/astropysics/coords/coordsys.py", line 389, in getDmsStr
d,m,s = self.degminsec
TypeError: unpack non-sequence