Skip to content

Conversation

@astrojarred
Copy link

This is just a base PR which can later facilitate the addition of the MAGIC reader, addressing #836:

  • Add MAGIC detector class: MAGIC(Detector)
  • Add MAGIC geometry file

I'm not sure if anything should be updated in the documentation at this point, but I can definitely take care of that in either case when the reader is added.

Copy link
Collaborator

@Aske-Rosted Aske-Rosted left a comment

Choose a reason for hiding this comment

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

A couple of comments otherwise looks good.

def _charge(self, x: torch.tensor) -> torch.tensor:
"""Add a small epsilon to avoid log(0)."""
epsilon = 1e-6
return torch.log10(x + epsilon)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you would always expect any user to have zero-padding in the data when using the MAGIC detector class then this approach is fine otherwise adding the epsilon as an optional toggle is probably cleaner.

Copy link
Author

Choose a reason for hiding this comment

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

Added an input parameter use_charge_epsilon which seems to be settable now from the config file. Hoping this is the right way to go about it.

@astrojarred
Copy link
Author

Thank you for the detailed review! I will take a look asap and let you know if I have questions.

Copy link
Collaborator

@Aske-Rosted Aske-Rosted 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 to me.

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