Skip to content

Commit

Permalink
set invalid values to nan in extrapolation
Browse files Browse the repository at this point in the history
update delta time EOP files
  • Loading branch information
tsutterley committed Feb 13, 2021
1 parent 82cac08 commit b5bf203
Show file tree
Hide file tree
Showing 8 changed files with 373 additions and 27 deletions.
161 changes: 161 additions & 0 deletions pyTMD/data/iers_deltat.data
Original file line number Diff line number Diff line change
Expand Up @@ -5715,3 +5715,164 @@
2020 9 1 69.3693
2020 9 2 69.3684
2020 9 3 69.3677
2020 9 4 69.3670
2020 9 5 69.3664
2020 9 6 69.3659
2020 9 7 69.3653
2020 9 8 69.3647
2020 9 9 69.3639
2020 9 10 69.3631
2020 9 11 69.3623
2020 9 12 69.3615
2020 9 13 69.3607
2020 9 14 69.3601
2020 9 15 69.3597
2020 9 16 69.3596
2020 9 17 69.3597
2020 9 18 69.3600
2020 9 19 69.3604
2020 9 20 69.3608
2020 9 21 69.3610
2020 9 22 69.3610
2020 9 23 69.3608
2020 9 24 69.3605
2020 9 25 69.3600
2020 9 26 69.3596
2020 9 27 69.3590
2020 9 28 69.3585
2020 9 29 69.3580
2020 9 30 69.3577
2020 10 1 69.3575
2020 10 2 69.3573
2020 10 3 69.3571
2020 10 4 69.3570
2020 10 5 69.3568
2020 10 6 69.3565
2020 10 7 69.3562
2020 10 8 69.3557
2020 10 9 69.3550
2020 10 10 69.3544
2020 10 11 69.3538
2020 10 12 69.3534
2020 10 13 69.3533
2020 10 14 69.3534
2020 10 15 69.3539
2020 10 16 69.3546
2020 10 17 69.3554
2020 10 18 69.3562
2020 10 19 69.3567
2020 10 20 69.3570
2020 10 21 69.3571
2020 10 22 69.3571
2020 10 23 69.3571
2020 10 24 69.3572
2020 10 25 69.3573
2020 10 26 69.3575
2020 10 27 69.3578
2020 10 28 69.3581
2020 10 29 69.3585
2020 10 30 69.3588
2020 10 31 69.3591
2020 11 1 69.3593
2020 11 2 69.3595
2020 11 3 69.3595
2020 11 4 69.3595
2020 11 5 69.3593
2020 11 6 69.3591
2020 11 7 69.3587
2020 11 8 69.3585
2020 11 9 69.3586
2020 11 10 69.3589
2020 11 11 69.3595
2020 11 12 69.3603
2020 11 13 69.3612
2020 11 14 69.3620
2020 11 15 69.3626
2020 11 16 69.3630
2020 11 17 69.3631
2020 11 18 69.3630
2020 11 19 69.3629
2020 11 20 69.3624
2020 11 21 69.3622
2020 11 22 69.3621
2020 11 23 69.3621
2020 11 24 69.3623
2020 11 25 69.3626
2020 11 26 69.3630
2020 11 27 69.3632
2020 11 28 69.3633
2020 11 29 69.3633
2020 11 30 69.3632
2020 12 1 69.3630
2020 12 2 69.3627
2020 12 3 69.3623
2020 12 4 69.3619
2020 12 5 69.3616
2020 12 6 69.3615
2020 12 7 69.3617
2020 12 8 69.3620
2020 12 9 69.3625
2020 12 10 69.3630
2020 12 11 69.3637
2020 12 12 69.3642
2020 12 13 69.3644
2020 12 14 69.3644
2020 12 15 69.3641
2020 12 16 69.3637
2020 12 17 69.3632
2020 12 18 69.3627
2020 12 19 69.3625
2020 12 20 69.3623
2020 12 21 69.3623
2020 12 22 69.3624
2020 12 23 69.3626
2020 12 24 69.3626
2020 12 25 69.3627
2020 12 26 69.3625
2020 12 27 69.3622
2020 12 28 69.3618
2020 12 29 69.3612
2020 12 30 69.3606
2020 12 31 69.3600
2021 1 1 69.3594
2021 1 2 69.3588
2021 1 3 69.3585
2021 1 4 69.3583
2021 1 5 69.3584
2021 1 6 69.3586
2021 1 7 69.3589
2021 1 8 69.3590
2021 1 9 69.3591
2021 1 10 69.3589
2021 1 11 69.3585
2021 1 12 69.3580
2021 1 13 69.3574
2021 1 14 69.3569
2021 1 15 69.3565
2021 1 16 69.3560
2021 1 17 69.3558
2021 1 18 69.3556
2021 1 19 69.3554
2021 1 20 69.3553
2021 1 21 69.3551
2021 1 22 69.3548
2021 1 23 69.3545
2021 1 24 69.3540
2021 1 25 69.3534
2021 1 26 69.3527
2021 1 27 69.3520
2021 1 28 69.3513
2021 1 29 69.3509
2021 1 30 69.3507
2021 1 31 69.3507
2021 2 1 69.3510
2021 2 2 69.3515
2021 2 3 69.3522
2021 2 4 69.3528
2021 2 5 69.3533
2021 2 6 69.3535
2021 2 7 69.3536
2021 2 8 69.3535
2021 2 9 69.3533
2021 2 10 69.3532
2021 2 11 69.3532
161 changes: 161 additions & 0 deletions pyTMD/data/merged_deltat.data
Original file line number Diff line number Diff line change
Expand Up @@ -6731,3 +6731,164 @@
2020 9 1 69.3693
2020 9 2 69.3684
2020 9 3 69.3677
2020 9 4 69.3670
2020 9 5 69.3664
2020 9 6 69.3659
2020 9 7 69.3653
2020 9 8 69.3647
2020 9 9 69.3639
2020 9 10 69.3631
2020 9 11 69.3623
2020 9 12 69.3615
2020 9 13 69.3607
2020 9 14 69.3601
2020 9 15 69.3597
2020 9 16 69.3596
2020 9 17 69.3597
2020 9 18 69.3600
2020 9 19 69.3604
2020 9 20 69.3608
2020 9 21 69.3610
2020 9 22 69.3610
2020 9 23 69.3608
2020 9 24 69.3605
2020 9 25 69.3600
2020 9 26 69.3596
2020 9 27 69.3590
2020 9 28 69.3585
2020 9 29 69.3580
2020 9 30 69.3577
2020 10 1 69.3575
2020 10 2 69.3573
2020 10 3 69.3571
2020 10 4 69.3570
2020 10 5 69.3568
2020 10 6 69.3565
2020 10 7 69.3562
2020 10 8 69.3557
2020 10 9 69.3550
2020 10 10 69.3544
2020 10 11 69.3538
2020 10 12 69.3534
2020 10 13 69.3533
2020 10 14 69.3534
2020 10 15 69.3539
2020 10 16 69.3546
2020 10 17 69.3554
2020 10 18 69.3562
2020 10 19 69.3567
2020 10 20 69.3570
2020 10 21 69.3571
2020 10 22 69.3571
2020 10 23 69.3571
2020 10 24 69.3572
2020 10 25 69.3573
2020 10 26 69.3575
2020 10 27 69.3578
2020 10 28 69.3581
2020 10 29 69.3585
2020 10 30 69.3588
2020 10 31 69.3591
2020 11 1 69.3593
2020 11 2 69.3595
2020 11 3 69.3595
2020 11 4 69.3595
2020 11 5 69.3593
2020 11 6 69.3591
2020 11 7 69.3587
2020 11 8 69.3585
2020 11 9 69.3586
2020 11 10 69.3589
2020 11 11 69.3595
2020 11 12 69.3603
2020 11 13 69.3612
2020 11 14 69.3620
2020 11 15 69.3626
2020 11 16 69.3630
2020 11 17 69.3631
2020 11 18 69.3630
2020 11 19 69.3629
2020 11 20 69.3624
2020 11 21 69.3622
2020 11 22 69.3621
2020 11 23 69.3621
2020 11 24 69.3623
2020 11 25 69.3626
2020 11 26 69.3630
2020 11 27 69.3632
2020 11 28 69.3633
2020 11 29 69.3633
2020 11 30 69.3632
2020 12 1 69.3630
2020 12 2 69.3627
2020 12 3 69.3623
2020 12 4 69.3619
2020 12 5 69.3616
2020 12 6 69.3615
2020 12 7 69.3617
2020 12 8 69.3620
2020 12 9 69.3625
2020 12 10 69.3630
2020 12 11 69.3637
2020 12 12 69.3642
2020 12 13 69.3644
2020 12 14 69.3644
2020 12 15 69.3641
2020 12 16 69.3637
2020 12 17 69.3632
2020 12 18 69.3627
2020 12 19 69.3625
2020 12 20 69.3623
2020 12 21 69.3623
2020 12 22 69.3624
2020 12 23 69.3626
2020 12 24 69.3626
2020 12 25 69.3627
2020 12 26 69.3625
2020 12 27 69.3622
2020 12 28 69.3618
2020 12 29 69.3612
2020 12 30 69.3606
2020 12 31 69.3600
2021 1 1 69.3594
2021 1 2 69.3588
2021 1 3 69.3585
2021 1 4 69.3583
2021 1 5 69.3584
2021 1 6 69.3586
2021 1 7 69.3589
2021 1 8 69.3590
2021 1 9 69.3591
2021 1 10 69.3589
2021 1 11 69.3585
2021 1 12 69.3580
2021 1 13 69.3574
2021 1 14 69.3569
2021 1 15 69.3565
2021 1 16 69.3560
2021 1 17 69.3558
2021 1 18 69.3556
2021 1 19 69.3554
2021 1 20 69.3553
2021 1 21 69.3551
2021 1 22 69.3548
2021 1 23 69.3545
2021 1 24 69.3540
2021 1 25 69.3534
2021 1 26 69.3527
2021 1 27 69.3520
2021 1 28 69.3513
2021 1 29 69.3509
2021 1 30 69.3507
2021 1 31 69.3507
2021 2 1 69.3510
2021 2 2 69.3515
2021 2 3 69.3522
2021 2 4 69.3528
2021 2 5 69.3533
2021 2 6 69.3535
2021 2 7 69.3536
2021 2 8 69.3535
2021 2 9 69.3533
2021 2 10 69.3532
2021 2 11 69.3532
1 change: 0 additions & 1 deletion pyTMD/nearest_extrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def nearest_extrap(ilon,ilat,idata,lon,lat,fill_value=np.nan,
#-- flattened valid data array
iflat = idata.data[indy,indx]


#-- calculate coordinates for nearest-neighbors
if (EPSG == '4326'):
#-- valid grid latitude and longitude in radians
Expand Down
5 changes: 4 additions & 1 deletion pyTMD/read_FES_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
u"""
read_FES_model.py (12/2020)
read_FES_model.py (02/2020)
Reads files for a tidal model and makes initial calculations to run tide program
Includes functions to extract tidal harmonic constants from the
FES (Finite Element Solution) tide models for given locations
Expand Down Expand Up @@ -52,6 +52,7 @@
nearest_extrap.py: nearest-neighbor extrapolation of data to coordinates
UPDATE HISTORY:
Updated 02/2021: set invalid values to nan in extrapolation
Updated 12/2020: added nearest-neighbor data extrapolation
Updated 09/2020: set bounds error to false for regular grid interpolations
adjust dimensions of input coordinates to be iterable
Expand Down Expand Up @@ -176,6 +177,8 @@ def extract_FES_constants(ilon, ilat, directory, model_files,
if EXTRAPOLATE:
#-- find invalid data points
inv, = np.nonzero(hci.mask)
#-- replace invalid values with nan
hc[hc.mask] = np.nan
#-- extrapolate points within 10km of valid model points
hci.data[inv] = nearest_extrap(lon,lat,hc,ilon[inv],ilat[inv],
dtype=hc.dtype,cutoff=10.0)
Expand Down
5 changes: 4 additions & 1 deletion pyTMD/read_GOT_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
u"""
read_GOT_model.py (12/2020)
read_GOT_model.py (02/2021)
Reads files for Richard Ray's Global Ocean Tide (GOT) models and makes initial
calculations to run the tide program
Includes functions to extract tidal harmonic constants out of a tidal model for
Expand Down Expand Up @@ -37,6 +37,7 @@
nearest_extrap.py: nearest-neighbor extrapolation of data to coordinates
UPDATE HISTORY:
Updated 02/2021: set invalid values to nan in extrapolation
Updated 12/2020: added valid data extrapolation with nearest_extrap
Updated 09/2020: set bounds error to false for regular grid interpolations
adjust dimensions of input coordinates to be iterable
Expand Down Expand Up @@ -161,6 +162,8 @@ def extract_GOT_constants(ilon, ilat, directory, model_files,
if EXTRAPOLATE:
#-- find invalid data points
inv, = np.nonzero(hci.mask)
#-- replace invalid values with nan
hc[hc.mask] = np.nan
#-- extrapolate points within 10km of valid model points
hci.data[inv] = nearest_extrap(lon,lat,hc,ilon[inv],ilat[inv],
dtype=hc.dtype,cutoff=10.0)
Expand Down
Loading

0 comments on commit b5bf203

Please sign in to comment.