diff --git a/NuRadioReco/detector/RNO_G/db_mongo_read.py b/NuRadioReco/detector/RNO_G/db_mongo_read.py index 9dd9ce317..1f76ab454 100644 --- a/NuRadioReco/detector/RNO_G/db_mongo_read.py +++ b/NuRadioReco/detector/RNO_G/db_mongo_read.py @@ -885,15 +885,15 @@ def get_channel_signal_chain(self, channel_signal_id, measurement_name=None, ver supp_info = {k.replace(component + "_", ""): additional_information[k] for k in additional_information if re.search(component, k)} - if re.search("golden", component, re.IGNORECASE): - collection_component = component.replace("_1", "").replace("_2", "") - # load the s21 parameter measurement - component_data = self.get_component_data( - collection_component, component_id, supp_info, primary_time=self.__database_time, verbose=verbose) + if re.search("_\d+", component, re.IGNORECASE): + collection_suffix = re.findall("(_\d+)", component, re.IGNORECASE)[0] + collection_component = component.replace(collection_suffix, "") else: - # load the s21 parameter measurement - component_data = self.get_component_data( - component, component_id, supp_info, primary_time=self.__database_time, verbose=verbose) + collection_component = component + + # load the s21 parameter measurement + component_data = self.get_component_data( + collection_component, component_id, supp_info, primary_time=self.__database_time, verbose=verbose) # add the component name, the weight of the s21 measurement and the actual s21 measurement (component_data) to a combined dictionary components_data[component] = {'name': component_id} diff --git a/NuRadioReco/detector/detector_base.py b/NuRadioReco/detector/detector_base.py index 417cb2f2b..68ddeca30 100644 --- a/NuRadioReco/detector/detector_base.py +++ b/NuRadioReco/detector/detector_base.py @@ -951,7 +951,7 @@ def get_antenna_model(self, station_id, channel_id, zenith=None): def get_channel_group_id(self, station_id, channel_id): """ - returns the group ID of a channel + returns the group ID of a channel. If the channel has no group ID, the channel ID is returned. Parameters ---------- @@ -966,11 +966,11 @@ def get_channel_group_id(self, station_id, channel_id): the channel group ID """ res = self.__get_channel(station_id, channel_id) - if 'channel_group_id' not in res.keys(): - logger.warning( - 'Channel group ID not set for channel {} in station {}, returning -1'.format( + if 'channel_group_id' not in res: + logger.info( + 'Channel group ID not set for channel {} in station {}, returning channel_id'.format( channel_id, station_id)) - return -1 + return channel_id else: return res['channel_group_id'] diff --git a/documentation/source/NuRadioReco/pages/detector/rnog.rst b/documentation/source/NuRadioReco/pages/detector/rnog.rst index 99034acfc..fc4c41fd4 100644 --- a/documentation/source/NuRadioReco/pages/detector/rnog.rst +++ b/documentation/source/NuRadioReco/pages/detector/rnog.rst @@ -11,9 +11,14 @@ To describe the detector at any time we use two different time variables, the `d Database data structure ----------------------- -The database is organized in collections. Each collection contains a list of objects which contain our data. The primary collection which describes our detector is the called `station_rnog`. This collection contains the `station list` which describes which station are deployed, when they were deployed. Each station has a list of its deployed channels. The information of the stations and channels positions is organized in seperate collections. Also the response of the different components in a channel's signal chain are stored in other collections. +The database is organized in collections. Each collection contains a list of objects which contain our data. The primary collection which describes our detector is the called `station_rnog`. This collection contains the `station list` which describes which station are deployed, when they were deployed. Each station has a list of its deployed channels. The information of the stations and channels positions is organized in seperate collections. Also the response of the different components in a channel's signal chain are stored in other collections. +Signal Chain +------------ + +Each channel has a "signal chain" which is basically a list of all the individual reponses which are necessary to describe the entire analog response of this channel. This list is implemented as dictionary, the key of the dictionary is also the name of the collection in which it looks for the specified response (value). The key can have a suffix like `_1` which allows to specify several response from the same collection to be added to the signal chain. + Detector class --------------