<commit_before>--- eclips_Dec2017.f.orig	2018-09-21 17:50:58.947354695 +0200
+++ eclips_Dec2017.f	2018-09-21 17:51:23.227141405 +0200
@@ -120,6 +120,9 @@
 C                      Jul 12, 2018  UPDATE ESTIMATED ECLIPSE START AND END TIME
 C                                    WHEN THEY ARE ESTIMATED FROM A CLOSER
 C                                    DATE THAN PREVIOUS ESTIME (<NAME>)
+C                      Sep 06, 2018  USE LINEAR INTERPOLATION MODEL FOR BETA TO
+C                                    REDUCE RESULT SENSITIVITY TO SAMPLING RATE
+C                                    INDUCED BY CALLING ROUTINE (<NAME>)
 C                      Sep 14, 2018  FIXED BODY-X UNIT VECTOR COMPUTATION
 C                                    EXACTLY AT NODE (AVOID NaNs), IMPROVE
 C                                    ITS ACCURACY FOR NON-PERFECTLY CIRCULAR
@@ -244,6 +247,7 @@
       REAL*8    DABS, ABS, SIGN, DMOD, MAX, MIN
       REAL*8    SGAP(MAXSAT, MAXECL), EGAP(MAXSAT, MAXECL)
       REAL*8    ECLCTM(MAXSAT,MAXECL)
+      REAL*8    BTTAG(MAXSAT, 2), BSMPL(MAXSAT, 2), BINTRP
 C Dec 12, 2013
       REAL*8 YBIAS
       INTEGER*4 IBLK(*), J, I
@@ -271,7 +275,7 @@
 C    &  ,.1140d0, 32*0.250d0, 36*0.203d0, 36*0.203d0/
 C BEIDOU RATES OF 0.085 & 0.158 ACCORDING TO DILSSNER (Nov 2017) 
      &  ,.1140d0, 32*0.250d0, 36*0.203d0, 10*0.085D0, 26*0.158d0/
-      SAVE SGAP, EGAP, ECLCTM
+      SAVE SGAP, EGAP, ECLCTM, BTTAG, BSMPL
 C Jan 10, 2017
 C     GAL  BETAy => BETA0
 C     GAL  BETAx => ANOON=15DEG:  (ANIGHT-180); ANIGHT =180 + 15 DEG
@@ -370,7 +374,14 @@
 C
       NOON=.FALSE.
       NIGHT=.FALSE.
-      BETADG = beta/DTR - 90.d0 
+      BETADG = beta/DTR - 90.d0
+C
+C     SAVE LAST TWO VALUES OF BETA FOR INTERPOLATION MODEL
+      BTTAG(IPRN, 2) = BTTAG(IPRN, 1)
+      BSMPL(IPRN, 2) = BSMPL(IPRN, 1)
+      BTTAG(IPRN, 1) = TTAG
+      BSMPL(IPRN, 1) = BETADG
+C
 C Mar 09, 2016
 C      IF(IPRN.GT.32.AND.ABS(BETADG).LT.ANOON) THEN
        IF(IPRN.GT.32.AND.IPRN.LE.64.AND.ABS(BETADG).LT.ANOON) THEN
@@ -641,7 +652,11 @@
 C           IF(IDIR.GT.0.AND.IPRN.LE.100.AND.ABS(BETADG).LE.0.07D0
          IF(IDIR.GT.0.AND.(IPRN.LE.100.OR.IPRN.EQ.INPRN)
      &     .AND.ABS(BETADG).LE.0.07D0
-     &     .AND.BETAINI(IPRN).EQ.0.D0) BETAINI(IPRN)= BETADG
+     &     .AND.BETAINI(IPRN).EQ.0.D0) THEN
+C            SET TO THE BETA VALUE INTERPOLATED AT TURN START
+             BETAINI(IPRN)= BINTRP(IPRN, ECLSTM(IPRN, NECLIPS(IPRN)),
+     &                             BTTAG, BSMPL)
+         ENDIF
 C IIR MIDNIGHT/NOON TURN  or II/IIA NOON TURN START
 C                                  AND GLONASS NOON
             IF(IBLK(IPRN).GT.3.AND.IBLK(IPRN).LE.5.OR.NOON) THEN
@@ -1028,3 +1043,39 @@
       ENDIF
       RETURN
       END
