-
Notifications
You must be signed in to change notification settings - Fork 35
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
Documentation / poetry improvements and fixes #773
Merged
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
66942b8
add instructions to install development version with pip
sjoerd-bouma 89e0105
improve installation of optional dependencies
sjoerd-bouma 1ab79e5
improve and update some installation documentation
sjoerd-bouma 3c54d3a
update documentation of optional dependencies
sjoerd-bouma 5293ae7
Merge branch 'develop' of github.com:nu-radio/NuRadioMC into poetry/i…
sjoerd-bouma e0d5e61
add missing pre_trigger_times to trigger subclass docstrings
sjoerd-bouma a9b2787
reduce toctree maxdepth for API documentation
sjoerd-bouma bada1f9
add some more documentation for db_mongo_read
sjoerd-bouma 78af870
tidy up times.rst somewhat
sjoerd-bouma 2dba3b8
remove unused debug argument
sjoerd-bouma be43926
Merge branch 'develop' of github.com:nu-radio/NuRadioMC into poetry/i…
sjoerd-bouma b703b62
improve documentation of trigger times
sjoerd-bouma d24a6af
further clean up of times documentation
sjoerd-bouma 2c7d8d8
fix documentation table header formatting
sjoerd-bouma 822bad8
add option to install all optional dependencies via pip
sjoerd-bouma d57e9ae
Merge branch 'develop' of github.com:nu-radio/NuRadioMC into poetry/i…
sjoerd-bouma ddec519
[doc] minor changes to times.rst
sjoerd-bouma f05ed18
[doc] minor docstring fixes
sjoerd-bouma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,19 @@ def set_trigger_time(self, time): | |
|
||
def get_trigger_time(self): | ||
""" | ||
get the trigger time (absolute time with respect to the beginning of the event) | ||
Get the trigger time | ||
|
||
Returns the absolute time of the trigger with respect to the beginning of the event, | ||
i.e. the first time in the event where the trigger condition was fulfilled | ||
sjoerd-bouma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Returns | ||
------- | ||
trigger_time : float | ||
The trigger time | ||
|
||
See Also | ||
-------- | ||
get_trigger_times : function to return all times where the trigger condition was fulfilled | ||
""" | ||
return self._trigger_time | ||
|
||
|
@@ -119,7 +131,22 @@ def set_trigger_times(self, times): | |
|
||
def get_trigger_times(self): | ||
""" | ||
get the trigger times (time with respect to beginning of trace) | ||
Get the trigger times | ||
|
||
For some triggers, in addition to the time of the first trigger, | ||
also all subsequent times where the trigger condition were fulfilled are | ||
Comment on lines
+136
to
+137
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we not duplicate a remark there that the trigger time is relative to the station_time? |
||
stored. For triggers that do not store this information, this method | ||
is equivalent to `get_trigger_time` with the exception that it returns | ||
an array (of shape (1,)) instead of a scalar. | ||
|
||
Returns | ||
------- | ||
trigger_times : np.ndarray | ||
Array of all times where the trigger condition was satisfied | ||
|
||
See Also | ||
-------- | ||
get_trigger_time : method to return the (first) trigger time | ||
""" | ||
if self._trigger_times is None and not np.isnan(self._trigger_time): | ||
return np.array(self._trigger_time) | ||
|
@@ -231,6 +258,12 @@ def __init__(self, name, threshold, channels=None, number_of_coincidences=1, | |
default: 1 | ||
channel_coincidence_window: float or None (default) | ||
the coincidence time between triggers of different channels | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, channels, 'simple_threshold', pre_trigger_times=pre_trigger_times) | ||
self._threshold = threshold | ||
|
@@ -269,6 +302,12 @@ def __init__(self, name, threshold_factor, power_mean, power_std, | |
output_passband: (float, float) tuple | ||
Frequencies for a 6th-order Butterworth filter to be applied after | ||
the diode filtering. | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, triggered_channels, 'envelope_phased', pre_trigger_times=pre_trigger_times) | ||
self._triggered_channels = triggered_channels | ||
|
@@ -318,6 +357,12 @@ def __init__(self, name, threshold, channels=None, secondary_channels=None, | |
the size of the stride between calculating the phasing (units of ADC time ticks) | ||
maximum_amps: list of floats (length equal to that of `phasing_angles`) | ||
the maximum value of all the integration windows for each of the phased waveforms | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, channels, 'simple_phased', pre_trigger_times=pre_trigger_times) | ||
self._primary_channels = channels | ||
|
@@ -357,6 +402,12 @@ def __init__(self, name, threshold_high, threshold_low, high_low_window, | |
number_of_coincidences: int | ||
the number of channels that need to fulfill the trigger condition | ||
default: 1 | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, channels, 'high_low', pre_trigger_times=pre_trigger_times) | ||
self._number_of_coincidences = number_of_coincidences | ||
|
@@ -387,6 +438,12 @@ def __init__(self, name, threshold, channel_coincidence_window, channels=None, n | |
number_of_coincidences: int | ||
the number of channels that need to fulfill the trigger condition | ||
default: 1 | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, channels, 'int_power', pre_trigger_times=pre_trigger_times) | ||
self._number_of_coincidences = number_of_coincidences | ||
|
@@ -422,6 +479,12 @@ def __init__(self, name, passband, order, threshold, number_of_coincidences=2, | |
default: 1 | ||
channel_coincidence_window: float or None (default) | ||
the coincidence time between triggers of different channels | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, channels, 'envelope_trigger', pre_trigger_times=pre_trigger_times) | ||
self._passband = passband | ||
|
@@ -433,7 +496,8 @@ def __init__(self, name, passband, order, threshold, number_of_coincidences=2, | |
class RNOGSurfaceTrigger(Trigger): | ||
from NuRadioReco.utilities import units | ||
def __init__(self, name, threshold, number_of_coincidences=1, | ||
channel_coincidence_window=60*units.ns, channels=[13, 16, 19], temperature=250*units.kelvin, Vbias=2*units.volt, pre_trigger_times=55 * units.ns): | ||
channel_coincidence_window=60*units.ns, channels=[13, 16, 19], | ||
temperature=250*units.kelvin, Vbias=2*units.volt, pre_trigger_times=55 * units.ns): | ||
""" | ||
initialize trigger class | ||
|
||
|
@@ -455,6 +519,12 @@ def __init__(self, name, threshold, number_of_coincidences=1, | |
temperature of the trigger board | ||
Vbias: float | ||
bias voltage on the trigger board | ||
pre_trigger_times: float or dict of floats | ||
the time before the trigger time that should be read out | ||
if a dict is given, the keys are the channel_ids, and the value is the pre_trigger_time between the | ||
start of the trace and the trigger time. | ||
if only a float is given, the same pre_trigger_time is used for all channels | ||
|
||
""" | ||
Trigger.__init__(self, name, channels, 'rnog_surface_trigger', pre_trigger_times=pre_trigger_times) | ||
self._threshold = threshold | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,8 +213,11 @@ def __init__(self, run_table_path=None, load_run_table=True, log_level=logging.N | |
self.logger.warn("No connect to RunTable database could be established. " | ||
"Runs can not be filtered.") | ||
except ImportError: | ||
self.logger.warn("Import of run table failed. Runs can not be filtered.! \n" | ||
"You can get the interface from GitHub: [email protected]:RNO-G/rnog-runtable.git") | ||
self.logger.warn( | ||
"import run_table failed. You can still use readRNOGData, but runs can not be filtered. " | ||
"To install the run table, run\n\n" | ||
"\tpip install git+ssh://[email protected]/RNO-G/rnog-runtable.git\n" | ||
) | ||
else: | ||
# some users may mistakenly try to pass the .root files to __init__ | ||
# we check for this and raise a (hopefully) helpful error message | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, I think with the PR #788 I am adding a wrapper around this function within the detector class which probably should be used by users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe you can update this docstring / the module docstring in #788? Feel free to copy and paste stuff from here if you think it applies.