Skip to content

Commit

Permalink
solve an example problem in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainp committed Jul 6, 2023
1 parent a8da748 commit 15ddffc
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions smrt/core/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def passive(frequency, theta, polarization=None, channel_map=None, name=None):
::
from smrt import sensor
radiometer = sensor.passive(18e9, 50)
radiometer = sensor.passive(18e9, 50, "V")
radiometer = sensor.passive([18e9,36.5e9], [50,55], ["V","H"])
from smrt import sensor_list
radiometer = sensor_list.passive(18e9, 50)
radiometer = sensor_list.passive(18e9, 50, "V")
radiometer = sensor_list.passive([18e9,36.5e9], [50,55], ["V","H"])
"""

Expand Down Expand Up @@ -116,10 +116,10 @@ def active(frequency, theta_inc, theta=None, phi=None, polarization_inc=None, po
::
from smrt import sensor
scatterometer = sensor.active(frequency=18e9, theta_inc=50)
scatterometer = sensor.active(18e9, 50, 50, 0, "V", "V")
scatterometer = sensor.active([18e9,36.5e9], theta=50, theta_inc=50, polarization_inc=["V", "H"], polarization=["V", "H"])
from smrt import sensor_list
scatterometer = sensor_list.active(frequency=18e9, theta_inc=50)
scatterometer = sensor_list.active(18e9, 50, 50, 0, "V", "V")
scatterometer = sensor_list.active([18e9,36.5e9], theta=50, theta_inc=50, polarization_inc=["V", "H"], polarization=["V", "H"])
"""

Expand Down Expand Up @@ -162,7 +162,6 @@ def make_multi_channel_altimeter(config, channel):
return SensorList([altimeter(c, **config[c]) for c in channel])



class SensorBase(object):
pass

Expand Down Expand Up @@ -303,6 +302,9 @@ def iterate(self, axis):
class SensorList(SensorBase):

def __init__(self, sensor_list, axis="channel"):

super().__init__()

self.sensor_list = sensor_list
self.axis = axis

Expand All @@ -320,7 +322,6 @@ def __init__(self, sensor_list, axis="channel"):
if len(set(a)) != len(a):
raise SMRTError("It is required to set different '%s' values for each sensor" % axis)


@property
def channel(self):
return [ch for ch in s.channel_map for s in self.sensor_list]
Expand Down

0 comments on commit 15ddffc

Please sign in to comment.