diff --git a/activefires_pp/post_processing.py b/activefires_pp/post_processing.py index 99121ff..3df1243 100644 --- a/activefires_pp/post_processing.py +++ b/activefires_pp/post_processing.py @@ -430,6 +430,7 @@ def _national_save_and_publish(self, feature_collection, ndata, af_shapeff, msg, def do_postprocessing_on_message(self, msg, filename): """Do the fires post processing on a message.""" + logger.debug("Current detection id: ", str(self._fire_detection_id)) platform_name = msg.data.get('platform_name') af_shapeff = ActiveFiresShapefileFiltering(filename, platform_name=platform_name, timezone=self.timezone) @@ -449,6 +450,7 @@ def do_postprocessing_on_message(self, msg, filename): afdata = self.add_unique_day_id(afdata) self.save_id_to_file() + logger.debug("Current detection id: ", str(self._fire_detection_id)) afdata = self.add_tb_celcius(afdata) @@ -573,7 +575,6 @@ def _generate_output_message(self, filepath, input_msg, region=None): """Create the output message to publish.""" output_topic = generate_posttroll_topic(self.output_topic, region) to_send = prepare_posttroll_message(input_msg, region) - # to_send['uri'] = ('ssh://%s/%s' % (self.host, filepath)) to_send['uri'] = str(filepath) to_send['uid'] = os.path.basename(filepath) to_send['type'] = 'GEOJSON-filtered' @@ -649,6 +650,7 @@ def add_unique_day_id(self, afdata): # Add id's to the detections: id_list = [] for _i in range(len(afdata)): + logger.debug("Updating the fire detection id...") self.update_fire_detection_id() id_ = self._create_id_string() id_list.append(id_) diff --git a/activefires_pp/tests/test_messaging.py b/activefires_pp/tests/test_messaging.py index b9b9410..e666484 100644 --- a/activefires_pp/tests/test_messaging.py +++ b/activefires_pp/tests/test_messaging.py @@ -214,14 +214,14 @@ def test_prepare_posttroll_message(setup_comm, get_config, test_filepath = "/my/geojson/file/path" input_msg = Message.decode(rawstr=TEST_MSG) - result_messages = afpp.get_output_messages(test_filepath, input_msg, 1) - - assert result_messages[0].data['platform_name'] == 'NOAA-20' - assert result_messages[0].data['type'] == 'GEOJSON-filtered' - assert result_messages[0].data['format'] == 'geojson' - assert result_messages[0].data['product'] == 'afimg' - assert result_messages[0].subject == '/VIIRS/L2/Fires/PP/National' - assert result_messages[0].data['uri'] == 'ssh://my.host.name//my/geojson/file/path' + res_msg = afpp.get_output_messages(test_filepath, input_msg, 1) + + assert res_msg[0].data['platform_name'] == 'NOAA-20' + assert res_msg[0].data['type'] == 'GEOJSON-filtered' + assert res_msg[0].data['format'] == 'geojson' + assert res_msg[0].data['product'] == 'afimg' + assert res_msg[0].subject == '/VIIRS/L2/Fires/PP/National' + assert res_msg[0].data['uri'] == '/my/geojson/file/path' input_msg = Message.decode(rawstr=TEST_MSG)