+C
+      DOUBLE PRECISION FUNCTION BINTRP(IPRN, TTAG, BTTAG, BSMPL)
+C     NAME           BINTRP
+C
+C     PURPOSE        INTERPOLATE THE BETA ANGLE TO SPECIFIED DATE
+C                    THIS ENSURES THAT THE COMPUTATION OF TURN START
+C                    CONDITION REMAIN INDEPENDENT OF SAMPLING RATE
+C                    INDUCED BY THE ROUTINE CALLING ECLIPS
+C
+C     PARAMETERS     DESCRIPTION
+C     IPRN           SV PRN NUMBER
+C     TTAG           OBSERVATION EPOCH TIME TAG (EG SEC OF GPS WEEK)
+C     BTTAG          TIME OF SAMPLED BETA VALUES
+C     BSMPL          SAMPLED BETA VALUES
+C
+C     RETURN         BETA INTERPOLATED AT TTAG
+C
+      IMPLICIT NONE
+      INTEGER   MAXSAT
+      PARAMETER (MAXSAT=136)
+      INTEGER*4 IPRN
+      REAL*8    TTAG, BTTAG(MAXSAT, 2), BSMPL(MAXSAT, 2)
+      REAL*8    T01, T20, T21
+C
+      IF (BTTAG(IPRN, 2) .EQ. 0.0D0) THEN
+C         WE HAVE ONLY ONE POINT YET, NO INTERPOLATION
+          BINTRP = BSMPL(IPRN, 1)
+      ELSE
+C         WE HAVE TWO POINTS, WE INTERPOLATE LINEARLY
+         T01    = TTAG - BTTAG(IPRN, 1)
+         T20    = BTTAG(IPRN, 2) - TTAG
+         T21    = BTTAG(IPRN, 2) - BTTAG(IPRN, 1)
+         BINTRP = (BSMPL(IPRN, 1) * T20 + BSMPL(IPRN, 2) * T01) / T21
+      ENDIF
+      RETURN
+      END<commit_msg>Updated β interpolation patch for Beidou.<commit_after>--- eclips_Dec2017.f.orig	2018-10-08 10:47:29.305440637 +0200
+++ eclips_Dec2017.f	2018-10-08 10:49:06.397996483 +0200
@@ -120,6 +120,9 @@
 C                      Jul 12, 2018  UPDATE ESTIMATED ECLIPSE START AND END TIME
 C                                    WHEN THEY ARE ESTIMATED FROM A CLOSER
 C                                    DATE THAN PREVIOUS ESTIME (<NAME>)
+C                      Sep 06, 2018  USE LINEAR INTERPOLATION MODEL FOR BETA TO
+C                                    REDUCE RESULT SENSITIVITY TO SAMPLING RATE
+C                                    INDUCED BY CALLING ROUTINE (<NAME>)
 C                      Sep 14, 2018  FIXED BODY-X UNIT VECTOR COMPUTATION
 C                                    EXACTLY AT NODE (AVOID NaNs), IMPROVE
 C                                    ITS ACCURACY FOR NON-PERFECTLY CIRCULAR
@@ -244,6 +247,7 @@
       REAL*8    DABS, ABS, SIGN, DMOD, MAX, MIN
       REAL*8    SGAP(MAXSAT, MAXECL), EGAP(MAXSAT, MAXECL)
       REAL*8    ECLCTM(MAXSAT,MAXECL)
+      REAL*8    BTTAG(MAXSAT, 2), BSMPL(MAXSAT, 2), BINTRP, BETAEV
 C Dec 12, 2013
       REAL*8 YBIAS
       INTEGER*4 IBLK(*), J, I
@@ -271,7 +275,7 @@
 C    &  ,.1140d0, 32*0.250d0, 36*0.203d0, 36*0.203d0/
 C BEIDOU RATES OF 0.085 & 0.158 ACCORDING TO DILSSNER (Nov 2017) 
      &  ,.1140d0, 32*0.250d0, 36*0.203d0, 10*0.085D0, 26*0.158d0/
-      SAVE SGAP, EGAP, ECLCTM
+      SAVE SGAP, EGAP, ECLCTM, BTTAG, BSMPL
 C Jan 10, 2017
 C     GAL  BETAy => BETA0
 C     GAL  BETAx => ANOON=15DEG:  (ANIGHT-180); ANIGHT =180 + 15 DEG
