pydra-core 0.0.1__py2.py3-none-any.whl → 0.0.2__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pydra_core/__init__.py +32 -32
- pydra_core/common/common.py +98 -98
- pydra_core/common/enum.py +63 -63
- pydra_core/common/interpolate.py +345 -345
- pydra_core/common/probability.py +293 -293
- pydra_core/core/calculation.py +51 -51
- pydra_core/core/datamodels/frequency_line.py +60 -60
- pydra_core/core/exceedance_frequency_line.py +224 -224
- pydra_core/core/exceedance_frequency_line_experimental.py +163 -163
- pydra_core/core/hbn.py +226 -226
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_2017.txt +36 -36
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_2017_metOnzHeid.txt +45 -45
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_G_2015_metOnzHeid_v02.txt +50 -50
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_G_2015_v02.txt +42 -42
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_G_2050_metOnzHeid_v02.txt +56 -56
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_G_2050_v02.txt +48 -48
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_G_2100_metOnzHeid_v02.txt +56 -56
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_G_2100_v02.txt +48 -48
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_W_2015_metOnzHeid_v02.txt +50 -50
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_W_2015_v02.txt +42 -42
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_W_2050_metOnzHeid_v02.txt +56 -56
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_W_2050_v02.txt +48 -48
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_W_2100_metOnzHeid_v02.txt +51 -51
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_OI2014_W_2100_v02.txt +44 -44
- pydra_core/data/statistics/Afvoer/Borgharen/Ovkans_Borgharen_piekafvoer_Ref.txt +27 -27
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_2017.txt +30 -30
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_2017_metOnzHeid.txt +32 -32
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_G_2015.txt +44 -44
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_G_2015_metOnzHeid.txt +33 -33
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_G_2050.txt +44 -44
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_G_2050_metOnzHeid.txt +33 -33
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_G_2100.txt +44 -44
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_G_2100_metOnzHeid.txt +38 -38
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_W_2015.txt +44 -44
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_W_2015_metOnzHeid.txt +33 -33
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_W_2050.txt +44 -44
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_W_2050_metOnzHeid.txt +33 -33
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_W_2100.txt +44 -44
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_OI2014_W_2100_metOnzHeid.txt +33 -33
- pydra_core/data/statistics/Afvoer/Dalfsen/Ovkans_Dalfsen_piekafvoer_Ref.txt +13 -13
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_2017.txt +47 -47
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_2017_metOnzHeid.txt +47 -47
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_G_2015.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_G_2015_metOnzHeid.txt +58 -58
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_G_2050.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_G_2050_metOnzHeid.txt +58 -58
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_G_2100.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_G_2100_metOnzHeid.txt +58 -58
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_W_2015.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_W_2015_metOnzHeid.txt +58 -58
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_W_2050.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_W_2050_metOnzHeid.txt +58 -58
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_W_2100.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_OI2014_W_2100_metOnzHeid.txt +58 -58
- pydra_core/data/statistics/Afvoer/Lith/Ovkans_Lith_piekafvoer_Ref.txt +20 -20
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_2017.txt +33 -33
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_2017_metOnzHeid.txt +59 -59
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2015.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2015_BenedenRijn.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2015_metOnzHeid.txt +62 -62
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2015_metOnzHeid_BenedenRijn.txt +65 -65
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2050.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2050_BenedenRijn.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2050_metOnzHeid.txt +62 -62
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2050_metOnzHeid_BenedenRijn.txt +64 -64
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2100.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2100_BenedenRijn.txt +49 -49
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2100_metOnzHeid.txt +62 -62
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_G_2100_metOnzHeid_BenedenRijn.txt +64 -64
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2015.txt +50 -50
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2015_BenedenRijn.txt +50 -50
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2015_metOnzHeid.txt +62 -62
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2015_metOnzHeid_BenedenRijn.txt +64 -64
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2050.txt +50 -50
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2050_BenedenRijn.txt +50 -50
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2050_metOnzHeid.txt +62 -62
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2050_metOnzHeid_BenedenRijn.txt +64 -64
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2100.txt +50 -50
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2100_BenedenRijn.txt +50 -50
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2100_metOnzHeid.txt +62 -62
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_OI2014_W_2100_metOnzHeid_BenedenRijn.txt +65 -65
- pydra_core/data/statistics/Afvoer/Lobith/Ovkans_Lobith_piekafvoer_Ref.txt +22 -22
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_2017.txt +55 -55
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_2017_metOnzHeid.txt +55 -55
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_G_2015.txt +46 -46
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_G_2015_metOnzHeid.txt +64 -64
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_G_2050.txt +46 -46
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_G_2050_metOnzHeid.txt +64 -64
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_G_2100.txt +46 -46
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_G_2100_metOnzHeid.txt +64 -64
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_W_2015.txt +47 -47
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_W_2015_metOnzHeid.txt +64 -64
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_W_2050.txt +47 -47
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_W_2050_metOnzHeid.txt +64 -64
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_W_2100.txt +47 -47
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_OI2014_W_2100_metOnzHeid.txt +64 -64
- pydra_core/data/statistics/Afvoer/Olst/Ovkans_Olst_piekafvoer_Ref.txt +14 -14
- pydra_core/data/statistics/Golfvorm/Borgharen/Golfvormen_Borgharen.txt +76 -76
- pydra_core/data/statistics/Golfvorm/Dalfsen/Golfvormen_Dalfsen.txt +83 -83
- pydra_core/data/statistics/Golfvorm/Grevelingenmeer/Golfvormen_Grevelingenmeer.txt +33 -33
- pydra_core/data/statistics/Golfvorm/IJsselmeer/Golfvormen_IJsselmeer.txt +83 -83
- pydra_core/data/statistics/Golfvorm/Lith/Golfvormen_Lith.txt +76 -76
- pydra_core/data/statistics/Golfvorm/Lobith/Golfvormen_Lobith.txt +76 -76
- pydra_core/data/statistics/Golfvorm/Markermeer/Golfvormen_Markermeer.txt +139 -139
- pydra_core/data/statistics/Golfvorm/Olst/Golfvormen_Olst.txt +83 -83
- pydra_core/data/statistics/Golfvorm/Veerse Meer/Golfvormen_Veersemeer.txt +53 -53
- pydra_core/data/statistics/Golfvorm/Veluwerandmeer/Golfvormen_Veluwerandmeer.txt +139 -139
- pydra_core/data/statistics/Golfvorm/Volkerak-Zoommeer/Golfvormen_Volkerakzoommeer.txt +73 -73
- pydra_core/data/statistics/Meerpeil/Grevelingenmeer/Ovkans_Grevelingenmeer_piekmeerpeil_2017.txt +12 -12
- pydra_core/data/statistics/Meerpeil/Grevelingenmeer/Ovkans_Grevelingenmeer_piekmeerpeil_2017_metOnzHeid.txt +24 -24
- pydra_core/data/statistics/Meerpeil/Grevelingenmeer/Ovkans_Grevelingenmeer_piekmeerpeil_v01.txt +12 -12
- pydra_core/data/statistics/Meerpeil/IJsselmeer/Ovkans_IJsselmeer_piekmeerpeil_2017.txt +25 -25
- pydra_core/data/statistics/Meerpeil/IJsselmeer/Ovkans_IJsselmeer_piekmeerpeil_2017_metOnzHeid.txt +39 -39
- pydra_core/data/statistics/Meerpeil/IJsselmeer/Ovkans_IJsselmeer_piekmeerpeil_v01.txt +14 -14
- pydra_core/data/statistics/Meerpeil/Markermeer/Ovkans_Markermeer_piekmeerpeil_2017.txt +18 -18
- pydra_core/data/statistics/Meerpeil/Markermeer/Ovkans_Markermeer_piekmeerpeil_2017_metOnzHeid.txt +37 -37
- pydra_core/data/statistics/Meerpeil/Markermeer/Ovkans_Markermeer_piekmeerpeil_v01.txt +10 -10
- pydra_core/data/statistics/Meerpeil/Veerse Meer/Ovkans_Veersemeer_piekmeerpeil_excl_peilverhoging.txt +13 -13
- pydra_core/data/statistics/Meerpeil/Veerse Meer/Ovkans_Veersemeer_piekmeerpeil_v01.txt +15 -15
- pydra_core/data/statistics/Meerpeil/Veluwerandmeer/Ovkans_Veluwerandmeer_piekmeerpeil_2017.txt +13 -13
- pydra_core/data/statistics/Meerpeil/Veluwerandmeer/Ovkans_Veluwerandmeer_piekmeerpeil_2017_metOnzHeid.txt +36 -36
- pydra_core/data/statistics/Meerpeil/Veluwerandmeer/Ovkans_Veluwerandmeer_piekmeerpeil_v01.txt +13 -13
- pydra_core/data/statistics/Meerpeil/Volkerak-Zoommeer/Ovkans_VZM_piekmeerpeil_BER-VZM.txt +17 -17
- pydra_core/data/statistics/Meerpeil/Volkerak-Zoommeer/Ovkans_VZM_piekmeerpeil_BER-VZM_metOnzHeid.txt +42 -42
- pydra_core/data/statistics/Restant/Oosterschelde/BesliskansenOSKering.txt +524 -524
- pydra_core/data/statistics/Restant/Oosterschelde/KansenFaseverschil_2023.txt +7 -7
- pydra_core/data/statistics/Restant/Oosterschelde/KansenFaseverschil_OS.txt +13 -13
- pydra_core/data/statistics/Restant/Oosterschelde/KansenStormduur_OS.txt +14 -14
- pydra_core/data/statistics/Restant/Oosterschelde/KansenStormduur_OS_40_60_80uur_2023.txt +16 -16
- pydra_core/data/statistics/Restant/Oosterschelde/ScenariokansenOSKering_2008.txt +23 -23
- pydra_core/data/statistics/Restant/Oosterschelde/ScenariokansenOSKering_2013.txt +18 -18
- pydra_core/data/statistics/Restant/Oosterschelde/ScenariokansenOSKering_2017.txt +18 -18
- pydra_core/data/statistics/Restant/Oosterschelde/ScenariokansenOSKering_2023.txt +13 -13
- pydra_core/data/statistics/Restant/Up2U/Up2U10.dat +59 -59
- pydra_core/data/statistics/Restant/Up2U/Up2Up.dat +59 -59
- pydra_core/data/statistics/Restant/Up2U/Up2Ustar.dat +59 -59
- pydra_core/data/statistics/Restant/hulpdijken.txt +59 -59
- pydra_core/data/statistics/Restant/hulpgolfhoogtes.txt +23 -23
- pydra_core/data/statistics/Restant/hulpgolfperiodes.txt +38 -38
- pydra_core/data/statistics/Restant/kansstormduur.txt +8 -8
- pydra_core/data/statistics/Restant/pwind_west.txt +33 -33
- pydra_core/data/statistics/Restant/pwind_west_met_Volkerfactor.txt +33 -33
- pydra_core/data/statistics/Restant/pwind_west_zonder_Volkerfactor.txt +33 -33
- pydra_core/data/statistics/Sigmafunctie/Hollandse Kust Midden/VS_sigmafunctie_Kust_Midden.txt +18 -18
- pydra_core/data/statistics/Sigmafunctie/Hollandse Kust Midden/VS_sigmafunctie_Kust_Midden_2017.txt +22 -22
- pydra_core/data/statistics/Sigmafunctie/Hollandse Kust Noord/VS_sigmafunctie_Kust_Noord.txt +18 -18
- pydra_core/data/statistics/Sigmafunctie/Hollandse Kust Noord/VS_sigmafunctie_Kust_Noord_2017.txt +22 -22
- pydra_core/data/statistics/Sigmafunctie/Hollandse Kust Zuid/VS_sigmafunctie_Kust_Zuid.txt +18 -18
- pydra_core/data/statistics/Sigmafunctie/Hollandse Kust Zuid/VS_sigmafunctie_Kust_Zuid_2017.txt +22 -22
- pydra_core/data/statistics/Sigmafunctie/Oosterschelde/VS_sigmafunctie_OS.txt +21 -21
- pydra_core/data/statistics/Sigmafunctie/Oosterschelde/VS_sigmafunctie_OS_16sectoren_2023.txt +23 -23
- pydra_core/data/statistics/Sigmafunctie/Oosterschelde/VS_sigmafunctie_OS_2017.txt +21 -21
- pydra_core/data/statistics/Sigmafunctie/Waddenzee Oost/VS_sigmafunctie_WZ_oost.txt +18 -18
- pydra_core/data/statistics/Sigmafunctie/Waddenzee Oost/VS_sigmafunctie_WZ_oost_2017.txt +22 -22
- pydra_core/data/statistics/Sigmafunctie/Waddenzee West/VS_sigmafunctie_WZ_west.txt +18 -18
- pydra_core/data/statistics/Sigmafunctie/Waddenzee West/VS_sigmafunctie_WZ_west_2017.txt +22 -22
- pydra_core/data/statistics/Sigmafunctie/Westerschelde/VS_sigmafunctie_WS.txt +18 -18
- pydra_core/data/statistics/Sigmafunctie/Westerschelde/VS_sigmafunctie_WS_2017.txt +22 -22
- pydra_core/data/statistics/Sluitpeilen/Sluitfunctie Europoortkering Maas 2017.csv +630 -630
- pydra_core/data/statistics/Sluitpeilen/Sluitfunctie Europoortkering Rijn 2017.csv +630 -630
- pydra_core/data/statistics/Sluitpeilen/Sluitfunctie Hollandsche IJsselkering.csv +757 -757
- pydra_core/data/statistics/Sluitpeilen/Sluitfunctie Oosterscheldekering 2017.csv +55080 -55080
- pydra_core/data/statistics/Topduur/Borgharen/Topduur_Borgharen_2017.txt +18 -18
- pydra_core/data/statistics/Topduur/Borgharen/Topduur_Borgharen_v00.txt +14 -14
- pydra_core/data/statistics/Topduur/Dalfsen/Topduur_Dalfsen_2017.txt +19 -19
- pydra_core/data/statistics/Topduur/Dalfsen/Topduur_Dalfsen_v01.txt +15 -15
- pydra_core/data/statistics/Topduur/Grevelingenmeer/Topduur_Grevelingenmeer_2017.txt +13 -13
- pydra_core/data/statistics/Topduur/Grevelingenmeer/Topduur_Grevelingenmeer_v01.txt +13 -13
- pydra_core/data/statistics/Topduur/IJsselmeer/Topduur_IJsselmeer_2017.txt +19 -19
- pydra_core/data/statistics/Topduur/IJsselmeer/Topduur_IJsselmeer_v01.txt +14 -14
- pydra_core/data/statistics/Topduur/Lith/Topduur_Lith_2017.txt +18 -18
- pydra_core/data/statistics/Topduur/Lith/Topduur_Lith_v01.txt +17 -17
- pydra_core/data/statistics/Topduur/Lobith/Topduur_Lobith_2017.txt +18 -18
- pydra_core/data/statistics/Topduur/Lobith/Topduur_Lobith_v01.txt +16 -16
- pydra_core/data/statistics/Topduur/Markermeer/Topduur_Markermeer_2017.txt +19 -19
- pydra_core/data/statistics/Topduur/Markermeer/Topduur_Markermeer_v01.txt +11 -11
- pydra_core/data/statistics/Topduur/Olst/Topduur_Olst_2017.txt +19 -19
- pydra_core/data/statistics/Topduur/Olst/Topduur_Olst_v01.txt +15 -15
- pydra_core/data/statistics/Topduur/Veerse Meer/Topduur_Veersemeer_excl_peilverhoging.txt +12 -12
- pydra_core/data/statistics/Topduur/Veerse Meer/Topduur_Veersemeer_v01.txt +15 -15
- pydra_core/data/statistics/Topduur/Veluwerandmeer/Topduur_Veluwerandmeer_2017.txt +11 -11
- pydra_core/data/statistics/Topduur/Veluwerandmeer/Topduur_Veluwerandmeer_v01.txt +11 -11
- pydra_core/data/statistics/Topduur/Volkerak-Zoommeer/Topduur_Volkerakzoommeer_BER-VZM.txt +17 -17
- pydra_core/data/statistics/Windrichting/Deelen/Richtingskansen_Deelen_2017.txt +27 -27
- pydra_core/data/statistics/Windrichting/Hollandse Kust/KansenWindrichting_Kust.txt +16 -16
- pydra_core/data/statistics/Windrichting/Hollandse Kust/KansenWindrichting_Kust_2017.txt +23 -23
- pydra_core/data/statistics/Windrichting/Oosterschelde/KansenWindrichting_16sectoren_OS_2023.txt +30 -30
- pydra_core/data/statistics/Windrichting/Oosterschelde/KansenWindrichting_OS.txt +19 -19
- pydra_core/data/statistics/Windrichting/Oosterschelde/KansenWindrichting_OS_2017.txt +23 -23
- pydra_core/data/statistics/Windrichting/Schiphol/Richtingskansen_Schiphol_12sectoren.txt +19 -19
- pydra_core/data/statistics/Windrichting/Schiphol/Richtingskansen_Schiphol_12sectoren_2017.txt +19 -19
- pydra_core/data/statistics/Windrichting/Schiphol/Richtingskansen_Schiphol_2017.txt +27 -27
- pydra_core/data/statistics/Windrichting/Schiphol/kanswindrichting_v01.txt +28 -28
- pydra_core/data/statistics/Windrichting/Waddenzee/KansenWindrichting_WZ.txt +16 -16
- pydra_core/data/statistics/Windrichting/Waddenzee/KansenWindrichting_WZ_2017.txt +23 -23
- pydra_core/data/statistics/Windrichting/Westerschelde/KansenWindrichting_WS.txt +16 -16
- pydra_core/data/statistics/Windrichting/Westerschelde/KansenWindrichting_WS_2017.txt +23 -23
- pydra_core/data/statistics/Windsnelheid/De Kooy/OvkansWindsnelheid_Texel.txt +69 -69
- pydra_core/data/statistics/Windsnelheid/De Kooy/Ovkanswind_de Kooy_2017.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/De Kooy/Ovkanswind_de Kooy_2017_metOnzHeid.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/Deelen/Ovkanswind_Deelen_2017.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Deelen/Ovkanswind_Deelen_2017_metOnzHeid.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Hoek van Holland/OvkansWindsnelheid_Hoek van Holland.txt +69 -69
- pydra_core/data/statistics/Windsnelheid/Hoek van Holland/Ovkanswind_Hoek van Holland_2017.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/Hoek van Holland/Ovkanswind_Hoek van Holland_2017_metOnzHeid.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/IJmuiden/OvkansWindsnelheid_IJmuiden.txt +69 -69
- pydra_core/data/statistics/Windsnelheid/IJmuiden/Ovkanswind_IJmuiden_2017.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/IJmuiden/Ovkanswind_IJmuiden_2017_metOnzHeid.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_12sectoren.txt +50 -50
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_12sectoren_2017.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_12sectoren_2017_metOnzHeid.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_12sectoren_2017_metWindDrag.txt +96 -96
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_12sectoren_2017_metWindDrag_metOnzHeid.txt +96 -96
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_16sectoren_2017_metWindDrag.txt +96 -96
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_16sectoren_2017_metWindDrag_metOnzHeid.txt +96 -96
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_2017.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_2017_metOnzHeid.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_met_Volkerfactor_2017.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_Schiphol_met_Volkerfactor_2017_metOnzHeid.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_schiphol.txt +57 -57
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_schiphol_10%.txt +63 -63
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_schiphol_5%.txt +61 -61
- pydra_core/data/statistics/Windsnelheid/Schiphol/Ovkanswind_schiphol_B_met volker.txt +59 -59
- pydra_core/data/statistics/Windsnelheid/Vlissingen/OvkansWindsnelheid_OS.txt +66 -66
- pydra_core/data/statistics/Windsnelheid/Vlissingen/OvkansWindsnelheid_Vlissingen.txt +69 -69
- pydra_core/data/statistics/Windsnelheid/Vlissingen/Ovkanswind_Vlissingen_16sectoren_2023.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/Vlissingen/Ovkanswind_Vlissingen_16sectoren_2023_metOnzHeid.txt +90 -90
- pydra_core/data/statistics/Windsnelheid/Vlissingen/Ovkanswind_Vlissingen_2017.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/Vlissingen/Ovkanswind_Vlissingen_2017_metOnzHeid.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/Vlissingen/Ovkanswind_Vlissingen_2017_metWindDrag.txt +96 -96
- pydra_core/data/statistics/Windsnelheid/Vlissingen/Ovkanswind_Vlissingen_2017_metWindDrag_metOnzHeid.txt +96 -96
- pydra_core/data/statistics/Windsnelheid/West-Terschelling/OvkansWindsnelheid_West-Tersch.txt +69 -69
- pydra_core/data/statistics/Windsnelheid/West-Terschelling/Ovkanswind_West Terschelling_2017.txt +91 -91
- pydra_core/data/statistics/Windsnelheid/West-Terschelling/Ovkanswind_West Terschelling_2017_metOnzHeid.txt +91 -91
- pydra_core/data/statistics/Zeewaterstand/Delfzijl/CondPovDelfzijl_12u_zichtjaar1985_2017.txt +81 -81
- pydra_core/data/statistics/Zeewaterstand/Delfzijl/CondPovDelfzijl_12u_zichtjaar1985_2017_metOnzHeid.txt +81 -81
- pydra_core/data/statistics/Zeewaterstand/Delfzijl/CondPovDelfzijl_12u_zichtjaar2017.txt +81 -81
- pydra_core/data/statistics/Zeewaterstand/Delfzijl/CondPovDelfzijl_12u_zichtjaar2017_metOnzHeid.txt +81 -81
- pydra_core/data/statistics/Zeewaterstand/Delfzijl/OvkansZee_Delfzijl.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Den Helder/CondPovDenHelder_12u_zichtjaar1985_2017.txt +89 -89
- pydra_core/data/statistics/Zeewaterstand/Den Helder/CondPovDenHelder_12u_zichtjaar1985_2017_metOnzHeid.txt +89 -89
- pydra_core/data/statistics/Zeewaterstand/Den Helder/CondPovDenHelder_12u_zichtjaar2017.txt +88 -88
- pydra_core/data/statistics/Zeewaterstand/Den Helder/CondPovDenHelder_12u_zichtjaar2017_metOnzHeid.txt +88 -88
- pydra_core/data/statistics/Zeewaterstand/Den Helder/OvkansZee_Den Helder.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Den Oever/CondPovDenOeverBuiten_12u_zichtjaar1985_2017.txt +88 -88
- pydra_core/data/statistics/Zeewaterstand/Den Oever/CondPovDenOeverBuiten_12u_zichtjaar1985_2017_metOnzHeid.txt +88 -88
- pydra_core/data/statistics/Zeewaterstand/Den Oever/CondPovDenOeverBuiten_12u_zichtjaar2017.txt +87 -87
- pydra_core/data/statistics/Zeewaterstand/Den Oever/CondPovDenOeverBuiten_12u_zichtjaar2017_metOnzHeid.txt +87 -87
- pydra_core/data/statistics/Zeewaterstand/Den Oever/OvkansZee_Den Oever.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Hansweert/CondPovHansweert_12u_zichtjaar1985_2017.txt +71 -71
- pydra_core/data/statistics/Zeewaterstand/Hansweert/CondPovHansweert_12u_zichtjaar1985_2017_metOnzHeid.txt +71 -71
- pydra_core/data/statistics/Zeewaterstand/Hansweert/CondPovHansweert_12u_zichtjaar2017.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Hansweert/CondPovHansweert_12u_zichtjaar2017_metOnzHeid.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Hansweert/OvkansZee_Hansweert.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Harlingen/CondPovHarlingen_12u_zichtjaar1985_2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Harlingen/CondPovHarlingen_12u_zichtjaar1985_2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Harlingen/CondPovHarlingen_12u_zichtjaar2017.txt +84 -84
- pydra_core/data/statistics/Zeewaterstand/Harlingen/CondPovHarlingen_12u_zichtjaar2017_metOnzHeid.txt +84 -84
- pydra_core/data/statistics/Zeewaterstand/Harlingen/OvkansZee_Harlingen.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Hoek van Holland/CondPovHoekvanHolland_12u_zichtjaar1985_2017.txt +84 -84
- pydra_core/data/statistics/Zeewaterstand/Hoek van Holland/CondPovHoekvanHolland_12u_zichtjaar1985_2017_metOnzHeid.txt +84 -84
- pydra_core/data/statistics/Zeewaterstand/Hoek van Holland/CondPovHoekvanHolland_12u_zichtjaar2017.txt +83 -83
- pydra_core/data/statistics/Zeewaterstand/Hoek van Holland/CondPovHoekvanHolland_12u_zichtjaar2017_metOnzHeid.txt +83 -83
- pydra_core/data/statistics/Zeewaterstand/Hoek van Holland/OvkansZee_Hoek van Holland.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Huibertgat/CondPovHuibertgat_12u_zichtjaar1985_2017.txt +86 -86
- pydra_core/data/statistics/Zeewaterstand/Huibertgat/CondPovHuibertgat_12u_zichtjaar1985_2017_metOnzHeid.txt +86 -86
- pydra_core/data/statistics/Zeewaterstand/Huibertgat/CondPovHuibertgat_12u_zichtjaar2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Huibertgat/CondPovHuibertgat_12u_zichtjaar2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Huibertgat/OvkansZee_Huibertgat.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/IJmuiden/CondPovIJmuiden_12u_zichtjaar1985_2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden/CondPovIJmuiden_12u_zichtjaar1985_2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden/CondPovIJmuiden_12u_zichtjaar2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden/CondPovIJmuiden_12u_zichtjaar2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden/OvkansZee_IJmuiden.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/IJmuiden virtueel/CondPovIJmuiden-Additional_12u_zichtjaar1985_2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden virtueel/CondPovIJmuiden-Additional_12u_zichtjaar1985_2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden virtueel/CondPovIJmuiden-Additional_12u_zichtjaar2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden virtueel/CondPovIJmuiden-Additional_12u_zichtjaar2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/IJmuiden virtueel/OvkansZee_IJmuiden_virtueel.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Lauwersoog/CondPovLauwersoog_12u_zichtjaar1985_2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Lauwersoog/CondPovLauwersoog_12u_zichtjaar1985_2017_metOnzHeid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Lauwersoog/CondPovLauwersoog_12u_zichtjaar2017.txt +84 -84
- pydra_core/data/statistics/Zeewaterstand/Lauwersoog/CondPovLauwersoog_12u_zichtjaar2017_metOnzHeid.txt +84 -84
- pydra_core/data/statistics/Zeewaterstand/Lauwersoog/OvkansZee_Lauwersoog.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Maasmond/CondPovMaasmond_12u_zichtjaar1985_2011.txt +88 -88
- pydra_core/data/statistics/Zeewaterstand/Maasmond/CondPovMaasmond_12u_zichtjaar1985_2017.txt +88 -88
- pydra_core/data/statistics/Zeewaterstand/Maasmond/CondPovMaasmond_12u_zichtjaar1985_2017_metOnzheid.txt +92 -92
- pydra_core/data/statistics/Zeewaterstand/Maasmond/CondPovMaasmond_12u_zichtjaar2017.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Maasmond/CondPovMaasmond_12u_zichtjaar2017_metOnzheid.txt +85 -85
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/CondPovOS11_12u_zichtjaar1985_2017.txt +79 -79
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/CondPovOS11_12u_zichtjaar1985_2017_metOnzHeid.txt +79 -79
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/CondPovOS11_12u_zichtjaar2017.txt +79 -79
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/CondPovOS11_12u_zichtjaar2017_metOnzHeid.txt +79 -79
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/CondPovOS11_16sectoren_12u_2023.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/CondPovOS11_16sectoren_12u_2023_metOnzHeid.txt +73 -73
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/OvkansZee_OS11.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Oosterschelde/OvkansZeewaterstand_OS.txt +71 -71
- pydra_core/data/statistics/Zeewaterstand/Vlissingen/CondPovVlissingen_12u_zichtjaar1985_2017.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen/CondPovVlissingen_12u_zichtjaar1985_2017_metOnzHeid.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen/CondPovVlissingen_12u_zichtjaar2017.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen/CondPovVlissingen_12u_zichtjaar2017_metOnzHeid.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen/OvkansZee_Vlissingen.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/Vlissingen virtueel/CondPovVlissingen-Additional_12u_zichtjaar1985_2017.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen virtueel/CondPovVlissingen-Additional_12u_zichtjaar1985_2017_metOnzHeid.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen virtueel/CondPovVlissingen-Additional_12u_zichtjaar2017.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen virtueel/CondPovVlissingen-Additional_12u_zichtjaar2017_metOnzHeid.txt +74 -74
- pydra_core/data/statistics/Zeewaterstand/Vlissingen virtueel/OvkansZee_Vlissingen_virtueel.txt +70 -70
- pydra_core/data/statistics/Zeewaterstand/West-Terschelling/CondPovWestTerschelling_12u_zichtjaar1985_2017.txt +87 -87
- pydra_core/data/statistics/Zeewaterstand/West-Terschelling/CondPovWestTerschelling_12u_zichtjaar1985_2017_metOnzHeid.txt +87 -87
- pydra_core/data/statistics/Zeewaterstand/West-Terschelling/CondPovWestTerschelling_12u_zichtjaar2017.txt +86 -86
- pydra_core/data/statistics/Zeewaterstand/West-Terschelling/CondPovWestTerschelling_12u_zichtjaar2017_metOnzHeid.txt +86 -86
- pydra_core/data/statistics/Zeewaterstand/West-Terschelling/OvkansZee_West-Terschelling.txt +70 -70
- pydra_core/hrdatabase/hrdatabase.py +177 -177
- pydra_core/io/database_hr.py +598 -598
- pydra_core/io/database_settings.py +183 -183
- pydra_core/io/file_hydranl.py +92 -92
- pydra_core/location/location.py +115 -115
- pydra_core/location/model/base_model.py +270 -270
- pydra_core/location/model/loading/loading.py +368 -368
- pydra_core/location/model/loading/loading_factory.py +89 -89
- pydra_core/location/model/loading/loading_model/loading_model.py +324 -324
- pydra_core/location/model/loading/other_systems/loading_wave_overtopping.py +122 -122
- pydra_core/location/model/loading/water_systems/loading_coast.py +54 -54
- pydra_core/location/model/loading/water_systems/loading_eastern_scheldt.py +169 -169
- pydra_core/location/model/loading/water_systems/loading_ijssel_vechtdelta.py +55 -55
- pydra_core/location/model/loading/water_systems/loading_lake.py +55 -55
- pydra_core/location/model/loading/water_systems/loading_lower_rivier.py +68 -68
- pydra_core/location/model/loading/water_systems/loading_upper_river.py +55 -55
- pydra_core/location/model/statistics/other_systems/statistics_wave_overtopping.py +72 -72
- pydra_core/location/model/statistics/statistics.py +171 -171
- pydra_core/location/model/statistics/statistics_factory.py +89 -89
- pydra_core/location/model/statistics/stochastics/barrier/barrier.py +43 -43
- pydra_core/location/model/statistics/stochastics/barrier/barrier_easternscheldt.py +147 -147
- pydra_core/location/model/statistics/stochastics/barrier/barrier_europoort.py +209 -209
- pydra_core/location/model/statistics/stochastics/barrier/barrier_ramspol.py +41 -41
- pydra_core/location/model/statistics/stochastics/barrier/no_barrier.py +21 -21
- pydra_core/location/model/statistics/stochastics/discharge.py +108 -108
- pydra_core/location/model/statistics/stochastics/discrete_probability.py +55 -55
- pydra_core/location/model/statistics/stochastics/lake_level.py +158 -158
- pydra_core/location/model/statistics/stochastics/model_uncertainty.py +358 -358
- pydra_core/location/model/statistics/stochastics/sea_level/sea_level.py +53 -53
- pydra_core/location/model/statistics/stochastics/sea_level/sea_level_lower_river.py +93 -93
- pydra_core/location/model/statistics/stochastics/sea_level/sea_level_point.py +65 -65
- pydra_core/location/model/statistics/stochastics/sea_level/sea_level_triangular.py +158 -158
- pydra_core/location/model/statistics/stochastics/sigma_function.py +24 -24
- pydra_core/location/model/statistics/stochastics/wave_shape.py +624 -624
- pydra_core/location/model/statistics/stochastics/wind_speed.py +196 -196
- pydra_core/location/model/statistics/water_systems/statistics_coast.py +153 -153
- pydra_core/location/model/statistics/water_systems/statistics_eastern_scheldt.py +177 -177
- pydra_core/location/model/statistics/water_systems/statistics_ijssel_vechtdelta.py +229 -229
- pydra_core/location/model/statistics/water_systems/statistics_lake.py +86 -86
- pydra_core/location/model/statistics/water_systems/statistics_lower_river.py +321 -321
- pydra_core/location/model/statistics/water_systems/statistics_upper_river.py +86 -86
- pydra_core/location/model/water_system.py +249 -249
- pydra_core/location/model/wave_overtopping.py +25 -25
- pydra_core/location/profile/foreland.py +246 -246
- pydra_core/location/profile/lib/README.MD +10 -10
- pydra_core/location/profile/profile.py +971 -971
- pydra_core/location/profile/profile_loading.py +473 -473
- pydra_core/location/settings/settings.py +387 -387
- {pydra_core-0.0.1.dist-info → pydra_core-0.0.2.dist-info}/METADATA +18 -3
- pydra_core-0.0.2.dist-info/RECORD +389 -0
- pydra_core-0.0.1.dist-info/RECORD +0 -389
- {pydra_core-0.0.1.dist-info → pydra_core-0.0.2.dist-info}/WHEEL +0 -0
pydra_core/common/interpolate.py
CHANGED
@@ -1,345 +1,345 @@
|
|
1
|
-
import numpy as np
|
2
|
-
|
3
|
-
|
4
|
-
class Interpolate:
|
5
|
-
"""
|
6
|
-
A class with common functions used for interpolation.
|
7
|
-
"""
|
8
|
-
|
9
|
-
@staticmethod
|
10
|
-
def inextrp1d(x, xp, fp):
|
11
|
-
"""
|
12
|
-
Interpolate an array along the given axis.
|
13
|
-
Similar to np.interp, but with extrapolation outside range.
|
14
|
-
|
15
|
-
Parameters
|
16
|
-
----------
|
17
|
-
x : np.array
|
18
|
-
Array with positions to interpolate at
|
19
|
-
xp : np.array
|
20
|
-
Array with positions of known values
|
21
|
-
fp : np.array
|
22
|
-
Array with values as known positions to interpolate between
|
23
|
-
|
24
|
-
Returns
|
25
|
-
-------
|
26
|
-
np.array
|
27
|
-
interpolated array
|
28
|
-
"""
|
29
|
-
# Determine lower bounds
|
30
|
-
intidx = np.minimum(np.maximum(0, np.searchsorted(xp, x) - 1), len(xp) - 2)
|
31
|
-
|
32
|
-
# Determine interpolation fractions
|
33
|
-
fracs = (x - xp[intidx]) / (xp[intidx + 1] - xp[intidx])
|
34
|
-
|
35
|
-
# Interpolate (1-frac) * f_low + frac * f_up
|
36
|
-
f = (1 - fracs) * fp[intidx] + fp[intidx + 1] * fracs
|
37
|
-
|
38
|
-
return f
|
39
|
-
|
40
|
-
@staticmethod
|
41
|
-
def inextrp1d_log_probability(
|
42
|
-
x: np.ndarray, xp: np.ndarray, fp: np.ndarray
|
43
|
-
) -> np.ndarray:
|
44
|
-
"""
|
45
|
-
Perform 1D log-interpolation of log-probability values using piecewise
|
46
|
-
linear interpolation.
|
47
|
-
|
48
|
-
This function interpolates log-probability values for input points 'x'
|
49
|
-
using a given set of log-probabilities 'fp' and corresponding
|
50
|
-
probabilities 'xp'. The interpolation is performed in a piecewise
|
51
|
-
manner, taking into account the logarithmic nature of the data.
|
52
|
-
|
53
|
-
Parameters
|
54
|
-
----------
|
55
|
-
x : np.ndarray
|
56
|
-
Input points at which log-probabilities are to be interpolated.
|
57
|
-
xp : np.ndarray
|
58
|
-
Known data points representing the probabilities.
|
59
|
-
fp : np.ndarray
|
60
|
-
Log-probabilities corresponding to the known data points 'xp'.
|
61
|
-
|
62
|
-
Returns
|
63
|
-
-------
|
64
|
-
np.ndarray
|
65
|
-
Interpolated log-probability values for the input points 'x'.
|
66
|
-
|
67
|
-
Raises:
|
68
|
-
ValueError: If the provided xp values (probabilities) are not
|
69
|
-
monotonically increasing.
|
70
|
-
|
71
|
-
Notes
|
72
|
-
-----
|
73
|
-
- The input array 'xp' should be strictly increasing; otherwise, a
|
74
|
-
ValueError is raised.
|
75
|
-
"""
|
76
|
-
# Check whether the probabilities are monotonically decreasing
|
77
|
-
if not (np.diff(xp) >= 0.0).all():
|
78
|
-
raise ValueError(
|
79
|
-
"[ERROR] xp-values are not monotonically increasing or decreasing"
|
80
|
-
)
|
81
|
-
|
82
|
-
# Determine lower bounds
|
83
|
-
intidx = np.minimum(np.maximum(0, np.searchsorted(xp, x) - 1), len(xp) - 2)
|
84
|
-
|
85
|
-
# Split in log and linear part
|
86
|
-
iszero = xp[intidx] == 0.0
|
87
|
-
intidx_log = intidx[~iszero]
|
88
|
-
intidx_lin = intidx[iszero]
|
89
|
-
|
90
|
-
# Determine interpolation fractions
|
91
|
-
fracs = np.zeros(len(x), dtype=float)
|
92
|
-
fracs[~iszero] = (np.log(x[~iszero]) - np.log(xp[intidx_log])) / (
|
93
|
-
np.log(xp[intidx_log + 1]) - np.log(xp[intidx_log])
|
94
|
-
)
|
95
|
-
fracs[iszero] = (x[iszero] - xp[intidx_lin]) / (
|
96
|
-
xp[intidx_lin + 1] - xp[intidx_lin]
|
97
|
-
)
|
98
|
-
|
99
|
-
# Interpolate (1-frac) * f_low + frac * f_up
|
100
|
-
f = (1 - fracs) * fp[intidx] + fp[intidx + 1] * fracs
|
101
|
-
|
102
|
-
return f
|
103
|
-
|
104
|
-
@staticmethod
|
105
|
-
def triangular_interpolation(
|
106
|
-
x1: float,
|
107
|
-
y1: float,
|
108
|
-
h1: float,
|
109
|
-
x2: float,
|
110
|
-
y2: float,
|
111
|
-
h2: float,
|
112
|
-
x3: float,
|
113
|
-
y3: float,
|
114
|
-
h3: float,
|
115
|
-
x: float,
|
116
|
-
y: float,
|
117
|
-
) -> float:
|
118
|
-
"""
|
119
|
-
Performs triangular interpolation to calculate the parameter value
|
120
|
-
(water level) at a given point within a triangle.
|
121
|
-
|
122
|
-
Parameters
|
123
|
-
----------
|
124
|
-
x1 : float
|
125
|
-
X-coordinate of the first input location.
|
126
|
-
y1 : float
|
127
|
-
Y-coordinate of the first input location.
|
128
|
-
h1 : float
|
129
|
-
Parameter value (water level) at the first input location.
|
130
|
-
x2 : float
|
131
|
-
X-coordinate of the second input location.
|
132
|
-
y2 : float
|
133
|
-
Y-coordinate of the second input location.
|
134
|
-
h2 : float
|
135
|
-
Parameter value (water level) at the second input location.
|
136
|
-
x3 : float
|
137
|
-
X-coordinate of the third input location.
|
138
|
-
y3 : float
|
139
|
-
Y-coordinate of the third input location.
|
140
|
-
h3 : float
|
141
|
-
Parameter value (water level) at the third input location.
|
142
|
-
x : float
|
143
|
-
X-coordinate of the point to interpolate.
|
144
|
-
y : float
|
145
|
-
Y-coordinate of the point to interpolate.
|
146
|
-
|
147
|
-
Returns
|
148
|
-
-------
|
149
|
-
float
|
150
|
-
The interpolated parameter value (water level) at the given point.
|
151
|
-
"""
|
152
|
-
# Check if the input locations are invalid
|
153
|
-
if (
|
154
|
-
(x1 == x2 and y1 == y2)
|
155
|
-
or (x1 == x3 and y1 == y3)
|
156
|
-
or (x2 == x3 and y2 == y3)
|
157
|
-
):
|
158
|
-
raise ValueError(
|
159
|
-
"[ERROR] Two input locations in triangle interpolation are exactly the same. This is not allowed."
|
160
|
-
)
|
161
|
-
if (x1 == x2 == x3) or (y1 == y2 == y3):
|
162
|
-
raise ValueError(
|
163
|
-
"[ERROR] The three input locations in triangle interpolation are collinear. This is not allowed."
|
164
|
-
)
|
165
|
-
|
166
|
-
# Check if the locations are on the same line
|
167
|
-
a_1 = (y1 - y2) / (x1 - x2)
|
168
|
-
b_1 = y1 - a_1 * x1
|
169
|
-
a_2 = (y3 - y2) / (x3 - x2)
|
170
|
-
b_2 = y3 - a_1 * x3
|
171
|
-
if (a_1 == a_2) and (b_1 == b_2):
|
172
|
-
raise ValueError(
|
173
|
-
"[ERROR] The three input locations in triangle interpolation are collinear. This is not allowed."
|
174
|
-
)
|
175
|
-
|
176
|
-
# Calculate auxiliary parameter a
|
177
|
-
a = x1 * (y2 - y3) - x2 * (y1 - y3) + x3 * (y1 - y2)
|
178
|
-
|
179
|
-
# Parameter a should not be equal to 0
|
180
|
-
if a == 0.0:
|
181
|
-
raise ValueError(
|
182
|
-
"[ERROR] In triangle interpolation, there is an auxiliary parameter (a) that should not be equal to 0, but it is currently set to 0."
|
183
|
-
)
|
184
|
-
|
185
|
-
# Calculate parameters B1, B2 en B3
|
186
|
-
b1 = h1 * (y2 - y3) - h2 * (y1 - y3) + h3 * (y1 - y2)
|
187
|
-
b2 = x1 * (h2 - h3) - x2 * (h1 - h3) + x3 * (h1 - h2)
|
188
|
-
b3 = (
|
189
|
-
x1 * (y2 * h3 - y3 * h2)
|
190
|
-
- x2 * (y1 * h3 - y3 * h1)
|
191
|
-
+ x3 * (y1 * h2 - y2 * h1)
|
192
|
-
)
|
193
|
-
|
194
|
-
# Calculate the value at (x, y) using the triangular interpolation
|
195
|
-
triangular_interp = (b1 / a) * x + (b2 / a) * y + b3 / a
|
196
|
-
return triangular_interp
|
197
|
-
|
198
|
-
|
199
|
-
class InterpStruct:
|
200
|
-
"""
|
201
|
-
Interpolation helper class.
|
202
|
-
|
203
|
-
This class provides functionality for 1D interpolation of arrays along a
|
204
|
-
specified axis. It is designed to interpolate arrays using piecewise linear
|
205
|
-
interpolation based on provided data points.
|
206
|
-
"""
|
207
|
-
|
208
|
-
def __init__(self, x: np.ndarray, xp: np.ndarray):
|
209
|
-
"""
|
210
|
-
Initialize the InterpStruct object and calculate interpolation factors.
|
211
|
-
|
212
|
-
This method is used internally to calculate interpolation factors based
|
213
|
-
on given data points 'x' and 'xp'. It sets the 'xp', 'x', 'intidx', and
|
214
|
-
'fracs' attributes of the InterpStruct object.
|
215
|
-
|
216
|
-
Parameters
|
217
|
-
----------
|
218
|
-
x : np.ndarray
|
219
|
-
Input data points used for interpolation.
|
220
|
-
xp : np.ndarray
|
221
|
-
Known data points representing the interpolation axis.
|
222
|
-
"""
|
223
|
-
self.xp = np.asarray(xp)
|
224
|
-
self.x = np.asarray(x)
|
225
|
-
self.intidx = np.minimum(
|
226
|
-
np.maximum(0, np.searchsorted(self.xp, self.x) - 1), len(self.xp) - 2
|
227
|
-
)
|
228
|
-
self.fracs = (self.x - self.xp[self.intidx]) / (
|
229
|
-
self.xp[self.intidx + 1] - self.xp[self.intidx]
|
230
|
-
)
|
231
|
-
|
232
|
-
def interp(
|
233
|
-
self,
|
234
|
-
fp: np.ndarray,
|
235
|
-
axis: int = 0,
|
236
|
-
extrapolate: bool = True,
|
237
|
-
left: bool = None,
|
238
|
-
right: bool = None,
|
239
|
-
):
|
240
|
-
"""
|
241
|
-
Interpolate a (multidimensional) array along the given axis using
|
242
|
-
piecewise linear interpolation.
|
243
|
-
|
244
|
-
Parameters
|
245
|
-
----------
|
246
|
-
fp : np.ndarray
|
247
|
-
Array with values to interpolate.
|
248
|
-
axis : int, optional
|
249
|
-
Axis along which the interpolation is performed (default is 0).
|
250
|
-
extrapolate : bool, optional
|
251
|
-
If True, allow extrapolation of values outside the range of 'xp'.
|
252
|
-
If False, set the values outside the interpolation range to NaN
|
253
|
-
(default is True).
|
254
|
-
left : float or None, optional
|
255
|
-
Value to use for extrapolation on the left side. If None, the left
|
256
|
-
extrapolation will result in NaN (default is None).
|
257
|
-
right : float or None, optional:
|
258
|
-
Value to use for extrapolation on the right side. If None, the
|
259
|
-
right extrapolation will result in NaN (default is None).
|
260
|
-
|
261
|
-
Returns
|
262
|
-
-------
|
263
|
-
ndarray
|
264
|
-
Interpolated multidimensional array.
|
265
|
-
|
266
|
-
Raises
|
267
|
-
------
|
268
|
-
ValueError: If the given axis is higher than the dimensions of the
|
269
|
-
'fp' array.
|
270
|
-
"""
|
271
|
-
# Convert to array if needed
|
272
|
-
if isinstance(fp, list):
|
273
|
-
fp = np.asarray(fp)
|
274
|
-
|
275
|
-
# Check given axis and fp shape
|
276
|
-
if axis > fp.ndim - 1:
|
277
|
-
raise ValueError(
|
278
|
-
f"Given axis ({axis}) is higher than dimensions of fp array ({fp.ndim})."
|
279
|
-
)
|
280
|
-
|
281
|
-
# Create shape with all ones, except for the array which is used for
|
282
|
-
# interpolation
|
283
|
-
shape = [1] * fp.ndim
|
284
|
-
shape[axis] = len(self.fracs)
|
285
|
-
|
286
|
-
# Interpolate (1-frac) * f_low + frac * f_up
|
287
|
-
f = (1 - self.fracs.reshape(shape)) * np.take(
|
288
|
-
fp, self.intidx, axis=axis
|
289
|
-
) + np.take(fp, self.intidx + 1, axis=axis) * self.fracs.reshape(shape)
|
290
|
-
|
291
|
-
# If 'extrapolate' is False, set values outside the interpolation range
|
292
|
-
# to NaN or the specified values
|
293
|
-
if not extrapolate:
|
294
|
-
if left is not None:
|
295
|
-
f[(self.x < self.xp[0])] = left
|
296
|
-
else:
|
297
|
-
f[(self.x < self.xp[0])] = np.nan
|
298
|
-
if right is not None:
|
299
|
-
f[(self.x > self.xp[-1])] = right
|
300
|
-
else:
|
301
|
-
f[(self.x > self.xp[-1])] = np.nan
|
302
|
-
|
303
|
-
return f
|
304
|
-
|
305
|
-
def interp_angle(
|
306
|
-
self, fp: np.ndarray, axis: int = 0, extrapolate: bool = True
|
307
|
-
) -> np.ndarray:
|
308
|
-
"""
|
309
|
-
Interpolate angles (in degrees) using piecewise linear interpolation.
|
310
|
-
|
311
|
-
This function performs interpolation of angles represented by 'fp'
|
312
|
-
using piecewise linear interpolation. The angles are given in degrees
|
313
|
-
and can be provided as a 1D or 2D array.
|
314
|
-
|
315
|
-
Parameters
|
316
|
-
----------
|
317
|
-
fp : np.ndarray
|
318
|
-
Input angles (in degrees) to be interpolated.
|
319
|
-
axis : int, optional
|
320
|
-
The axis along which the interpolation is performed (default is 0).
|
321
|
-
extrapolate : bool, optional
|
322
|
-
If True, allow extrapolation of values outside the range of
|
323
|
-
'self.xp'. If False, set the angles outside the interpolation
|
324
|
-
range to NaN (default is True).
|
325
|
-
|
326
|
-
Returns
|
327
|
-
-------
|
328
|
-
np.ndarray
|
329
|
-
Interpolated angles in degrees.
|
330
|
-
"""
|
331
|
-
# Convert angles from degrees to cosine and sine values and perform
|
332
|
-
# interpolation along the specified 'axis'
|
333
|
-
xint = self.interp(np.cos(np.radians(fp)), axis=axis)
|
334
|
-
yint = self.interp(np.sin(np.radians(fp)), axis=axis)
|
335
|
-
|
336
|
-
# Compute the interpolated angle in degrees using arctan2 and wrap it
|
337
|
-
# to the range [0, 360)
|
338
|
-
f = np.degrees(np.arctan2(yint, xint)) % 360
|
339
|
-
|
340
|
-
# If 'extrapolate' is False, set angles outside the interpolation range
|
341
|
-
# to NaN
|
342
|
-
if not extrapolate:
|
343
|
-
f[(self.x < self.xp[0]) | (self.x > self.xp[-1])] = np.nan
|
344
|
-
|
345
|
-
return f
|
1
|
+
import numpy as np
|
2
|
+
|
3
|
+
|
4
|
+
class Interpolate:
|
5
|
+
"""
|
6
|
+
A class with common functions used for interpolation.
|
7
|
+
"""
|
8
|
+
|
9
|
+
@staticmethod
|
10
|
+
def inextrp1d(x, xp, fp):
|
11
|
+
"""
|
12
|
+
Interpolate an array along the given axis.
|
13
|
+
Similar to np.interp, but with extrapolation outside range.
|
14
|
+
|
15
|
+
Parameters
|
16
|
+
----------
|
17
|
+
x : np.array
|
18
|
+
Array with positions to interpolate at
|
19
|
+
xp : np.array
|
20
|
+
Array with positions of known values
|
21
|
+
fp : np.array
|
22
|
+
Array with values as known positions to interpolate between
|
23
|
+
|
24
|
+
Returns
|
25
|
+
-------
|
26
|
+
np.array
|
27
|
+
interpolated array
|
28
|
+
"""
|
29
|
+
# Determine lower bounds
|
30
|
+
intidx = np.minimum(np.maximum(0, np.searchsorted(xp, x) - 1), len(xp) - 2)
|
31
|
+
|
32
|
+
# Determine interpolation fractions
|
33
|
+
fracs = (x - xp[intidx]) / (xp[intidx + 1] - xp[intidx])
|
34
|
+
|
35
|
+
# Interpolate (1-frac) * f_low + frac * f_up
|
36
|
+
f = (1 - fracs) * fp[intidx] + fp[intidx + 1] * fracs
|
37
|
+
|
38
|
+
return f
|
39
|
+
|
40
|
+
@staticmethod
|
41
|
+
def inextrp1d_log_probability(
|
42
|
+
x: np.ndarray, xp: np.ndarray, fp: np.ndarray
|
43
|
+
) -> np.ndarray:
|
44
|
+
"""
|
45
|
+
Perform 1D log-interpolation of log-probability values using piecewise
|
46
|
+
linear interpolation.
|
47
|
+
|
48
|
+
This function interpolates log-probability values for input points 'x'
|
49
|
+
using a given set of log-probabilities 'fp' and corresponding
|
50
|
+
probabilities 'xp'. The interpolation is performed in a piecewise
|
51
|
+
manner, taking into account the logarithmic nature of the data.
|
52
|
+
|
53
|
+
Parameters
|
54
|
+
----------
|
55
|
+
x : np.ndarray
|
56
|
+
Input points at which log-probabilities are to be interpolated.
|
57
|
+
xp : np.ndarray
|
58
|
+
Known data points representing the probabilities.
|
59
|
+
fp : np.ndarray
|
60
|
+
Log-probabilities corresponding to the known data points 'xp'.
|
61
|
+
|
62
|
+
Returns
|
63
|
+
-------
|
64
|
+
np.ndarray
|
65
|
+
Interpolated log-probability values for the input points 'x'.
|
66
|
+
|
67
|
+
Raises:
|
68
|
+
ValueError: If the provided xp values (probabilities) are not
|
69
|
+
monotonically increasing.
|
70
|
+
|
71
|
+
Notes
|
72
|
+
-----
|
73
|
+
- The input array 'xp' should be strictly increasing; otherwise, a
|
74
|
+
ValueError is raised.
|
75
|
+
"""
|
76
|
+
# Check whether the probabilities are monotonically decreasing
|
77
|
+
if not (np.diff(xp) >= 0.0).all():
|
78
|
+
raise ValueError(
|
79
|
+
"[ERROR] xp-values are not monotonically increasing or decreasing"
|
80
|
+
)
|
81
|
+
|
82
|
+
# Determine lower bounds
|
83
|
+
intidx = np.minimum(np.maximum(0, np.searchsorted(xp, x) - 1), len(xp) - 2)
|
84
|
+
|
85
|
+
# Split in log and linear part
|
86
|
+
iszero = xp[intidx] == 0.0
|
87
|
+
intidx_log = intidx[~iszero]
|
88
|
+
intidx_lin = intidx[iszero]
|
89
|
+
|
90
|
+
# Determine interpolation fractions
|
91
|
+
fracs = np.zeros(len(x), dtype=float)
|
92
|
+
fracs[~iszero] = (np.log(x[~iszero]) - np.log(xp[intidx_log])) / (
|
93
|
+
np.log(xp[intidx_log + 1]) - np.log(xp[intidx_log])
|
94
|
+
)
|
95
|
+
fracs[iszero] = (x[iszero] - xp[intidx_lin]) / (
|
96
|
+
xp[intidx_lin + 1] - xp[intidx_lin]
|
97
|
+
)
|
98
|
+
|
99
|
+
# Interpolate (1-frac) * f_low + frac * f_up
|
100
|
+
f = (1 - fracs) * fp[intidx] + fp[intidx + 1] * fracs
|
101
|
+
|
102
|
+
return f
|
103
|
+
|
104
|
+
@staticmethod
|
105
|
+
def triangular_interpolation(
|
106
|
+
x1: float,
|
107
|
+
y1: float,
|
108
|
+
h1: float,
|
109
|
+
x2: float,
|
110
|
+
y2: float,
|
111
|
+
h2: float,
|
112
|
+
x3: float,
|
113
|
+
y3: float,
|
114
|
+
h3: float,
|
115
|
+
x: float,
|
116
|
+
y: float,
|
117
|
+
) -> float:
|
118
|
+
"""
|
119
|
+
Performs triangular interpolation to calculate the parameter value
|
120
|
+
(water level) at a given point within a triangle.
|
121
|
+
|
122
|
+
Parameters
|
123
|
+
----------
|
124
|
+
x1 : float
|
125
|
+
X-coordinate of the first input location.
|
126
|
+
y1 : float
|
127
|
+
Y-coordinate of the first input location.
|
128
|
+
h1 : float
|
129
|
+
Parameter value (water level) at the first input location.
|
130
|
+
x2 : float
|
131
|
+
X-coordinate of the second input location.
|
132
|
+
y2 : float
|
133
|
+
Y-coordinate of the second input location.
|
134
|
+
h2 : float
|
135
|
+
Parameter value (water level) at the second input location.
|
136
|
+
x3 : float
|
137
|
+
X-coordinate of the third input location.
|
138
|
+
y3 : float
|
139
|
+
Y-coordinate of the third input location.
|
140
|
+
h3 : float
|
141
|
+
Parameter value (water level) at the third input location.
|
142
|
+
x : float
|
143
|
+
X-coordinate of the point to interpolate.
|
144
|
+
y : float
|
145
|
+
Y-coordinate of the point to interpolate.
|
146
|
+
|
147
|
+
Returns
|
148
|
+
-------
|
149
|
+
float
|
150
|
+
The interpolated parameter value (water level) at the given point.
|
151
|
+
"""
|
152
|
+
# Check if the input locations are invalid
|
153
|
+
if (
|
154
|
+
(x1 == x2 and y1 == y2)
|
155
|
+
or (x1 == x3 and y1 == y3)
|
156
|
+
or (x2 == x3 and y2 == y3)
|
157
|
+
):
|
158
|
+
raise ValueError(
|
159
|
+
"[ERROR] Two input locations in triangle interpolation are exactly the same. This is not allowed."
|
160
|
+
)
|
161
|
+
if (x1 == x2 == x3) or (y1 == y2 == y3):
|
162
|
+
raise ValueError(
|
163
|
+
"[ERROR] The three input locations in triangle interpolation are collinear. This is not allowed."
|
164
|
+
)
|
165
|
+
|
166
|
+
# Check if the locations are on the same line
|
167
|
+
a_1 = (y1 - y2) / (x1 - x2)
|
168
|
+
b_1 = y1 - a_1 * x1
|
169
|
+
a_2 = (y3 - y2) / (x3 - x2)
|
170
|
+
b_2 = y3 - a_1 * x3
|
171
|
+
if (a_1 == a_2) and (b_1 == b_2):
|
172
|
+
raise ValueError(
|
173
|
+
"[ERROR] The three input locations in triangle interpolation are collinear. This is not allowed."
|
174
|
+
)
|
175
|
+
|
176
|
+
# Calculate auxiliary parameter a
|
177
|
+
a = x1 * (y2 - y3) - x2 * (y1 - y3) + x3 * (y1 - y2)
|
178
|
+
|
179
|
+
# Parameter a should not be equal to 0
|
180
|
+
if a == 0.0:
|
181
|
+
raise ValueError(
|
182
|
+
"[ERROR] In triangle interpolation, there is an auxiliary parameter (a) that should not be equal to 0, but it is currently set to 0."
|
183
|
+
)
|
184
|
+
|
185
|
+
# Calculate parameters B1, B2 en B3
|
186
|
+
b1 = h1 * (y2 - y3) - h2 * (y1 - y3) + h3 * (y1 - y2)
|
187
|
+
b2 = x1 * (h2 - h3) - x2 * (h1 - h3) + x3 * (h1 - h2)
|
188
|
+
b3 = (
|
189
|
+
x1 * (y2 * h3 - y3 * h2)
|
190
|
+
- x2 * (y1 * h3 - y3 * h1)
|
191
|
+
+ x3 * (y1 * h2 - y2 * h1)
|
192
|
+
)
|
193
|
+
|
194
|
+
# Calculate the value at (x, y) using the triangular interpolation
|
195
|
+
triangular_interp = (b1 / a) * x + (b2 / a) * y + b3 / a
|
196
|
+
return triangular_interp
|
197
|
+
|
198
|
+
|
199
|
+
class InterpStruct:
|
200
|
+
"""
|
201
|
+
Interpolation helper class.
|
202
|
+
|
203
|
+
This class provides functionality for 1D interpolation of arrays along a
|
204
|
+
specified axis. It is designed to interpolate arrays using piecewise linear
|
205
|
+
interpolation based on provided data points.
|
206
|
+
"""
|
207
|
+
|
208
|
+
def __init__(self, x: np.ndarray, xp: np.ndarray):
|
209
|
+
"""
|
210
|
+
Initialize the InterpStruct object and calculate interpolation factors.
|
211
|
+
|
212
|
+
This method is used internally to calculate interpolation factors based
|
213
|
+
on given data points 'x' and 'xp'. It sets the 'xp', 'x', 'intidx', and
|
214
|
+
'fracs' attributes of the InterpStruct object.
|
215
|
+
|
216
|
+
Parameters
|
217
|
+
----------
|
218
|
+
x : np.ndarray
|
219
|
+
Input data points used for interpolation.
|
220
|
+
xp : np.ndarray
|
221
|
+
Known data points representing the interpolation axis.
|
222
|
+
"""
|
223
|
+
self.xp = np.asarray(xp)
|
224
|
+
self.x = np.asarray(x)
|
225
|
+
self.intidx = np.minimum(
|
226
|
+
np.maximum(0, np.searchsorted(self.xp, self.x) - 1), len(self.xp) - 2
|
227
|
+
)
|
228
|
+
self.fracs = (self.x - self.xp[self.intidx]) / (
|
229
|
+
self.xp[self.intidx + 1] - self.xp[self.intidx]
|
230
|
+
)
|
231
|
+
|
232
|
+
def interp(
|
233
|
+
self,
|
234
|
+
fp: np.ndarray,
|
235
|
+
axis: int = 0,
|
236
|
+
extrapolate: bool = True,
|
237
|
+
left: bool = None,
|
238
|
+
right: bool = None,
|
239
|
+
):
|
240
|
+
"""
|
241
|
+
Interpolate a (multidimensional) array along the given axis using
|
242
|
+
piecewise linear interpolation.
|
243
|
+
|
244
|
+
Parameters
|
245
|
+
----------
|
246
|
+
fp : np.ndarray
|
247
|
+
Array with values to interpolate.
|
248
|
+
axis : int, optional
|
249
|
+
Axis along which the interpolation is performed (default is 0).
|
250
|
+
extrapolate : bool, optional
|
251
|
+
If True, allow extrapolation of values outside the range of 'xp'.
|
252
|
+
If False, set the values outside the interpolation range to NaN
|
253
|
+
(default is True).
|
254
|
+
left : float or None, optional
|
255
|
+
Value to use for extrapolation on the left side. If None, the left
|
256
|
+
extrapolation will result in NaN (default is None).
|
257
|
+
right : float or None, optional:
|
258
|
+
Value to use for extrapolation on the right side. If None, the
|
259
|
+
right extrapolation will result in NaN (default is None).
|
260
|
+
|
261
|
+
Returns
|
262
|
+
-------
|
263
|
+
ndarray
|
264
|
+
Interpolated multidimensional array.
|
265
|
+
|
266
|
+
Raises
|
267
|
+
------
|
268
|
+
ValueError: If the given axis is higher than the dimensions of the
|
269
|
+
'fp' array.
|
270
|
+
"""
|
271
|
+
# Convert to array if needed
|
272
|
+
if isinstance(fp, list):
|
273
|
+
fp = np.asarray(fp)
|
274
|
+
|
275
|
+
# Check given axis and fp shape
|
276
|
+
if axis > fp.ndim - 1:
|
277
|
+
raise ValueError(
|
278
|
+
f"Given axis ({axis}) is higher than dimensions of fp array ({fp.ndim})."
|
279
|
+
)
|
280
|
+
|
281
|
+
# Create shape with all ones, except for the array which is used for
|
282
|
+
# interpolation
|
283
|
+
shape = [1] * fp.ndim
|
284
|
+
shape[axis] = len(self.fracs)
|
285
|
+
|
286
|
+
# Interpolate (1-frac) * f_low + frac * f_up
|
287
|
+
f = (1 - self.fracs.reshape(shape)) * np.take(
|
288
|
+
fp, self.intidx, axis=axis
|
289
|
+
) + np.take(fp, self.intidx + 1, axis=axis) * self.fracs.reshape(shape)
|
290
|
+
|
291
|
+
# If 'extrapolate' is False, set values outside the interpolation range
|
292
|
+
# to NaN or the specified values
|
293
|
+
if not extrapolate:
|
294
|
+
if left is not None:
|
295
|
+
f[(self.x < self.xp[0])] = left
|
296
|
+
else:
|
297
|
+
f[(self.x < self.xp[0])] = np.nan
|
298
|
+
if right is not None:
|
299
|
+
f[(self.x > self.xp[-1])] = right
|
300
|
+
else:
|
301
|
+
f[(self.x > self.xp[-1])] = np.nan
|
302
|
+
|
303
|
+
return f
|
304
|
+
|
305
|
+
def interp_angle(
|
306
|
+
self, fp: np.ndarray, axis: int = 0, extrapolate: bool = True
|
307
|
+
) -> np.ndarray:
|
308
|
+
"""
|
309
|
+
Interpolate angles (in degrees) using piecewise linear interpolation.
|
310
|
+
|
311
|
+
This function performs interpolation of angles represented by 'fp'
|
312
|
+
using piecewise linear interpolation. The angles are given in degrees
|
313
|
+
and can be provided as a 1D or 2D array.
|
314
|
+
|
315
|
+
Parameters
|
316
|
+
----------
|
317
|
+
fp : np.ndarray
|
318
|
+
Input angles (in degrees) to be interpolated.
|
319
|
+
axis : int, optional
|
320
|
+
The axis along which the interpolation is performed (default is 0).
|
321
|
+
extrapolate : bool, optional
|
322
|
+
If True, allow extrapolation of values outside the range of
|
323
|
+
'self.xp'. If False, set the angles outside the interpolation
|
324
|
+
range to NaN (default is True).
|
325
|
+
|
326
|
+
Returns
|
327
|
+
-------
|
328
|
+
np.ndarray
|
329
|
+
Interpolated angles in degrees.
|
330
|
+
"""
|
331
|
+
# Convert angles from degrees to cosine and sine values and perform
|
332
|
+
# interpolation along the specified 'axis'
|
333
|
+
xint = self.interp(np.cos(np.radians(fp)), axis=axis)
|
334
|
+
yint = self.interp(np.sin(np.radians(fp)), axis=axis)
|
335
|
+
|
336
|
+
# Compute the interpolated angle in degrees using arctan2 and wrap it
|
337
|
+
# to the range [0, 360)
|
338
|
+
f = np.degrees(np.arctan2(yint, xint)) % 360
|
339
|
+
|
340
|
+
# If 'extrapolate' is False, set angles outside the interpolation range
|
341
|
+
# to NaN
|
342
|
+
if not extrapolate:
|
343
|
+
f[(self.x < self.xp[0]) | (self.x > self.xp[-1])] = np.nan
|
344
|
+
|
345
|
+
return f
|