BESS-JPL 1.7.0__py3-none-any.whl → 1.9.0__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 BESS-JPL might be problematic. Click here for more details.
- BESS_JPL/BESS_JPL.py +2 -1
- BESS_JPL/version.txt +1 -1
- {bess_jpl-1.7.0.dist-info → bess_jpl-1.9.0.dist-info}/METADATA +1 -1
- {bess_jpl-1.7.0.dist-info → bess_jpl-1.9.0.dist-info}/RECORD +7 -11
- {bess_jpl-1.7.0.dist-info → bess_jpl-1.9.0.dist-info}/WHEEL +1 -1
- BESS_JPL/SZA/__init__.py +0 -1
- BESS_JPL/SZA/daylight_hours.py +0 -74
- BESS_JPL/vegetation_conversion/__init__.py +0 -1
- BESS_JPL/vegetation_conversion/vegetation_conversion.py +0 -71
- {bess_jpl-1.7.0.dist-info → bess_jpl-1.9.0.dist-info}/licenses/LICENSE +0 -0
- {bess_jpl-1.7.0.dist-info → bess_jpl-1.9.0.dist-info}/top_level.txt +0 -0
BESS_JPL/BESS_JPL.py
CHANGED
|
@@ -48,12 +48,12 @@ def BESS_JPL(
|
|
|
48
48
|
ST_C: Union[Raster, np.ndarray], # surface temperature in Celsius
|
|
49
49
|
NDVI: Union[Raster, np.ndarray], # NDVI
|
|
50
50
|
albedo: Union[Raster, np.ndarray], # surface albedo
|
|
51
|
-
elevation_km: Union[Raster, np.ndarray] = None, # elevation in kilometers
|
|
52
51
|
geometry: RasterGeometry = None,
|
|
53
52
|
time_UTC: datetime = None,
|
|
54
53
|
hour_of_day: np.ndarray = None,
|
|
55
54
|
day_of_year: np.ndarray = None,
|
|
56
55
|
GEOS5FP_connection: GEOS5FP = None,
|
|
56
|
+
elevation_km: Union[Raster, np.ndarray] = None, # elevation in kilometers
|
|
57
57
|
Ta_C: Union[Raster, np.ndarray] = None, # air temperature in Celsius
|
|
58
58
|
RH: Union[Raster, np.ndarray] = None, # relative humidity as a proportion
|
|
59
59
|
NDVI_minimum: Union[Raster, np.ndarray] = None, # minimum NDVI
|
|
@@ -514,6 +514,7 @@ def BESS_JPL(
|
|
|
514
514
|
"Rn": Rn,
|
|
515
515
|
"Rn_soil": Rn_soil,
|
|
516
516
|
"Rn_canopy": Rn_canopy,
|
|
517
|
+
"G": G,
|
|
517
518
|
"LE": LE,
|
|
518
519
|
"LE_soil": LE_soil,
|
|
519
520
|
"LE_canopy": LE_canopy
|
BESS_JPL/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.9.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: BESS-JPL
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
4
4
|
Summary: Breathing Earth System Simulator (BESS) Gross Primary Production (GPP) and Evapotranspiration (ET) Model Python
|
|
5
5
|
Author-email: Gregory Halverson <gregory.h.halverson@jpl.nasa.gov>
|
|
6
6
|
Project-URL: Homepage, https://github.com/JPL-Evapotranspiration-Algorithms/BESS-JPL
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
BESS_JPL/BESS_JPL.py,sha256=
|
|
1
|
+
BESS_JPL/BESS_JPL.py,sha256=jF3Gb7IexnXlaj-Y0Obi0_ftGpnKv1IcitYxyvoMDBo,22311
|
|
2
2
|
BESS_JPL/C3_photosynthesis.py,sha256=-ormDycaWttCOoYJdOoOV_zlM6n0nxkgXxj7fyH_mIs,2760
|
|
3
3
|
BESS_JPL/C4_fraction.jpeg,sha256=ECaEYWA8MnNd5z0Yq3beeUCR93KtTDxM8MrH-YYon3Y,2746
|
|
4
4
|
BESS_JPL/C4_fraction.tif,sha256=DFS-J08JCjnf0hi_T_dFridAegVTiU3FGyMBjS9yc1w,25446
|
|
@@ -43,13 +43,9 @@ BESS_JPL/peakVCmax_C3.tif,sha256=ax6wCOPc_ovgJJl9YRjPWNY13OCGlzs2djXqwob_U7A,158
|
|
|
43
43
|
BESS_JPL/peakVCmax_C4.jpeg,sha256=s7dhpcD573KW9Se4mejDeSzbSHqPtQY2EL6KJKt7ZIo,961497
|
|
44
44
|
BESS_JPL/peakVCmax_C4.tif,sha256=EST4_yy-HHYmazIv--RePL_bhLejMWql6hoV9EE38ok,1556928
|
|
45
45
|
BESS_JPL/soil_energy_balance.py,sha256=5TKDVkKYJ8jhjuiwbRva_03fi_0gTM0IAKbSm4WhWnY,944
|
|
46
|
-
BESS_JPL/version.txt,sha256=
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
bess_jpl-1.
|
|
52
|
-
bess_jpl-1.7.0.dist-info/METADATA,sha256=Q5NcGaYCyZ9KgAbzdEztGh9fpIXO_sl8ZnBoM3CmeBw,6339
|
|
53
|
-
bess_jpl-1.7.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
54
|
-
bess_jpl-1.7.0.dist-info/top_level.txt,sha256=GaKnzt-BBktYn1o-w4Qzh_jHxse4Y3ACOxZQrB2ufhc,9
|
|
55
|
-
bess_jpl-1.7.0.dist-info/RECORD,,
|
|
46
|
+
BESS_JPL/version.txt,sha256=dxfL-Qxjo7CWAIdjoCBmI5kW-pkW-YJU0ao7JHCDD80,5
|
|
47
|
+
bess_jpl-1.9.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
48
|
+
bess_jpl-1.9.0.dist-info/METADATA,sha256=Ohmaq90iop6JHFhbzkdOJGHO-xM2u-Eg-d4piwmKOio,6339
|
|
49
|
+
bess_jpl-1.9.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
50
|
+
bess_jpl-1.9.0.dist-info/top_level.txt,sha256=GaKnzt-BBktYn1o-w4Qzh_jHxse4Y3ACOxZQrB2ufhc,9
|
|
51
|
+
bess_jpl-1.9.0.dist-info/RECORD,,
|
BESS_JPL/SZA/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .SZA import *
|
BESS_JPL/SZA/daylight_hours.py
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module calculates sunrise hour and daylight hours.
|
|
3
|
-
|
|
4
|
-
Developed by Gregory Halverson in the Jet Propulsion Laboratory Year-Round Internship Program (Columbus Technologies and Services, ANRE Tech.), in coordination with the ECOSTRESS mission and master's thesis studies at California State University, Northridge.
|
|
5
|
-
"""
|
|
6
|
-
import warnings
|
|
7
|
-
from numpy import tan, cos, sin, pi, arccos, where, radians, degrees
|
|
8
|
-
|
|
9
|
-
__author__ = 'Gregory Halverson'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def day_angle_rad_from_doy(doy):
|
|
13
|
-
"""
|
|
14
|
-
This function calculates day angle in radians from day of year between 1 and 365.
|
|
15
|
-
"""
|
|
16
|
-
return (2 * pi * (doy - 1)) / 365
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def solar_dec_deg_from_day_angle_rad(day_angle_rad):
|
|
20
|
-
"""
|
|
21
|
-
This function calculates solar declination in degrees from day angle in radians.
|
|
22
|
-
"""
|
|
23
|
-
return (0.006918 - 0.399912 * cos(day_angle_rad) + 0.070257 * sin(day_angle_rad) - 0.006758 * cos(
|
|
24
|
-
2 * day_angle_rad) + 0.000907 * sin(2 * day_angle_rad) - 0.002697 * cos(3 * day_angle_rad) + 0.00148 * sin(
|
|
25
|
-
3 * day_angle_rad)) * (180 / pi)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def sha_deg_from_doy_lat(doy, latitude):
|
|
29
|
-
"""
|
|
30
|
-
This function calculates sunrise hour angle in degrees from latitude in degrees and day of year between 1 and 365.
|
|
31
|
-
"""
|
|
32
|
-
# calculate day angle in radians
|
|
33
|
-
day_angle_rad = day_angle_rad_from_doy(doy)
|
|
34
|
-
|
|
35
|
-
# calculate solar declination in degrees
|
|
36
|
-
solar_dec_deg = solar_dec_deg_from_day_angle_rad(day_angle_rad)
|
|
37
|
-
|
|
38
|
-
# convert latitude to radians
|
|
39
|
-
latitude_rad = radians(latitude)
|
|
40
|
-
|
|
41
|
-
# convert solar declination to radians
|
|
42
|
-
solar_dec_rad = radians(solar_dec_deg)
|
|
43
|
-
|
|
44
|
-
# calculate cosine of sunrise angle at latitude and solar declination
|
|
45
|
-
# need to keep the cosine for polar correction
|
|
46
|
-
sunrise_cos = -tan(latitude_rad) * tan(solar_dec_rad)
|
|
47
|
-
|
|
48
|
-
# calculate sunrise angle in radians from cosine
|
|
49
|
-
warnings.filterwarnings('ignore')
|
|
50
|
-
sunrise_rad = arccos(sunrise_cos)
|
|
51
|
-
warnings.resetwarnings()
|
|
52
|
-
|
|
53
|
-
# convert to degrees
|
|
54
|
-
sunrise_deg = degrees(sunrise_rad)
|
|
55
|
-
|
|
56
|
-
# apply polar correction
|
|
57
|
-
sunrise_deg = where(sunrise_cos >= 1, 0, sunrise_deg)
|
|
58
|
-
sunrise_deg = where(sunrise_cos <= -1, 180, sunrise_deg)
|
|
59
|
-
|
|
60
|
-
return sunrise_deg
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def sunrise_from_sha(sha_deg):
|
|
64
|
-
"""
|
|
65
|
-
This function calculates sunrise hour from sunrise hour angle in degrees.
|
|
66
|
-
"""
|
|
67
|
-
return 12.0 - (sha_deg / 15.0)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def daylight_from_sha(sha_deg):
|
|
71
|
-
"""
|
|
72
|
-
This function calculates daylight hours from sunrise hour angle in degrees.
|
|
73
|
-
"""
|
|
74
|
-
return (2.0 / 15.0) * sha_deg
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .vegetation_conversion import *
|
|
@@ -1,71 +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
|
|
48
|
-
|
|
49
|
-
def SAVI_from_NDVI(NDVI: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
50
|
-
"""
|
|
51
|
-
Linearly calculates Soil-Adjusted Vegetation Index from ST_K.
|
|
52
|
-
:param NDVI: normalized difference vegetation index clipped between 0 and 1
|
|
53
|
-
:return: soil-adjusted vegetation index
|
|
54
|
-
"""
|
|
55
|
-
return NDVI * 0.45 + 0.132
|
|
56
|
-
|
|
57
|
-
def fAPAR_from_SAVI(SAVI: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
58
|
-
"""
|
|
59
|
-
Linearly calculates fraction of absorbed photosynthetically active radiation from soil-adjusted vegetation index.
|
|
60
|
-
:param SAVI: soil adjusted vegetation index
|
|
61
|
-
:return: fraction of absorbed photosynthetically active radiation
|
|
62
|
-
"""
|
|
63
|
-
return rt.clip(SAVI * 1.3632 + -0.048, 0, 1)
|
|
64
|
-
|
|
65
|
-
def fIPAR_from_NDVI(NDVI: Union[Raster, np.ndarray]) -> Union[Raster, np.ndarray]:
|
|
66
|
-
"""
|
|
67
|
-
Calculate fraction of intercepted photosynthetically active radiation from normalized difference vegetation index
|
|
68
|
-
:param NDVI: normalized difference vegetation index
|
|
69
|
-
:return: fraction of intercepted photosynthetically active radiation
|
|
70
|
-
"""
|
|
71
|
-
return rt.clip(rt.clip(NDVI, 0, 1) - 0.05, 0, 1)
|
|
File without changes
|
|
File without changes
|