PM-JPL 1.4.1__py3-none-any.whl → 1.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of PM-JPL might be problematic. Click here for more details.
- PMJPL/PMJPL.py +37 -26
- PMJPL/__init__.py +1 -6
- PMJPL/calculate_gamma.py +128 -0
- PMJPL/canopy_aerodynamic_resistance.py +151 -18
- PMJPL/canopy_conductance.py +70 -14
- PMJPL/constants.py +1 -1
- PMJPL/correctance_factor.py +56 -7
- PMJPL/process_daily_ET_table.py +40 -0
- PMJPL/version.py +4 -0
- {pm_jpl-1.4.1.dist-info → pm_jpl-1.5.1.dist-info}/METADATA +8 -2
- pm_jpl-1.5.1.dist-info/RECORD +24 -0
- PMJPL/downscaling/__init__.py +0 -1
- PMJPL/downscaling/downscaling.py +0 -271
- PMJPL/downscaling/linear_downscale.py +0 -71
- PMJPL/evapotranspiration_conversion/__init__.py +0 -1
- PMJPL/evapotranspiration_conversion/evapotranspiration_conversion.py +0 -82
- PMJPL/fwet.py +0 -21
- PMJPL/meteorology_conversion/__init__.py +0 -1
- PMJPL/meteorology_conversion/meteorology_conversion.py +0 -123
- PMJPL/penman_monteith/__init__.py +0 -1
- PMJPL/penman_monteith/penman_monteith.py +0 -19
- PMJPL/priestley_taylor/__init__.py +0 -1
- PMJPL/priestley_taylor/priestley_taylor.py +0 -27
- PMJPL/santanello/__init__.py +0 -1
- PMJPL/santanello/santanello.py +0 -46
- PMJPL/vegetation_conversion/__init__.py +0 -1
- PMJPL/vegetation_conversion/vegetation_conversion.py +0 -47
- PMJPL/version.txt +0 -1
- pm_jpl-1.4.1.dist-info/RECORD +0 -38
- {pm_jpl-1.4.1.dist-info → pm_jpl-1.5.1.dist-info}/WHEEL +0 -0
- {pm_jpl-1.4.1.dist-info → pm_jpl-1.5.1.dist-info}/licenses/LICENSE +0 -0
- {pm_jpl-1.4.1.dist-info → pm_jpl-1.5.1.dist-info}/top_level.txt +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
import numpy as np
|
|
3
|
-
from ..evapotranspiration_conversion.evapotranspiration_conversion import lambda_Jkg_from_Ta_C
|
|
4
|
-
|
|
5
|
-
from rasters import Raster
|
|
6
|
-
|
|
7
|
-
SPECIFIC_HEAT_CAPACITY_AIR = 1013 # J kg-1 K-1, Monteith & Unsworth (2001)
|
|
8
|
-
MOL_WEIGHT_WET_DRY_RATIO_AIR = 0.622
|
|
9
|
-
|
|
10
|
-
def calculate_gamma(
|
|
11
|
-
Ta_C: Union[Raster, np.ndarray],
|
|
12
|
-
Ps_Pa: Union[Raster, np.ndarray],
|
|
13
|
-
Cp_Jkg: Union[Raster, np.ndarray, float] = SPECIFIC_HEAT_CAPACITY_AIR,
|
|
14
|
-
RMW: Union[Raster, np.ndarray, float] = MOL_WEIGHT_WET_DRY_RATIO_AIR) -> Union[Raster, np.ndarray]:
|
|
15
|
-
# calculate latent heat of vaporization (J kg-1)
|
|
16
|
-
lambda_Jkg = lambda_Jkg_from_Ta_C(Ta_C)
|
|
17
|
-
gamma = (Cp_Jkg * Ps_Pa) / (lambda_Jkg * RMW)
|
|
18
|
-
|
|
19
|
-
return gamma
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .priestley_taylor import *
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
import numpy as np
|
|
3
|
-
|
|
4
|
-
from rasters import Raster
|
|
5
|
-
|
|
6
|
-
# psychrometric constant gamma in kiloPascal per degree Celsius
|
|
7
|
-
# same as value for ventilated (Asmann type) psychrometers, with an air movement of some 5 m/s
|
|
8
|
-
# http://www.fao.org/docrep/x0490e/x0490e07.htm
|
|
9
|
-
GAMMA_KPA = 0.0662 # kPa/C
|
|
10
|
-
|
|
11
|
-
# psychrometric constant gamma in Pascal per degree Celsius
|
|
12
|
-
GAMMA_PA = GAMMA_KPA * 1000
|
|
13
|
-
|
|
14
|
-
def delta_kPa_from_Ta_C(Ta_C: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
15
|
-
return 4098 * (0.6108 * np.exp(17.27 * Ta_C / (237.7 + Ta_C))) / (Ta_C + 237.3) ** 2
|
|
16
|
-
|
|
17
|
-
def delta_Pa_from_Ta_C(Ta_C: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
18
|
-
return delta_kPa_from_Ta_C(Ta_C) * 1000
|
|
19
|
-
|
|
20
|
-
def calculate_epsilon(delta: Union[Raster, np.ndarray], gamma: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
21
|
-
return delta / (delta + gamma)
|
|
22
|
-
|
|
23
|
-
def epsilon_from_Ta_C(Ta_C: Union[Raster, np.ndarray], gamma_Pa: Union[Raster, np.ndarray, float] = GAMMA_PA) -> Union[Raster, np.ndarray]:
|
|
24
|
-
delta_Pa = delta_Pa_from_Ta_C(Ta_C)
|
|
25
|
-
epsilon = calculate_epsilon(delta=delta_Pa, gamma=gamma_Pa)
|
|
26
|
-
|
|
27
|
-
return epsilon
|
PMJPL/santanello/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .santanello import *
|
PMJPL/santanello/santanello.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
import numpy as np
|
|
3
|
-
|
|
4
|
-
import rasters as rt
|
|
5
|
-
from rasters import Raster
|
|
6
|
-
|
|
7
|
-
def calculate_soil_heat_flux(
|
|
8
|
-
seconds_of_day: Union[Raster, np.ndarray],
|
|
9
|
-
Rn: Union[Raster, np.ndarray],
|
|
10
|
-
SM: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
11
|
-
"""
|
|
12
|
-
This function calculates the soil heat flux (G) based on the method proposed by Santanello and Friedl (2003).
|
|
13
|
-
The method estimates G as a function of time of day, net radiation (Rn), and soil moisture (SM).
|
|
14
|
-
|
|
15
|
-
Parameters:
|
|
16
|
-
seconds_of_day (np.ndarray): Time in seconds of the day since midnight
|
|
17
|
-
Rn (np.ndarray): Net radiation in W/m^2
|
|
18
|
-
SM (np.ndarray): Soil moisture in m^3/m^3
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
G (np.ndarray): Soil heat flux in W/m^2
|
|
22
|
-
|
|
23
|
-
Reference:
|
|
24
|
-
Santanello, J. A., & Friedl, M. A. (2003). Diurnal covariation in soil heat flux and net radiation. Journal of Applied Meteorology, 42(6), 851-862.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
# Constants for wet and dry surface conditions
|
|
28
|
-
cgMIN = 0.05 # for wet surface
|
|
29
|
-
cgMAX = 0.35 # for dry surface
|
|
30
|
-
tgMIN = 74000 # for wet surface
|
|
31
|
-
tgMAX = 100000 # for dry surface
|
|
32
|
-
|
|
33
|
-
# Solar noon in seconds
|
|
34
|
-
solNooN = 12 * 60 * 60
|
|
35
|
-
tg0 = solNooN - seconds_of_day
|
|
36
|
-
|
|
37
|
-
# Estimating soil heat flux (G) according to Santanello and Friedl (2003)
|
|
38
|
-
cg = (1 - SM) * cgMAX + SM * cgMIN
|
|
39
|
-
tg = (1 - SM) * tgMAX + SM * tgMIN
|
|
40
|
-
|
|
41
|
-
G = Rn * cg * np.cos(2 * np.pi * (tg0 + 10800) / tg)
|
|
42
|
-
|
|
43
|
-
# Adjusting G for negative net radiation
|
|
44
|
-
G = rt.where(Rn < 0, -G, G)
|
|
45
|
-
|
|
46
|
-
return G
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .vegetation_conversion import *
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
import numpy as np
|
|
3
|
-
import rasters as rt
|
|
4
|
-
from rasters import Raster
|
|
5
|
-
|
|
6
|
-
KPAR = 0.5
|
|
7
|
-
MIN_FIPAR = 0.0
|
|
8
|
-
MAX_FIPAR = 1.0
|
|
9
|
-
MIN_LAI = 0.0
|
|
10
|
-
MAX_LAI = 10.0
|
|
11
|
-
|
|
12
|
-
def FVC_from_NDVI(NDVI: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
13
|
-
"""
|
|
14
|
-
Convert Normalized Difference Vegetation Index (NDVI) to Fractional Vegetation Cover (FVC).
|
|
15
|
-
|
|
16
|
-
Parameters:
|
|
17
|
-
NDVI (Union[Raster, np.ndarray]): Input NDVI data.
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
Union[Raster, np.ndarray]: Converted FVC data.
|
|
21
|
-
"""
|
|
22
|
-
NDVIv = 0.52 # +- 0.03
|
|
23
|
-
NDVIs = 0.04 # +- 0.03
|
|
24
|
-
FVC = rt.clip((NDVI - NDVIs) / (NDVIv - NDVIs), 0.0, 1.0)
|
|
25
|
-
|
|
26
|
-
return FVC
|
|
27
|
-
|
|
28
|
-
def LAI_from_NDVI(
|
|
29
|
-
NDVI: Union[Raster, np.ndarray],
|
|
30
|
-
min_fIPAR: float = MIN_FIPAR,
|
|
31
|
-
max_fIPAR: float = MAX_FIPAR,
|
|
32
|
-
min_LAI: float = MIN_LAI,
|
|
33
|
-
max_LAI: float = MAX_LAI) -> Union[Raster, np.ndarray]:
|
|
34
|
-
"""
|
|
35
|
-
Convert Normalized Difference Vegetation Index (NDVI) to Leaf Area Index (LAI).
|
|
36
|
-
|
|
37
|
-
Parameters:
|
|
38
|
-
NDVI (Union[Raster, np.ndarray]): Input NDVI data.
|
|
39
|
-
|
|
40
|
-
Returns:
|
|
41
|
-
Union[Raster, np.ndarray]: Converted LAI data.
|
|
42
|
-
"""
|
|
43
|
-
fIPAR = rt.clip(NDVI - 0.05, min_fIPAR, max_fIPAR)
|
|
44
|
-
fIPAR = np.where(fIPAR == 0, np.nan, fIPAR)
|
|
45
|
-
LAI = rt.clip(-np.log(1 - fIPAR) * (1 / KPAR), min_LAI, max_LAI)
|
|
46
|
-
|
|
47
|
-
return LAI
|
PMJPL/version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.4.1
|
pm_jpl-1.4.1.dist-info/RECORD
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
PMJPL/PMJPL.py,sha256=Uxz_0_Z4KfP8hxvJDwAyVNtiXG2bU71f4ohejz8xMkg,15501
|
|
2
|
-
PMJPL/VPD_factor.py,sha256=ezHMnnMPGNBt6ZTyiwsTEyMr8fwre6JDsHQea68P7T0,970
|
|
3
|
-
PMJPL/__init__.py,sha256=rqFqtI2rLgIxSN3i2J8wZVoT2EpHYgVizfZt8ctwqsc,213
|
|
4
|
-
PMJPL/canopy_aerodynamic_resistance.py,sha256=lhK1JYGh0J7AiC-fJ-WWrR_nEgH3g5fdJs_BHFee-8o,1217
|
|
5
|
-
PMJPL/canopy_conductance.py,sha256=sSgHJTbyDiqnPrUa6qukvL8Tyfu4c4kBbFbonNTx53o,1367
|
|
6
|
-
PMJPL/constants.py,sha256=Az7hftY_CIibJdvRdQcDisRdKqJYm8khktakCcNZtXU,787
|
|
7
|
-
PMJPL/correctance_factor.py,sha256=V93rZcv5DM3LfujhEK8mRgJ-GHk868hDbTmcg8VoOAo,582
|
|
8
|
-
PMJPL/fwet.py,sha256=-5GEGC1ohKBzsuYGLNiCaVe10DQLm82rsZTZGVxb4WY,616
|
|
9
|
-
PMJPL/interception.py,sha256=2kDqMefH_kzMO9mLVY9BPFSoJE4K0pkQCXwrSi2CR9c,1605
|
|
10
|
-
PMJPL/mod16.csv,sha256=1aVfqLOAJwYuZPaScyqbk4yacObPgp8Q-IPzJm0yReY,847
|
|
11
|
-
PMJPL/parameters.py,sha256=kM26BUDMi-N03Gi2PqQi48kYMKakCB3ReiRMUGrvRQU,1974
|
|
12
|
-
PMJPL/potential_soil_evaporation.py,sha256=O8bHGM4ARqSXJDHu6IWneSEy5qScenotGR3uawijGWg,1829
|
|
13
|
-
PMJPL/soil_moisture_constraint.py,sha256=URUGsE1_p2P1dVQ8qKRcKb93hahYWtAmYqoassRu-PI,667
|
|
14
|
-
PMJPL/tmin_factor.py,sha256=UEeET10ErR2rUr1ViRN8UZmoCACxeeiFAReZXr9Kts4,1595
|
|
15
|
-
PMJPL/transpiration.py,sha256=lhRm2A0yxrlJxDw2he-k3PhE7G-sBsVvAMKo5fmh7wU,1998
|
|
16
|
-
PMJPL/version.txt,sha256=8LZyMhqJSE9NqFn_x0G7_otbaT04f34F-Exd5iWhzGE,5
|
|
17
|
-
PMJPL/wet_canopy_resistance.py,sha256=Eape5EBJuoP-IRvD0SWHJKCJWhzm03vcG72OZVYqt_Q,879
|
|
18
|
-
PMJPL/wet_soil_evaporation.py,sha256=mw9JG1oXfVdSWnVRLP2SPd53mSRK96b8k3E1zf0ci7A,1440
|
|
19
|
-
PMJPL/downscaling/__init__.py,sha256=xvhP4rHzx-nK_R6HSarJ-WF1bMPXYZGvvr8Hk84-q40,27
|
|
20
|
-
PMJPL/downscaling/downscaling.py,sha256=VuhFbK92llJbtkOtJpah_51sM5ctFJ9oNUaH4aaNO7g,8447
|
|
21
|
-
PMJPL/downscaling/linear_downscale.py,sha256=Yi0d2rb1XVSlBJoL2Arq9RtU5FH1RJ98MHLngJIYUjM,2466
|
|
22
|
-
PMJPL/evapotranspiration_conversion/__init__.py,sha256=21wYXP8FJT63MpUTbHu0wGntyFFeiGDRneGMKCNAu8Q,45
|
|
23
|
-
PMJPL/evapotranspiration_conversion/evapotranspiration_conversion.py,sha256=UYKMv-6kx474_dEMsJnoap21W9CD9Rg1fwcWa1haxLM,2734
|
|
24
|
-
PMJPL/meteorology_conversion/__init__.py,sha256=dLF40imqJCC_l8_QMetbsj1YzkXZuFt9tQ2fsd7Wcdw,38
|
|
25
|
-
PMJPL/meteorology_conversion/meteorology_conversion.py,sha256=8vzx71FLLNhR5v6EQBL8OSgAmupQcgdLX2c9tL9TPxA,4202
|
|
26
|
-
PMJPL/penman_monteith/__init__.py,sha256=vcfkNo6BLDCfSF9HZFDvRMAKCx49F9idN7iNTKQCpcA,31
|
|
27
|
-
PMJPL/penman_monteith/penman_monteith.py,sha256=RiqCgPU_0oYSSLMSVzQnouzJYClNcxtBhk3yEIJEWFU,741
|
|
28
|
-
PMJPL/priestley_taylor/__init__.py,sha256=E0SiG_DNAsMz_8A3342UPwbDyrMOgd35AZ-plaJar5s,32
|
|
29
|
-
PMJPL/priestley_taylor/priestley_taylor.py,sha256=Rj168jfWHSBhGeUkDs6ePrVsHhFbmUujzQaA8z0fCXE,1126
|
|
30
|
-
PMJPL/santanello/__init__.py,sha256=HXZS1p3sp4mDJCXkdq___ZIJ9etu7-B8yauJcFvQFgQ,26
|
|
31
|
-
PMJPL/santanello/santanello.py,sha256=lvgskYrirQz0t1m4XNSj8hLzrESS-oVZzMvAnVPyt3g,1521
|
|
32
|
-
PMJPL/vegetation_conversion/__init__.py,sha256=8gnz0yK_euCV0TtVGDrSGaVfx4g0EJCG2J68ppuA5oc,37
|
|
33
|
-
PMJPL/vegetation_conversion/vegetation_conversion.py,sha256=-K3FLV6pXkpxtRxQvimqqkXAgkn9mUUlHQ8FIscq1Zg,1306
|
|
34
|
-
pm_jpl-1.4.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
35
|
-
pm_jpl-1.4.1.dist-info/METADATA,sha256=mreRmJNms2mxNZuaa0kkB5x3suTsNsWiOa5iYBh7bAA,4146
|
|
36
|
-
pm_jpl-1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
-
pm_jpl-1.4.1.dist-info/top_level.txt,sha256=YaAFwdYHUxfUW08hiuFquUEdDGrsYn1duuMMjJKh0Ws,6
|
|
38
|
-
pm_jpl-1.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|