View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum ↗

iraf-v216 · Code · Issues (50) · Pull requests (81)

iraf.net pull request #87

Bugfix for unix/os/gmttolst.c and unix/zgmtco.c

merge olebole merged 2 commits to iraf-community/iraf


olebole commented on 2017-06-09

On Linux, the file unix/os/gmttolst.c doesn’t work well. Take the following test code:

#include <stdio.h>  
#include <time.h>  
  
time_t gmt_to_lst (time_t gmt);  
  
int main(void) {  
  time_t gmt, lst, lst0 = 0;  
  
  for (gmt = 315532800L; gmt < 1497042068L; gmt += 1000000L) {  
    lst = gmt_to_lst(gmt);  
    if ((lst0 > 0) && (lst - lst0 != 1000000L)) {  
      printf("diff = %li gmt = %li lst=%li\n", (long)(lst - lst0),  
	     (long)gmt, (long)lst);  
    }  
    lst0 = lst;  
  }  
  return 0;  
}  

On MacOSX (64 bit) it produces an empty output, while on Linux (64 bit) it shows a jump on every change between summer and winter time:

$ ./m|head  
diff = 1003600 gmt = 324532800 lst=9007200  
diff = 996400 gmt = 339532800 lst=24003600  
diff = 1003600 gmt = 355532800 lst=40007200  
diff = 996400 gmt = 370532800 lst=55003600  
diff = 1003600 gmt = 386532800 lst=71007200  
diff = 996400 gmt = 402532800 lst=87003600  
diff = 1003600 gmt = 418532800 lst=103007200  
diff = 996400 gmt = 433532800 lst=118003600  
diff = 1003600 gmt = 449532800 lst=134007200  
diff = 996400 gmt = 465532800 lst=150003600  

This PR simplifies the code in a way that its working is obvious, and removes the system dependencies. Tested on Linux+MacOS 32/64 bit, FreeBSD, GNU HURD.


Commits


Last updated on 2017-09-21