Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

change internal looping in NuRadioMC #222

Merged
merged 44 commits into from
Aug 25, 2020
Merged

change internal looping in NuRadioMC #222

merged 44 commits into from
Aug 25, 2020

Conversation

cg-laser
Copy link
Contributor

corresponding PR to nu-radio/NuRadioMC#208

@christophwelling
Copy link
Collaborator

Looks good so far. Can you add a has_shower method to the event class to check if there is already a shower with a given ID?

@cg-laser cg-laser marked this pull request as ready for review June 24, 2020 15:28
Copy link
Collaborator

@christophwelling christophwelling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I just have a few minor complaints.
Is it possible to use modules like the hardwareResponseIncorporator on the simChannels if you pass the simStation instead of the station?

logger = logging.getLogger('channel')


class SimChannel(NuRadioReco.framework.base_trace.BaseTrace):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to inherit from Channel

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that would be smarter. I'll change it

@@ -31,10 +35,34 @@ def get_simulation_weight(self):
def set_simulation_weight(self, simulation_weight):
self.__simulation_weight = simulation_weight

def serialize(self, mode):
base_station_pkl = NuRadioReco.framework.base_station.BaseStation.serialize(self, mode)
def iter_channels(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These channel are the same as in the Station class, so I would put them into the BaseStation to avoid duplication

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the Station and the SimStation class now have a iter_channels method that does the same. So it would be better to define this once in the BaseStation class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are not exactly the same. The identifiers for the channels are different. We could move the data structure into the basestation and also the iter_channels function. Also the object itself is different. One is a SimChannel and the other one is a Channel.
So I fear it might get more confusing than helping to move part of the code to the base station.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I see. Hard to say which solution is better. So I'm fine with either. Have you tested if Channel and SimChannel are similar enough that you can use modules like the filter and resampler on both (by just passing the SimStation instead of the Station)? I think that would be very useful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SimChannel inherits from Channel. The only difference is that it has two more identifiers, the ray tracing and shower id. So all modules that run on the channel should also run on the simchannel. I'm actually using it in NuRadioMC .

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, then I don't have anything to complain about any more ;-)

NuRadioReco/modules/channelAddCableDelay.py Show resolved Hide resolved
NuRadioReco/modules/channelGenericNoiseAdder.py Outdated Show resolved Hide resolved
@anelles
Copy link
Collaborator

anelles commented Aug 20, 2020

@cg-laser per code cleaning up, we should try to merge this. @christophwelling you would need to accepted the changes in order to make is mergable.

@christophwelling
Copy link
Collaborator

Please put the iter_channels method from the Station and SimStation class into the BaseStation class, then I think this can be merged.

@cg-laser
Copy link
Contributor Author

The SouthPole test will fail because of the random seeds changes. So I need to update this. But before that, I need to merge the corresponding NuRadioMC changes into the internal-looping branch. For this I'm waiting on @anelles feedback/approval on the NuRadioMC pull request (the noise temperature one).

cg-laser and others added 2 commits August 24, 2020 15:52
@cg-laser cg-laser merged commit bd46419 into master Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants