KickGroup Informations
Kickgroups
Functions to list KickGroups and show their Kicks.
usage: kickgroups.py [-h] {list,info} ...
KickGroups Functions
optional arguments:
-h, --help show this help message and exit
Functionality:
{list,info}
list List all KickGroups
info Show the info of a given KickGroup
Function list
:
usage: kickgroups.py list [-h] [--root ROOT]
[--sort {TIMESTAMP,KICKGROUP}]
List KickGroups
optional arguments:
-h, --help show this help message and exit
--root ROOT KickGroups Root-Directory
--sort {TIMESTAMP,KICKGROUP}
Sort KickGroups
Function info
:
usage: kickgroups.py info [-h] [--root ROOT] [--files FILES] group
KickGroup Info
positional arguments:
group KickGroup name
optional arguments:
-h, --help show this help message and exit
--root ROOT KickGroups Root-Directory
--files FILES, -f FILES
Optional integer. If a value is given, only show the path
to *files* SDDS files from the group. Use negative values
to show the last files (most recent kicks), positive
values for the first ones. A value of zero means showing
all files in the group.
- pylhc.kickgroups.get_folder_json_files(root: Path | str = PosixPath('/user/slops/data/LHC_DATA/OP_DATA/Betabeat/KickGroups/MULTITURN_ACQ_GROUPS')) List[Path] [source]
Returns a list of all .json files in the folder.
- pylhc.kickgroups.get_kickgroup_info(kick_group: str, root: Path | str = PosixPath('/user/slops/data/LHC_DATA/OP_DATA/Betabeat/KickGroups/MULTITURN_ACQ_GROUPS')) TfsDataFrame [source]
Gather all important info about the KickGroup into a
TfsDataFrame
.- Parameters:
kick_group (
str
) -- the KickGroup name, corresponds to the kickgroup file name without the.json
extension.root (
pathlib.Path
) -- AlternativePath
to the KickGroup folder. (Defaults to theNFS
path of our kickgroups).
- Returns:
A
TfsDataFrame
with the KickGroup information loaded.
- pylhc.kickgroups.list_available_kickgroups(by: str = 'TIMESTAMP', root: Path | str = PosixPath('/user/slops/data/LHC_DATA/OP_DATA/Betabeat/KickGroups/MULTITURN_ACQ_GROUPS'), printout: bool = True) DataFrame [source]
List all available KickGroups in
root
with optional sorting..- Parameters:
by (
str
) -- Column to sort the KickGroups by. Should be either theTIMESTAMP
orKICKGROUP
variable.root (
pathlib.Path
) -- AlternativePath
to the KickGroup folder. (Defaults to theNFS
path of our kickgroups).printout (
bool
) -- whether to print out the dataframe, defaults toTrue
.
- Returns:
A
DataFrame
with the KickGroups loaded, sorted by the provided by parameter.
- pylhc.kickgroups.load_kickfile(kickfile: Path | str) Series [source]
Load the important data from a json kickfile into a
Series
.- Parameters:
kickfile (
Union[Path, str]
) -- the path to the kickfile to load data from.- Returns:
A
Series
with the relevant information loaded from the provided kickfile. The various entries in the Series are defined inpylhc.constants.kickgroups
asKICK_COLUMNS
.
- pylhc.kickgroups.show_kickgroup_files(kick_group: str, nfiles: int = None, root: Path | str = PosixPath('/user/slops/data/LHC_DATA/OP_DATA/Betabeat/KickGroups/MULTITURN_ACQ_GROUPS')) None [source]
Wrapper around
pylhc.kickgroups.get_kickgroup_info
, gathering the relevant information from all kickfiles in the KickGroup and printing only the sdds-filepaths to console.- Parameters:
kick_group (
str
) -- the KickGroup name, corresponds to the kickgroup file name without the.json
extension.nfiles (
int
) -- Number of files to show. Use negative values for the last nfiles. A value of zero or None means all files in the group.root (
pathlib.Path
) -- AlternativePath
to the KickGroup folder. (Defaults to theNFS
path of our kickgroups).
- pylhc.kickgroups.show_kickgroup_info(kick_group: str, root: Path | str = PosixPath('/user/slops/data/LHC_DATA/OP_DATA/Betabeat/KickGroups/MULTITURN_ACQ_GROUPS')) None [source]
Wrapper around
get_kickgroup_info
, gathering the relevant information from the kick files in the group and printing it to console.- Parameters:
kick_group (
str
) -- the KickGroup name, corresponds to the kickgroup file name without the.json
extension.root (
pathlib.Path
) -- AlternativePath
to the KickGroup folder. (Defaults to theNFS
path of our kickgroups).