Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor NuRadioReco/modules/efieldToVoltageConverter.py #707

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

fschlueter
Copy link
Collaborator

Moving some repetitive code in its own function.

@fschlueter
Copy link
Collaborator Author

ping

@sjoerd-bouma
Copy link
Collaborator

Is it clear to you why the unit tests are failing? It's not clear to me, but they don't seem to fail on other branches as far as I can tell...

@fschlueter
Copy link
Collaborator Author

Hm I am puzzled. I did not change anything?

@fschlueter
Copy link
Collaborator Author

A miracle, the tests run through now ...

@fschlueter
Copy link
Collaborator Author

@sjoerd-bouma could you do me the honour of approving?

@fschlueter
Copy link
Collaborator Author

ping

self.__uncertainty['sys_dz'] = np.random.normal(0, self.__uncertainty['sys_dz'])
if('sys_amp' in self.__uncertainty):
for iCh in self.__uncertainty['sys_amp'].keys():
self.__uncertainty = uncertainty or {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder what percentage of python users finds this more intuitive than the four-line equivalent... I'm not a convert yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if that is the case: ciao.

@@ -267,3 +266,39 @@ def end(self):
dt = timedelta(seconds=self.__t)
self.logger.info("total time used by this module is {}".format(dt))
return dt


def calculate_time_shift_for_cosmic_ray(det, station, efield, channel_id):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also not sure if it's worth making this function private, I guess we don´t expect it to be used on its own. But this is anyway not something we're very consistent about throughout NuRadio.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

next PR? Is this function useful for the other efield2Voltage converter modules?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I'm happy for this to be merged as is.

@fschlueter fschlueter merged commit 3ff54d8 into develop Dec 12, 2024
5 checks passed
@anelles anelles deleted the refactor-fs branch December 13, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants