diff --git a/scos_actions/actions/acquire_sea_data_product.py b/scos_actions/actions/acquire_sea_data_product.py index 2c906623..2a6872c2 100644 --- a/scos_actions/actions/acquire_sea_data_product.py +++ b/scos_actions/actions/acquire_sea_data_product.py @@ -511,7 +511,7 @@ def __call__(self, sensor: Sensor, schedule_entry: dict, task_id: int): _ = psutil.cpu_percent(interval=None) # Initialize CPU usage monitor self.test_required_components() - self.configure_preselector(self.sensor, self.rf_path) + self.configure_preselector(self.rf_path) # Initialize metadata object self.get_sigmf_builder( diff --git a/scos_actions/actions/calibrate_y_factor.py b/scos_actions/actions/calibrate_y_factor.py index 2be35eac..d26bb743 100644 --- a/scos_actions/actions/calibrate_y_factor.py +++ b/scos_actions/actions/calibrate_y_factor.py @@ -223,7 +223,7 @@ def calibrate(self, params: dict): # Set noise diode on logger.debug("Setting noise diode on") - self.configure_preselector(sensor=self.sensor, params={RF_PATH: nd_on_state}) + self.configure_preselector(params={RF_PATH: nd_on_state}) time.sleep(0.25) # Get noise diode on IQ @@ -237,7 +237,7 @@ def calibrate(self, params: dict): # Set noise diode off logger.debug("Setting noise diode off") - self.configure_preselector(sensor=self.sensor, params={RF_PATH: nd_off_state}) + self.configure_preselector(params={RF_PATH: nd_off_state}) time.sleep(0.25) # Get noise diode off IQ diff --git a/scos_actions/actions/interfaces/action.py b/scos_actions/actions/interfaces/action.py index a102a48c..496723dd 100644 --- a/scos_actions/actions/interfaces/action.py +++ b/scos_actions/actions/interfaces/action.py @@ -40,7 +40,7 @@ def __init__(self, parameters: dict): def configure(self, params: dict): self.configure_sigan(params) - self.configure_preselector(self.sensor, params) + self.configure_preselector(params) @property def sensor(self): @@ -59,13 +59,13 @@ def configure_sigan(self, params: dict): else: logger.warning(f"Sigan does not have attribute {key}") - def configure_preselector(self, sensor: Sensor, params: dict): - preselector = sensor.preselector + def configure_preselector(self, params: dict): + preselector = self.sensor.preselector if self.PRESELECTOR_PATH_KEY in params: path = params[self.PRESELECTOR_PATH_KEY] logger.debug(f"Setting preselector RF path: {path}") preselector.set_state(path) - elif sensor.has_configurable_preselector: + elif self.sensor.has_configurable_preselector: # Require the RF path to be specified if the sensor has a preselector. raise ParameterException( f"No {self.PRESELECTOR_PATH_KEY} value specified in the YAML config." @@ -74,7 +74,7 @@ def configure_preselector(self, sensor: Sensor, params: dict): # No preselector in use, so do not require an RF path pass - def get_sigmf_builder(self, sensor: Sensor, schedule_entry: dict) -> None: + def get_sigmf_builder(self, schedule_entry: dict) -> None: """ Set the `sigmf_builder` instance variable to an initialized SigMFBuilder. @@ -101,8 +101,8 @@ def get_sigmf_builder(self, sensor: Sensor, schedule_entry: dict) -> None: ) sigmf_builder.set_action(action_obj) - if sensor.location is not None: - sigmf_builder.set_geolocation(sensor.location) + if self.sensor.location is not None: + sigmf_builder.set_geolocation(self.sensor.location) if self.sensor.capabilities is not None and hasattr( self.sensor.capabilities, "sensor" ): diff --git a/scos_actions/actions/interfaces/measurement_action.py b/scos_actions/actions/interfaces/measurement_action.py index 8e732ca6..f0b06e54 100644 --- a/scos_actions/actions/interfaces/measurement_action.py +++ b/scos_actions/actions/interfaces/measurement_action.py @@ -26,7 +26,7 @@ def __init__(self, parameters: dict): def __call__(self, sensor: Sensor, schedule_entry: dict, task_id: int): self._sensor = sensor - self.get_sigmf_builder(sensor, schedule_entry) + self.get_sigmf_builder(schedule_entry) self.test_required_components() self.configure(self.parameters) measurement_result = self.execute(schedule_entry, task_id)