eaobservatory / observing-tool

JCMT Observing Tool
1 stars 2 forks source link

Target information panel mangles offset coordinates #9

Open grahambell opened 10 years ago

grahambell commented 10 years ago

The automated coordinate system conversions give the wrong answer for offset coordinates. In other words you can repeatedly switch between FK5 and Galactic and the FK5 values keep changing.

timj commented 10 years ago

Does the coordinate conversion take offsets into account? I'm surprised it does that. What it should do is rotate the offset to the new coordinate system. The base position should just be a simple conversion. I had assumed it would convert the base position, but also convert the "base + offset" to the new system and then convert the result back to an offset relative to the newly converted base.

grahambell commented 10 years ago

I suspect it converts the position + offset and then also leaves the offset in place too. I was just trying to move the offset boxes around in the GUI, and while testing what I had done, came across this problem and another one where an IllegalArgumentException was being thrown -- I committed a work-around for that problem.

timj commented 10 years ago

Well, yes, except it should never convert such that the new BASE is the old BASE plus old OFFSET. If someone has specified an offset that should be retained as an offset.