# Reads and sorts gravity data ######################################################################### *call debug on *call setup noapp # overwrite text files timbase 2000 1 1 0 # measuring times from Jan 1, 2000 ## load field gravity table # YEAR MONTH DAY HOUR MIN NORTH EAST HEIGHT DIAL FLAG STN *call readtab table gravdata year integer month integer day integer hour integer min integer north real east real height real dial real flag char 2 stn integer 1 file all GRAV14a.dat # generate a "seismic trace" for each entry *call genrate htable gravdata stn stn north north east east height height year year month month day day hour hour min min dial dial flag flag ## add header containing epoch time in hours *call hdrmath scanf timesec double -YMDHMS- # scan epoch time from the following text string 20{year} {month} {day} {hour} {min} 0 eval integer jd = julian_day(timesec) # extract the Julian day eval double time = timesec/3600 + 6 # UTC hours ## sort by stations and times *call sort major stn minor timesec ## list headers for Matlab or Octave *call table GRAV14a.sorted.dat stn time jd year month day hour min north east height dial