Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coord sum adds to invalid coordinates #157

Open
wschoenell opened this issue Feb 21, 2017 · 3 comments
Open

Coord sum adds to invalid coordinates #157

wschoenell opened this issue Feb 21, 2017 · 3 comments

Comments

@wschoenell
Copy link
Contributor

Coord package behavior when summing outside limits is wrong...

from chimera.util.coord import Coord

ra = Coord.fromHMS('23:59:59') + Coord.fromAS(100)
print ra.__str__()   # gives: 24:00:05.667
dec = Coord.fromDMS('359:59:59') + Coord.fromAS(100)
print dec.__str__() # gives: +360:01:39.000
wschoenell added a commit to wschoenell/chimera that referenced this issue Feb 21, 2017
@wschoenell
Copy link
Contributor Author

wschoenell commented Feb 21, 2017

I added a check for the coordinates to be within 0-360 deg interval.

Now the results are:

from chimera.util.coord import Coord

ra = Coord.fromHMS('23:59:59') + Coord.fromAS(100)
print ra.__str__()   # gives: 00:00:05.667
dec = Coord.fromDMS('359:59:59') + Coord.fromAS(100)
print dec.__str__() # gives: +00:01:39.000

@wschoenell
Copy link
Contributor Author

Ok... So as @tribeiro noted on a private conversation, the idea of Coord is not to do any check on coordinates at all. Those must be done on higher level classes such as Position.

4. Coord doesn't do any range checking. Its up to Position and
more higher level classes to do this. As the are no bounds in
angle values, Coord respect this and don't check for valid ranges.

So, I will roll back all this changes and enforce the 0-360 boundaries on FakeTelescope which is where the problem was first seen.

wschoenell added a commit to wschoenell/chimera that referenced this issue Feb 23, 2017
@wschoenell
Copy link
Contributor Author

Ran some tests on the last commit and things seems to work as expected:

$ chimera-tel --slew --ra 23:59:59 --dec 359:59:59
======================================== 
current position ra/dec: 01:49:13.099 -03:00:00.000 
current position alt/az: +51:27:03.930 +346:32:21.392 
======================================== 
slewing to 23:59:59.000 +359:59:59.000 (J2000.0)...  OK. 
======================================== 
new position ra/dec: 23:59:59.000 +359:59:59.000 
new position alt/az: +37:56:24.088 +312:18:13.450 

$ chimera-tel -N 1000
======================================== 
current position ra/dec: 23:59:59.000 +359:59:59.000 
current position:alt/az: +37:55:31.614 +312:16:35.006 
======================================== 
moving 1000.0 arcseconds (+00:16:40.000) North at CENTER rate...  OK 
======================================== 
new position ra/dec: 23:59:59.000 +00:00:17.436 
new position:alt/az: +37:55:16.230 +312:16:47.888 
======================================== 

$ chimera-tel -S 2000
======================================== 
current position ra/dec: 23:59:59.000 +00:00:17.436 
current position:alt/az: +37:54:08.446 +312:14:40.840 
======================================== 
moving 2000.0 arcseconds (+00:33:20.000) South at CENTER rate...  OK 
======================================== 
new position ra/dec: 23:59:59.000 +359:26:57.436 
new position:alt/az: +38:21:41.840 +311:50:50.229 
======================================== 

$ chimera-tel -E 1000
======================================== 
current position ra/dec: 23:59:59.000 +359:26:57.436 
current position:alt/az: +38:21:08.380 +311:49:47.748 
======================================== 
moving 1000.0 arcseconds (+00:16:40.000) East at CENTER rate...  OK 
======================================== 
new position ra/dec: 00:01:05.667 +359:26:57.436 
new position:alt/az: +38:30:28.602 +312:07:18.236 
======================================== 

$ chimera-tel -W 2000
======================================== 
current position ra/dec: 00:01:05.667 +359:26:57.436 
current position:alt/az: +38:30:05.547 +312:06:34.821 
======================================== 
moving 2000.0 arcseconds (+00:33:20.000) West at CENTER rate...  OK 
======================================== 
new position ra/dec: 23:58:52.333 +359:26:57.436 
new position:alt/az: +38:11:12.579 +311:31:20.644 
======================================== 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant