Skip to content
Snippets Groups Projects

Newton

Merged Laurent Mercadier requested to merge newton into master
1 file
+ 14
7
Compare changes
  • Side-by-side
  • Inline
@@ -9,7 +9,7 @@
import logging
from .constants import mnemonics as _mnemonics
from extra_data import open_run
__all__ = [
'mnemonics_for_run'
]
@@ -17,15 +17,20 @@ __all__ = [
log = logging.getLogger(__name__)
def mnemonics_for_run(run):
def mnemonics_for_run(prop_or_run, runNB=None):
"""
Returns the availble ToolBox mnemonics for a give extra_data
DataCollection
DataCollection, or a given proposal + run number.
Parameters
----------
run: extra_data DataCollection
The run to check for mnemonics
prop_or_run: extra_data DataCollection or int
The run (DataCollection) to check for mnemonics.
Alternatively, the proposal number (int), for which the runNB
is also required.
runNB: int
The run number. Only used if the first argument is the proposal
number.
Returns
-------
@@ -35,9 +40,11 @@ def mnemonics_for_run(run):
Example
-------
>>> import toolbox_scs as tb
>>> run, _ = tb.load(2212, 213)
>>> tb.mnemonics_for_run(run)
>>> tb.mnemonics_for_run(2212, 213)
"""
run = prop_or_run
if runNB is not None:
run = open_run(prop_or_run, runNB)
result = {}
for m in _mnemonics:
version = mnemo_version_index(run, m)
Loading