Skip to content

Commit 25d7e6a

Browse files
committed
Partial updates for new method names.
1 parent 943cb78 commit 25d7e6a

File tree

2 files changed

+27
-61
lines changed

2 files changed

+27
-61
lines changed

sbpy/surfaces/scattered.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,7 @@
1010
from ..units.typing import SpectralQuantity, SpectralFluxDensityQuantity, UnitLike
1111

1212

13-
class ScatteredLight(Surface):
14-
"""Abstract base class to observe light scattered by a surface."""
15-
16-
@u.quantity_input
17-
def radiance(
18-
self,
19-
F_i: SpectralFluxDensityQuantity,
20-
i: u.physical.angle,
21-
e: u.physical.angle,
22-
phi: u.physical.angle,
23-
) -> u.Quantity:
24-
"""Observed light reflected from a surface."""
25-
return F_i * self.reflectance(i, e, phi) / u.sr
26-
27-
radiance.__doc__ += Surface.radiance.__doc__[
28-
Surface.radiance.__doc__.index("\n") : # noqa: E203
29-
]
30-
31-
32-
class ScatteredSunlight(ScatteredLight):
13+
class ScatteredSunlight(Surface):
3314
"""Abstract base class to observe sunlight scattered by a surface."""
3415

3516
@u.quantity_input
@@ -82,7 +63,7 @@ def scattered_sunlight(
8263
F_i = sun.observe(wave_freq, unit=flux_density_unit)
8364

8465
F_i /= rh.to_value("au") ** 2
85-
return self.radiance(F_i, i, e, phi).to(unit)
66+
return self.reflectance(F_i, i, e, phi).to(unit)
8667

8768
@u.quantity_input
8869
def scattered_sunlight_from_vectors(

sbpy/surfaces/surface.py

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def _min_zero_cos(a: u.physical.angle) -> u.Quantity:
3939
return np.maximum(x, 0)
4040

4141
@abstractmethod
42-
def absorptance(self, i: u.physical.angle) -> u.Quantity:
42+
def absorbed_radiance(
43+
self,
44+
F_i: SpectralFluxDensityQuantity,
45+
i: u.physical.angle,
46+
) -> u.Quantity:
4347
r"""Absorption of incident light.
4448
4549
The surface is illuminated by incident flux density, :math:`F_i`, at an
@@ -48,6 +52,9 @@ def absorptance(self, i: u.physical.angle) -> u.Quantity:
4852
4953
Parameters
5054
----------
55+
F_i : `astropy.units.Quantity`
56+
Incident light (spectral flux density).
57+
5158
i : `~astropy.units.Quantity`
5259
Angle from normal of incident light.
5360
@@ -60,7 +67,12 @@ def absorptance(self, i: u.physical.angle) -> u.Quantity:
6067
"""
6168

6269
@abstractmethod
63-
def emittance(self, e: u.physical.angle, phi: u.physical.angle) -> u.Quantity:
70+
def emitted_radiance(
71+
self,
72+
F_e: SpectralFluxDensityQuantity,
73+
e: u.physical.angle,
74+
phi: u.physical.angle,
75+
) -> u.Quantity:
6476
r"""Emission of light.
6577
6678
The surface is observed at an angle of :math:`e`, measured from the
@@ -69,8 +81,11 @@ def emittance(self, e: u.physical.angle, phi: u.physical.angle) -> u.Quantity:
6981
7082
Parameters
7183
----------
84+
F_e : `astropy.units.Quantity`
85+
Spectral emittance (spectral flux density).
86+
7287
e : `~astropy.units.Quantity`
73-
Angle from normal of emitted light.
88+
Observed angle from normal.
7489
7590
phi : `~astropy.units.Quantity`
7691
Source-target-observer (phase) angle.
@@ -96,36 +111,6 @@ def reflectance(
96111
emitted light are assumed to be collimated.
97112
98113
99-
Parameters
100-
----------
101-
i : `~astropy.units.Quantity`
102-
Angle from normal of incident light.
103-
104-
e : `~astropy.units.Quantity`
105-
Angle from normal of emitted light.
106-
107-
phi : `~astropy.units.Quantity`
108-
Source-target-observer (phase) angle.
109-
110-
111-
Returns
112-
-------
113-
r : `~astropy.units.Quantity`
114-
Surface reflectance.
115-
116-
"""
117-
118-
@abstractmethod
119-
def radiance(
120-
self,
121-
F_i: SpectralFluxDensityQuantity,
122-
i: u.physical.angle,
123-
e: u.physical.angle,
124-
phi: u.physical.angle,
125-
) -> u.Quantity:
126-
"""Observed radiance from a surface.
127-
128-
129114
Parameters
130115
----------
131116
F_i : `astropy.units.Quantity`
@@ -143,8 +128,8 @@ def radiance(
143128
144129
Returns
145130
-------
146-
radiance : `~astropy.units.Quantity`
147-
Observed radiance.
131+
r : `~astropy.units.Quantity`
132+
Surface reflectance.
148133
149134
"""
150135

@@ -165,14 +150,14 @@ def _vectors_to_angles(
165150
return i, e, phi
166151

167152
@u.quantity_input
168-
def radiance_from_vectors(
153+
def reflectance_from_vectors(
169154
self,
170155
F_i: SpectralFluxDensityQuantity,
171156
n: np.ndarray,
172157
rs: u.physical.length,
173158
ro: np.ndarray,
174159
) -> u.Quantity:
175-
"""Observed radiance from a surface with geometry defined by vectors.
160+
"""Vector based alternative to reflectance().
176161
177162
Input vectors do not need to be normalized.
178163
@@ -194,9 +179,9 @@ def radiance_from_vectors(
194179
195180
Returns
196181
-------
197-
radiance : `~astropy.units.Quantity`
198-
Observed radiance.
182+
reflectance : `~astropy.units.Quantity`
183+
Reflectance.
199184
200185
"""
201186

202-
return self.radiance(F_i, *self._vectors_to_angles(n, rs, ro))
187+
return self.reflectance(F_i, *self._vectors_to_angles(n, rs, ro))

0 commit comments

Comments
 (0)