SSDataLab / tess-ephem

Where are Solar System objects located in TESS data?
MIT License
2 stars 2 forks source link

Incorrect (col, row) returned for asteroid 4077 in sector 2 #4

Open barentsen opened 3 years ago

barentsen commented 3 years ago

Asteroid 4077 in sector 2 was reported by @christinahedges to display a strange kink in its (col, row) trajectory, which is almost certainly incorrect because its (ra, dec) trajectory on the sky is a straight line. It looks like the WCS transform can yield incorrect (col, row) values after an object has moved off the ccd.

I'm in the process of debugging this and adding a unit test.

Example bug:

Screen Shot 2021-02-26 at 10 37 25 AM
barentsen commented 3 years ago

I'm somewhat stuck with this issue because it looks like the FFI WCS truly thinks the straight (ra, dec) trajectory of the asteroids translates into a weird curved path in (col, row) pixel coordinate space.

Example:

Screen Shot 2021-03-03 at 10 13 45 AM
christinahedges commented 3 years ago

Yikes, this seems interesting! What happens if you plot an image of the X, Y to RA, Dec, conversion something like:

Y, X = np.mgrid[:2048,:2048]
ra, dec = wcs.all_pix2world(np.vstack([X.ravel(), Y.ravel()]).T, 0)

plt.imshow(ra)
plt.imshow(dec)

Can you see that it looks funky in the corners?

barentsen commented 3 years ago

Thanks, that's a good idea!!

It looks like the RA=0 meridian runs through the image. This may be a clue...

Screen Shot 2021-03-03 at 10 42 54 AM
barentsen commented 3 years ago

Update: tess-point agrees with the weird curve in the trajectory, so I'm really confused now...

Screen Shot 2021-03-15 at 6 28 30 PM
barentsen commented 3 years ago

I am starting to think that there is no bug in tess-locator, because I am able to reproduce the funny kink in the trajectory using tess-point. My leading suspicion is that the stretch on the Y limit in the screenshot posted at the top of this issue made led me astray into thinking there is an obvious error in the WCS transform, but in reality, the kink is very subtle and visible in both (ra, dec) and (col, row) space.

Example:

Screen Shot 2021-03-16 at 9 23 16 AM Screen Shot 2021-03-16 at 9 24 12 AM