spacetelescope / astrocut

Tools for making image cutouts from sets of TESS full frame images
https://astrocut.readthedocs.io
25 stars 12 forks source link

Precision on timestamps in Tess data #18

Open benmontet opened 5 years ago

benmontet commented 5 years ago

Hello!

We've come across an issue in the timestamps in TessCut frames (TessCut is a wonderful service, by the way!)

When I look the astrocut file timestamps, there is a digitization that I can see in them when we plot the difference in time between consecutive frames. We think this is a floating point rounding error in the timestamps, somewhere they are being stored as 32-bit floats and since the time values have four digits before the decimal place, this limits the precision to ~10 seconds on any individual data point.

You can see what I mean in figure form at https://github.com/afeinstein20/eleanor/issues/119. The code to reproduce this is below:

tc = fits.open('tess-s0001-4-3_97.842681_-68.044906_10x15_astrocut.fits')
plt.plot(np.diff(86400*tc[1].data['time']), '.')
plt.ylim(1795, 1805)
plt.xlabel('Cadence', fontsize=20)
plt.ylabel('Delta Time (sec)', fontsize=20)

image

The TASOC light curve times look proper, so we think it's a processing issue along the way rather than the way the telescope is recording data. If you think it's something upstream from astrocut where the bug is then I'm happy to work my way up the chain until we figure out where this is being induced.

Thanks so much! Ben

ceb8 commented 5 years ago

Thanks for pointing this out!

Can you just clarify what you would expect to see if this bug was not present?

benmontet commented 5 years ago

Yes of course! If the bug weren't present, the difference in time between cadences should be nearly constant. In the frame of the spacecraft, they should be exactly constant, plus then there will be a smooth correction due to changes in barycentric correction as the spacecraft orbits the earth---and there shouldn't be any structure on shorter timescales.

Here's a plot for two minute data binned down to 30 minute cadence. Note the y-scale, the change over an orbit is only 0.005 seconds or so!

image

ceb8 commented 5 years ago

Great, thanks! I'll put this on my list of things to fix.

danhey commented 4 years ago

Hi @ceb8, just wondering if there's been any progress on this?

ceb8 commented 4 years ago

@danhey There has not been. Apologies. It's still on my list, I promise.

ceb8 commented 4 years ago

@danhey This is fixed in the code and on master, but it hasn't bubbled up to TESScut yet. Also, because of where the bug was, I will have to go back and fix all existing TESS FFI cubes on our systems, which will take a bit. I will keep you updated.