bugGNU Astronomy Utilities - Bugs: bug #61976, Table arithmetic date-to-sec...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61976: Table arithmetic date-to-sec produces inaccurate result

Submitter:  Pedram Ashofteh-Ardakani <pedram>
Submitted:  Tue 01 Feb 2022 06:18:37 PM UTC
   
 
Category:  Table Severity:  3 - Normal
Item Group:  Output not reasonable Status:  Fixed
Privacy:  Public Assigned to:  makhlaghi
Open/Closed:  Closed

Fri 11 Feb 2022 02:36:39 PM UTC, comment #1: 

Thanks for the great bug report Pedram! It has been fixed in Commit 8837a5a8a.

This was an important bug and it was always haunting me from the day I first implemented 'date-to-sec'! I knew that storing a many-significant-digit integer number (like number of seconds from 1970-01-01) into a 64-bit floating point type will be problematic, but I failed to act upon it then!

Hopefully the commit message has clarified the solution, so I won't repeat it anymore here ;-).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Tue 01 Feb 2022 06:18:37 PM UTC, original submission:  

This bug was first reported by Zohreh Ghaffari.

steps to reproduce


1. create a dummy fits file
2. add the DATE-OBS keyword with value 2018-05-04T04:16:46.7774
3. run table arithmetic to get the 'date-to-sec' result
4. update the DATE-OBS keyword with value 2018-05-04T04:15:25.8326
5. you'd get the same number of seconds for both even though they are about 80 seconds different


$ echo "1" > dummy.txt
$ astconvertt dummy.txt -odummy.fits
$ astfits dummy.fits -h1 --update=DATE-OBS,2018-05-04T04:16:46.7774
$ astfits dummy.fits -h1 --keyvalue=DATE-OBS --colinfoinstdout | \
  asttable -c'arith DATE-OBS date-to-sec' --colinfoinstdout
# Column 1: UNIXSEC [sec,f64,] Unix seconds (from 00:00:00 UTC, 1 January 1970)
1525410945

$ astfits dummy.fits -h1 --update=DATE-OBS,2018-05-04T04:15:25.8326
$ astfits dummy.fits -h1 --keyvalue=DATE-OBS --colinfoinstdout | \
  asttable -c'arith DATE-OBS date-to-sec' --colinfoinstdout
# Column 1: UNIXSEC [sec,f64,] Unix seconds (from 00:00:00 UTC, 1 January 1970)
1525410945


Pedram Ashofteh-Ardakani <pedram>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Posted a comment)
  • -email is unavailable- added by makhlaghi
  • -email is unavailable- added by pedram (Submitted the item)
  • -email is unavailable- added by pedram
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-02-11 makhlaghi StatusNone Fixed
        Assigned toNone makhlaghi
        Open/ClosedOpen Closed
        Carbon-Copy- Added -email is unavailable-
    2022-02-01 pedram Carbon-Copy- Added makhlaghi

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code