@@ -370,7 +374,14 @@
 C
       NOON=.FALSE.
       NIGHT=.FALSE.
-      BETADG = beta/DTR - 90.d0 
+      BETADG = beta/DTR - 90.d0
+C
+C     SAVE LAST TWO VALUES OF BETA FOR INTERPOLATION MODEL
+      BTTAG(IPRN, 2) = BTTAG(IPRN, 1)
+      BSMPL(IPRN, 2) = BSMPL(IPRN, 1)
+      BTTAG(IPRN, 1) = TTAG
+      BSMPL(IPRN, 1) = BETADG
+C
 C Mar 09, 2016
 C      IF(IPRN.GT.32.AND.ABS(BETADG).LT.ANOON) THEN
        IF(IPRN.GT.32.AND.IPRN.LE.64.AND.ABS(BETADG).LT.ANOON) THEN
@@ -450,14 +461,14 @@
        DET= 180.0D0-ACOS(SVBCOS / COS(BETADG*DTR))/DTR
        IF(ABS(YANGLE).GT.90.0D0) DET= 360.0D0 -DET
 C May 03, 2017 THE ON LIMIT BETADG <= 4 DEG
-C  MEO YS/ON SWITCHING DELTA BETA LIMIT
-       BETAE= .52D0
-C  IGSO YS/ON SWITCHING DELTA BETA LIMIT
-       IF(IBLK(IPRN).EQ.22.OR.IBLK(IPRN).EQ.26) BETAE= .97D0
 C COMPUTE THE ACTUAL BETAE (HERE BETA INCREASE PER 1 REVOLUTION)
-       IF((TTAG-ECLSTM(IPRN,1)).NE.0.D0)
-     & BETAE= (BETADG-BETAINI(IPRN))/(TTAG-ECLSTM(IPRN,1))*360.D0/MURATE
-       BETAE = ABS(BETAE)
+       BETAE = ABS(BETAEV(IPRN, TTAG, BTTAG, BSMPL, P2, V2))
+       IF (BETAE .EQ. 0.0D0) THEN
+C          MEO YS/ON SWITCHING DELTA BETA LIMIT
+           BETAE= .52D0
+C          IGSO YS/ON SWITCHING DELTA BETA LIMIT
+           IF(IBLK(IPRN).EQ.22.OR.IBLK(IPRN).EQ.26) BETAE= .97D0
+       ENDIF
 C ON SWITCH FOR SURE FOR GEO (23/27) OR BETAE LIMIT
        IF(IBLK(IPRN).EQ.23.OR.IBLK(IPRN).EQ.27.OR.ABS(BETADG).LE.(4.1D0-
      &  BETAE)) GO TO 2
@@ -641,7 +652,11 @@
 C           IF(IDIR.GT.0.AND.IPRN.LE.100.AND.ABS(BETADG).LE.0.07D0
          IF(IDIR.GT.0.AND.(IPRN.LE.100.OR.IPRN.EQ.INPRN)
      &     .AND.ABS(BETADG).LE.0.07D0
-     &     .AND.BETAINI(IPRN).EQ.0.D0) BETAINI(IPRN)= BETADG
+     &     .AND.BETAINI(IPRN).EQ.0.D0) THEN
+C            SET TO THE BETA VALUE INTERPOLATED AT TURN START
+             BETAINI(IPRN)= BINTRP(IPRN, ECLSTM(IPRN, NECLIPS(IPRN)),
+     &                             BTTAG, BSMPL)
+         ENDIF
 C IIR MIDNIGHT/NOON TURN  or II/IIA NOON TURN START
 C                                  AND GLONASS NOON
             IF(IBLK(IPRN).GT.3.AND.IBLK(IPRN).LE.5.OR.NOON) THEN
@@ -1028,3 +1043,81 @@
       ENDIF
       RETURN
       END
