@@ -28,11 +28,11 @@ def __init__(self, item):
28
28
self .item = item
29
29
30
30
def apply (self ,
31
- off_nadir = None ,
32
- incidence_angle = None ,
33
- azimuth = None ,
34
- sun_azimuth = None ,
35
- sun_elevation = None ):
31
+ off_nadir : Optional [ float ] = None ,
32
+ incidence_angle : Optional [ float ] = None ,
33
+ azimuth : Optional [ float ] = None ,
34
+ sun_azimuth : Optional [ float ] = None ,
35
+ sun_elevation : Optional [ float ] = None ):
36
36
"""Applies View Geometry extension properties to the extended Item.
37
37
38
38
Args:
@@ -49,11 +49,21 @@ def apply(self,
49
49
sun_elevation (float): Sun elevation angle. The angle from the tangent of the scene
50
50
center point to the sun. Measured from the horizon in degrees (0-90).
51
51
"""
52
- self .off_nadir = off_nadir
53
- self .incidence_angle = incidence_angle
54
- self .azimuth = azimuth
55
- self .sun_azimuth = sun_azimuth
56
- self .sun_elevation = sun_elevation
52
+ if (off_nadir is None and incidence_angle is None and azimuth is None
53
+ and sun_azimuth is None and sun_elevation is None ):
54
+ raise pystac .STACError (
55
+ 'Must provide at least one of: off_nadir, incidence_angle, azimuth, sun_azimuth, sun_elevation' # noqa: E501
56
+ )
57
+ if off_nadir :
58
+ self .off_nadir = off_nadir
59
+ if incidence_angle :
60
+ self .incidence_angle = incidence_angle
61
+ if azimuth :
62
+ self .azimuth = azimuth
63
+ if sun_azimuth :
64
+ self .sun_azimuth = sun_azimuth
65
+ if sun_elevation :
66
+ self .sun_elevation = sun_elevation
57
67
58
68
@property
59
69
def off_nadir (self ):
0 commit comments