+C
+      DOUBLE PRECISION FUNCTION BINTRP(IPRN, TTAG, BTTAG, BSMPL)
+C     NAME           BINTRP
+C
+C     PURPOSE        INTERPOLATE THE BETA ANGLE TO SPECIFIED DATE
+C                    THIS ENSURES THAT THE COMPUTATION OF TURN START
+C                    CONDITION REMAIN INDEPENDENT OF SAMPLING RATE
+C                    INDUCED BY THE ROUTINE CALLING ECLIPS
+C
+C     PARAMETERS     DESCRIPTION
+C     IPRN           SV PRN NUMBER
+C     TTAG           OBSERVATION EPOCH TIME TAG (EG SEC OF GPS WEEK)
+C     BTTAG          TIME OF SAMPLED BETA VALUES
+C     BSMPL          SAMPLED BETA VALUES
+C
+C     RETURN         BETA INTERPOLATED AT TTAG
+C
+      IMPLICIT NONE
+      INTEGER   MAXSAT
+      PARAMETER (MAXSAT=136)
+      INTEGER*4 IPRN
+      REAL*8    TTAG, BTTAG(MAXSAT, 2), BSMPL(MAXSAT, 2)
+      REAL*8    T01, T20, T21
+C
+      IF (BTTAG(IPRN, 2) .EQ. 0.0D0) THEN
+C         WE HAVE ONLY ONE POINT YET, NO INTERPOLATION
+          BINTRP = BSMPL(IPRN, 1)
+      ELSE
+C         WE HAVE TWO POINTS, WE INTERPOLATE LINEARLY
+         T01    = TTAG - BTTAG(IPRN, 1)
+         T20    = BTTAG(IPRN, 2) - TTAG
+         T21    = BTTAG(IPRN, 2) - BTTAG(IPRN, 1)
+         BINTRP = (BSMPL(IPRN, 1) * T20 + BSMPL(IPRN, 2) * T01) / T21
+      ENDIF
+      RETURN
+      END
+C
+      DOUBLE PRECISION FUNCTION BETAEV(IPRN, TTAG, BTTAG, BSMPL, P2, V2)
+C     NAME           BETAEV
+C
+C     PURPOSE        EVALUATE BETA EVOLUTION OVER THE PAST PERIOD
+C
+C     PARAMETERS     DESCRIPTION
+C     IPRN           SV PRN NUMBER
+C     TTAG           OBSERVATION EPOCH TIME TAG (EG SEC OF GPS WEEK)
+C     BTTAG          TIME OF SAMPLED BETA VALUES
+C     BSMPL          SAMPLED BETA VALUES
+C     P2             SQUARE OF THE POSITION VECTOR NORM
+C     V2             SQUARE OF THE VELOCITY VECTOR NORM
+C
+C     RETURN         SIGNED BETA EVOLUTION OVER THE PAST PERIOD,
+C                    OR 0.0D0 IF LESS THAN TWO BETA SAMPLES ARE AVAILABLE
+C
+      IMPLICIT NONE
+      INTEGER   MAXSAT
+      PARAMETER (MAXSAT=136)
+      INTEGER*4 IPRN
+      REAL*8    TTAG, BTTAG(MAXSAT, 2), BSMPL(MAXSAT, 2), P2, V2
+      REAL*8    T01, T20, T21, A, PERIOD, GM, PI, DB, DT
+      REAL*8    SQRT
+      DATA      GM / 3.986004415D14 /
+      DATA      PI / 3.141592653589793D0 /
+C
+      IF (BTTAG(IPRN, 2) .EQ. 0.0D0) THEN
+C         WE HAVE ONLY ONE POINT YET, NO INTERPOLATION
+         BETAEV = 0.0D0
+      ELSE
+C         COMPUTE PERIOD
+C         (WE DON'T USE 360/MURATE BECAUSE MURATE IS THE LOCAL ANGULAR VELOCITY)
+          A      = 1.0D0 / (2.0 / SQRT(P2) - V2 / GM)
+          PERIOD = 2.0D0 * PI * A * SQRT(A / GM)
+C
+          DB     = BSMPL(IPRN, 1) - BSMPL(IPRN, 2)
+          DT     = BTTAG(IPRN, 1) - BTTAG(IPRN, 2)
+          BETAEV = DB * PERIOD / DT
+      ENDIF
+      RETURN
+      END
{'fraction_non_alphanumeric': 0.11172659844146089, 'fraction_numerical': 0.07417143930147405, 'mean_word_length': 1.7166539148176485, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6351251', 'n_tokens_mistral': 5244, 'n_tokens_neox': 4415, 'n_words': 1122}