Exemple #1
0
 def get_class_parameters():
     params = EntryPointParameters()
     params.add_parameter(flags=["--ring"],
                          help="Ring to use.",
                          name="ring",
                          type=int,
                          choices=[1, 2, 3, 4])
     return params
Exemple #2
0
 def get_class_parameters():
     params = EntryPointParameters()
     params.add_parameter(
         flags=["--ring"],
         help="Ring to use.",
         name="ring",
         type=int,
         choices=[1, 2, 3, 4]
     )
     return params
Exemple #3
0
def _get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags=["--accel"],
        help=("Choose the accelerator to use."
              "Can be the class already."),
        name="accel",
        required=True,
        choices=ACCELS.keys(),
    )
    return params
Exemple #4
0
def _get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags=["--accel"],
        help=("Choose the accelerator to use."
              "Can be the class already."
              ),
        name="accel",
        required=True,
        choices=ACCELS.keys(),
    )
    return params
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--dict",
        name="dict",
        type=DictAsString,
        help="Use a dictionary!",
    )
    params.add_parameter(
        flags="--int_or_str",
        name="int_or_str",
        type=get_multi_class(int, str),
        help="either int or string",
    )
    params.add_parameter(
        flags="--bool_or_str",
        name="bool_or_str",
        type=BoolOrString,
        help="either bool or string",
    )
    params.add_parameter(
        flags="--bool_or_list",
        name="bool_or_list",
        type=BoolOrList,
        help="either bool or list",
    )
    return params
Exemple #6
0
def _get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags=["--type"],
        name="type",
        help="Type of model to create, either nominal or best_knowledge",
        choices=("nominal", "best_knowledge", "coupling_correction"),
    )
    params.add_parameter(
        flags=["--output"],
        help="Output path for model, twiss files will be writen here.",
        name="output",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags=["--writeto"],
        help="Path to the file where to write the resulting MAD-X script. ",
        name="writeto",
        type=str,
    )
    params.add_parameter(
        flags=["--logfile"],
        help=("Path to the file where to write the MAD-X script output."
              "If not provided it will be written to sys.stdout."),
        name="logfile",
        type=str,
    )
    return params
Exemple #7
0
 def get_instance_parameters():
     params = EntryPointParameters()
     params.add_parameter(
         flags=["--model_dir", "-m"],
         help="Path to model directory (loads tunes and excitation from model!).",
         name="model_dir",
         type=str,
     )
     params.add_parameter(
         flags=["--nattunex"],
         help="Natural tune X without integer part.",
         name="nat_tune_x",
         type=float,
     )
     params.add_parameter(
         flags=["--nattuney"],
         help="Natural tune Y without integer part.",
         name="nat_tune_y",
         type=float,
     )
     params.add_parameter(
         flags=["--dpp"],
         help="Delta p/p to use.",
         name="dpp",
         default=0.0,
         type=float,
     )
     return params
Exemple #8
0
 def get_class_parameters():
     params = EntryPointParameters()
     params.add_parameter(flags=["--lhcmode"],
                          help=("LHC mode to use. Should be one of: " +
                                str(get_lhc_modes().keys())),
                          name="lhc_mode",
                          type=str,
                          choices=get_lhc_modes().keys())
     params.add_parameter(
         flags=["--beam"],
         help="Beam to use.",
         name="beam",
         type=int,
     )
     return params
Exemple #9
0
 def get_class_parameters():
     params = EntryPointParameters()
     params.add_parameter(
         flags=["--lhcmode"],
         help=("LHC mode to use. Should be one of: " +
               str(get_lhc_modes().keys())),
         name="lhc_mode",
         type=str,
         choices=get_lhc_modes().keys()
     )
     params.add_parameter(
         flags=["--beam"],
         help="Beam to use.",
         name="beam",
         type=int,
     )
     return params
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--corrections",
        help="Path to the directory containing the measurement files.",
        name="corrections",
        nargs="+",
        default=[],
        type=str,
    )
    params.add_parameter(
        flags="--labels",
        help="Path to the directory containing the measurement files.",
        name="labels",
        nargs="+",
        default=[],
        type=str,
    )
    params.add_parameter(
        flags="--model_dir",
        help="Path to the model to use.",
        name="model_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--output_dir",
        help="Path to the model to use.",
        name="output_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
        type=str,
    )

    return params
Exemple #11
0
    def get_instance_parameters():
        params = EntryPointParameters()
        params.add_parameter(
            flags=["--nattunex"],
            help="Natural tune X without integer part.",
            required=True,
            name="nat_tune_x",
            type=float,
        )
        params.add_parameter(
            flags=["--nattuney"],
            help="Natural tune Y without integer part.",
            required=True,
            name="nat_tune_y",
            type=float,
        )
        params.add_parameter(
            flags=["--acd"],
            help="Activate excitation with ACD.",
            name="acd",
            action="store_true",
        )
        params.add_parameter(
            flags=["--drvtunex"],
            help="Driven tune X without integer part.",
            name="drv_tune_x",
            type=float,
        )
        params.add_parameter(
            flags=["--drvtuney"],
            help="Driven tune Y without integer part.",
            name="drv_tune_y",
            type=float,
        )
        params.add_parameter(
            flags=["--energy"],
            help="Energy in Tev.",
            name="energy",
            type=float,
        )

        params.add_parameter(
            flags=["--dpp"],
            help="Delta p/p to use.",
            name="dpp",
            default=0.0,
            type=float,
        )

        params.add_parameter(
            flags=["--optics"],
            help="Path to the optics file to use (modifiers file).",
            name="optics",
            type=str,
        )

        params.add_parameter(
            flags=["--fullresponse"],
            help=("If present, fullresponse template will" +
                  "be filled and put in the output directory."),
            name="fullresponse",
            action="store_true",
        )
        return params
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--meas_dir",
        help="Path to the directory containing the measurement files.",
        name="meas_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--model_dir",
        help="Path to the model to use.",
        name="model_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--corrections_dir",
        help=("Path to the directory containing the correction files. "
              "Defaults to 'measurement_dir'/Corrections if not given."
              ),
        name="corrections_dir",
        type=str,
    )
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
        type=str,
    )
    params.add_parameter(
        flags="--cleanup",
        help="Clean results-folder from corrections.",
        type=bool,
        default=True,
        name="clean_up",
    )
    params.add_parameter(
        flags="--filepattern",
        help="Filepattern to use to find correction files in subfolders.",
        name="file_pattern",
        type=str,
        default=r"^changeparameters.*?\.madx$",
    )
    params.add_parameter(
        flags="--show",
        help="Show plots.",
        action="store_true",
        name="show_plots",
    )
    params.add_parameter(
        flags="--changemarker",
        help="Changes marker for each line in the plot.",
        action="store_true",
        name="change_marker",
    )
    params.add_parameter(
        flags="--autoscale",
        help="Scales the plot, so that this percentage of points is inside the picture.",
        type=float,
        name="auto_scale",
    )
    params.add_parameter(
        flags="--params_cut",
        help="Names of the parameter to cut. Only for specifying the cutting order.",
        name="params",
        nargs="+",
        default=[],
        type=basestring,
    )
    params.add_parameter(
        flags="--model_cut",
        help=("Reject BPMs whose deviation to the model is higher than the "
              "corresponding input."),
        name="model_cut",
        nargs="+",
        default=[],
        type=float,
    )
    params.add_parameter(
        flags="--error_cut",
        help=("Reject BPMs whose error bar is higher than the "
              "corresponding input."),
        name="error_cut",
        nargs="+",
        default=[],
        type=float,
    )
    params.add_parameter(
        flags="--beta_file_name",
        help="Prefix of the beta file to use. E.g.: getkmodbeta",
        name="beta_file_name",
        default="getbeta",
    )
    return params
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--creator",
        help="Create either with madx or analytically from twiss file.",
        name="creator",
        type=str,
        choices=("madx", "twiss"),
        default="madx",
    )
    params.add_parameter(
        flags="--variables",
        help="List of the variables classes to use.",
        name="variable_categories",
        default=DEFAULT_ARGS["variables"],
        nargs="+",
    )
    params.add_parameter(
        flags=["-m", "--model_dir"],
        help="Path to the model directory.",
        name="model_dir",
        required=True,
        type=str
    )
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
    )
    params.add_parameter(
        flags=["-o", "--outfile"],
        help="Name of fullresponse file.",
        name="outfile_path",
        required=True,
        type=str
    )
    params.add_parameter(
        flags=["-k", "--deltak"],
        help="Delta K1L to be applied to quads for sensitivity matrix (madx-only).",
        default=0.00002,
        name="delta_k",
        type=float
    )
    params.add_parameter(
        flags="--optics_params",
        help="List of parameters to correct upon (e.g. BBX BBY; twiss-only).",
        name="optics_params",
        type=str,
        nargs="+",
    )
    params.add_parameter(
        flags="--debug",
        help="Print debug information.",
        name="debug",
        action="store_true",
    )
    return params
Exemple #14
0
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--meas_dir",
        help="Path to the directory containing the measurement files.",
        name="meas_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--model_dir",
        help="Path to the model to use.",
        name="model_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--corrections_dir",
        help=("Path to the directory containing the correction files. "
              "Defaults to 'measurement_dir'/Corrections if not given."
              ),
        name="corrections_dir",
        type=str,
    )
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
        type=str,
    )
    params.add_parameter(
        flags="--cleanup",
        help="Clean results-folder from corrections.",
        type=bool,
        default=True,
        name="clean_up",
    )
    params.add_parameter(
        flags="--filepattern",
        help="Filepattern to use to find correction files in subfolders.",
        name="file_pattern",
        type=str,
        default=r"^changeparameters.*?\.madx$",
    )
    params.add_parameter(
        flags="--show",
        help="Show plots.",
        action="store_true",
        name="show_plots",
    )
    params.add_parameter(
        flags="--changemarker",
        help="Changes marker for each line in the plot.",
        action="store_true",
        name="change_marker",
    )
    params.add_parameter(
        flags="--autoscale",
        help="Scales the plot, so that this percentage of points is inside the picture.",
        type=float,
        name="auto_scale",
    )
    params.add_parameter(
        flags="--params_cut",
        help="Names of the parameter to cut. Only for specifying the cutting order.",
        name="params",
        nargs="+",
        default=[],
        type=basestring,
    )
    params.add_parameter(
        flags="--model_cut",
        help=("Reject BPMs whose deviation to the model is higher than the "
              "corresponding input."),
        name="model_cut",
        nargs="+",
        default=[],
        type=float,
    )
    params.add_parameter(
        flags="--error_cut",
        help=("Reject BPMs whose error bar is higher than the "
              "corresponding input."),
        name="error_cut",
        nargs="+",
        default=[],
        type=float,
    )
    params.add_parameter(
        flags="--beta_file_name",
        help="Prefix of the beta file to use. E.g.: getkmodbeta",
        name="beta_file_name",
        default="getbeta",
    )
    return params
Exemple #15
0
def _get_params_arguments():
    """ Parameters defined with EntryPointArguments (which is a dict *cough*) """
    args = EntryPointParameters()
    args.add_parameter(name="accel",
                       flags=["-a", "--accel"],
                       help="Which accelerator: LHCB1 LHCB2 LHCB4? SPS RHIC TEVATRON",
                       choices=["LHCB1","LHCB2","LHCB5"],
                       default="LHCB1")
    args.add_parameter(name="dict",
                       flags=["-d", "--dictionary"],
                       help="File with the BPM dictionary",
                       default="/test.notafile",
                       type=str)
    args.add_parameter(name="anumber",
                       flags=["-num", "--anum"],
                       help="Just a number.",
                       type=float,
                       default=19.,
                       )
    args.add_parameter(name="anint",
                       flags=["-i", "--int"],
                       help="Just a number.",
                       type=int,
                       required=True,
                       )
    args.add_parameter(name="alist",
                       flags=["-l", "--lint"],
                       help="Just a number.",
                       type=int,
                       nargs="+",
                       required=True,
                       )
    args.add_parameter(name="anotherlist",
                       flags=["-k", "--alint"],
                       help="list.",
                       type=str,
                       nargs=3,
                       ),
    return args
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--machine",
        name="machine",
        type=str,
        choices=["LHC", "HLLHC"],
        default="LHC",
        help="Machine to use",
    )
    params.add_parameter(
        flags="--beams",
        name="beams",
        type=int,
        nargs="*",
        choices=[1, 2],
        required=True,
        help="List of Beams to use",
    )
    params.add_parameter(
        flags="--xing",
        name="xing",
        nargs="+",
        type=BoolOrList,
        required=True,
        help="List of crossing angles to apply. (True=all, False=none)",
    )
    params.add_parameter(
        flags="--otypes",
        name="optic_types",
        type=str,
        nargs="+",
        choices=["3030", "1515", "6015", "4040"],
        required=True,
        help="Optic types to use, e.g. '3030' for 30/30 betastar round optics.",
    )
    params.add_parameter(
        flags="--etypes",
        name="error_types",
        type=list,
        nargs="+",
        required=True,
        help="List of list-of-strings. Defines the errors to activate, e.g. 'A4'.",
    )
    params.add_parameter(
        flags="--elocs",
        name="error_locations",
        type=str,
        nargs="+",
        choices=["ALL", "IP1", "IP5"],
        help=("Defines the error location. "
              "Use 'ALL' for everywhere, 'IP#' for specific IP. "
              "Needs the wise-files to be available for these shananigans."),
    )
    params.add_parameter(
        flags="--seeds",
        name="seeds",
        type=int,
        nargs="+",
        required=True,
        help="List of seeds to use.",
    )
    params.add_parameter(
        flags="--cwd",
        name="cwd",
        type=str,
        required=True,
        help="Path to the current working directory.",
    )
    params.add_parameter(
        flags="--madxout",
        name="madx_out",
        type=str,
        help="Path to the root directory for madx-output.",
    )
    params.add_parameter(
        flags="--edefdir",
        name="errordef_dir",
        type=str,
        required=True,
        help="Path to the error-definition (WISE) files.",
    )
    params.add_parameter(
        flags="--edefmask",
        name="errordef_mask",
        type=str,
        required=True,
        help="Mask of the error-definition (WISE) files.",
    )
    params.add_parameter(
        flags="--moi",
        name="measure_of_interest",
        type=str,
        required=True,
        choices=["ptcrdt", "ptcampdet"],
        help="The measure to investigate. See choices.",
    )
    params.add_parameter(
        flags="--local",
        name="run_local",
        action="store_true",
        help="Flag to run the jobs on the local machine. Not suggested.",
    )
    params.add_parameter(
        flags="--duration",
        name="max_duration",
        help="Maximum duration to allow for htcondor jobs (ignored if run local).",
        default="nextweek",
    )
    params.add_parameter(
        flags="--wother",
        name="with_other_corrections",
        help="do also the other corrections, i.e. from 3030 and other beam.",
        action="store_true",
    )
    params.add_parameter(
        flags="--unstage",
        name="unused_stages",
        type=str,
        nargs="+",
        default=[],
        help="List of unused stages.",
    )
    params.add_parameter(
        flags="--resume",
        name="resume_jobs",
        action="store_true",
        help="Only do jobs that did not work.",
    )
    params.add_parameter(
        flags="--manual",
        name="manual",
        help="Manual override of parameters.",
        type=DictAsString,
        default={},
    )
    return params
Exemple #17
0
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--creator",
        help="Create either with madx or analytically from twiss file.",
        name="creator",
        type=str,
        choices=("madx", "twiss"),
        default="madx",
    )
    params.add_parameter(
        flags="--variables",
        help="List of the variables classes to use.",
        name="variable_categories",
        default=DEFAULT_ARGS["variables"],
        nargs="+",
    )
    params.add_parameter(flags=["-m", "--model_dir"],
                         help="Path to the model directory.",
                         name="model_dir",
                         required=True,
                         type=str)
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
    )
    params.add_parameter(flags=["-o", "--outfile"],
                         help="Name of fullresponse file.",
                         name="outfile_path",
                         required=True,
                         type=str)
    params.add_parameter(
        flags=["-k", "--deltak"],
        help=
        "Delta K1L to be applied to quads for sensitivity matrix (madx-only).",
        default=0.00002,
        name="delta_k",
        type=float)
    params.add_parameter(
        flags="--optics_params",
        help="List of parameters to correct upon (e.g. BBX BBY; twiss-only).",
        name="optics_params",
        type=str,
        nargs="+",
    )
    params.add_parameter(
        flags="--debug",
        help="Print debug information.",
        name="debug",
        action="store_true",
    )
    return params
Exemple #18
0
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--files",
        help="Twiss files to plot",
        name="files",
        required=True,
        nargs="+",
        type=basestring,
    )
    params.add_parameter(
        flags=["-y", "--y_cols"],
        help="List of column names to plot (e.g. BETX, BETY)",
        name="y_cols",
        required=True,
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags=["-x", "--x_cols"],
        help="List of column names to use as x-values.",
        name="x_cols",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags=["-e", "--e_cols"],
        help="List of parameters to get error values from.",
        name="e_cols",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--ylabels",
        help="Y-Lables for the plots, default: column_labels or file_labels.",
        name="y_labels",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--columnlabels",
        help="Column-Lables for the plots, default: y_column.",
        name="column_labels",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--filelabels",
        help="Names for the sources for the plots, default: filenames.",
        name="file_labels",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--output",
        help="Base-Name of the output files. _'y_col'.pdf will be attached.",
        name="output",
        type=basestring,
    )
    params.add_parameter(
        flags="--changemarker",
        help="Changes marker for each line in the plot.",
        action="store_true",
        name="change_marker",
    )
    params.add_parameter(
        flags="--nolegend",
        help="Deactivates the legend.",
        action="store_true",
        name="no_legend",
    )
    params.add_parameter(
        flags="--noshow",
        help="Suppresses opening plotting windows.",
        action="store_true",
        name="no_show",
    )
    params.add_parameter(
        flags="--xy",
        help="Plots X and Y for the give parameters into one figure (two axes).",
        action="store_true",
        name="xy",
    )
    params.add_parameter(
        flags="--autoscale",
        help="Scales the plot, so that this percentage of points is inside the picture.",
        type=float,
        name="auto_scale",
    )
    params.add_parameter(
        flags="--figperfile",
        help="Plots all columns into one figure. (Works only with one file so far).",
        action="store_true",
        name="figure_per_file",
    )
    return params
def _get_plot_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--in",
        help="BBQ data as data frame or tfs file.",
        name="input",
        required=True,
    )
    params.add_parameter(
        flags="--out",
        help="Save figure to this location.",
        name="output",
        type=str,
    )
    params.add_parameter(
        flags="--show",
        help="Show plot.",
        name="show",
        action="store_true"
    )
    params.add_parameter(
        flags="--xmin",
        help="Lower x-axis limit. (yyyy-mm-dd HH:mm:ss.mmm)",
        name="xmin",
        type=str,
    )
    params.add_parameter(
        flags="--ymin",
        help="Lower y-axis limit.",
        name="ymin",
        type=float,
    )
    params.add_parameter(
        flags="--xmax",
        help="Upper x-axis limit. (yyyy-mm-dd HH:mm:ss.mmm)",
        name="xmax",
        type=str,
    )
    params.add_parameter(
        flags="--ymax",
        help="Upper y-axis limit.",
        name="ymax",
        type=float,
    )
    params.add_parameter(
        flags="--interval",
        help="x_axis interval that was used in calculations.",
        name="interval",
        type=str,
        nargs=2,
    )
    params.add_parameter(
        flags="--two",
        help="Plot two axis into the figure.",
        name="two_plots",
        action="store_true",
    )
    return params
def _get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--label",
        help="Label to identify this run.",
        name="label",
        type=str,
    )
    params.add_parameter(
        flags="--beam",
        help="Which beam to use.",
        name="beam",
        required=True,
        type=int,
    )
    params.add_parameter(
        flags="--plane",
        help="Plane of the kicks. 'X' or 'Y'.",
        name="plane",
        required=True,
        choices=PLANES,
        type=str,
    )
    params.add_parameter(
        flags="--timberin",
        help="Fill number of desired data or path to presaved tfs-file",
        name="timber_in",
    )
    params.add_parameter(
        flags="--timberout",
        help="Output location to save fill as tfs-file",
        name="timber_out",
        type=str,
    )
    params.add_parameter(
        flags="--bbqout",
        help="Output location to save bbq data as tfs-file",
        name="bbq_out",
        type=str,
    )
    params.add_parameter(
        flags="--kickac",
        help="Location of the kickac file",
        name="kickac_path",
        type=str,
        required=True,
    )
    params.add_parameter(
        flags="--kickacout",
        help="If given, writes out the modified kickac file",
        name="kickac_out",
        type=str,
    )
    params.add_parameter(
        flags="--window",
        help="Length of the moving average window. (# data points)",
        name="window_length",
        type=int,
        default=20,
    )

    # cleaning method one:
    params.add_parameter(
        flags="--tunex",
        help="Horizontal Tune. For BBQ cleaning.",
        name="tune_x",
        type=float,
    )
    params.add_parameter(
        flags="--tuney",
        help="Vertical Tune. For BBQ cleaning.",
        name="tune_y",
        type=float,
    )
    params.add_parameter(
        flags="--tunecut",
        help="Cuts for the tune. For BBQ cleaning.",
        name="tune_cut",
        type=float,
    )
    # cleaning method two:
    params.add_parameter(
        flags="--tunexmin",
        help="Horizontal Tune minimum. For BBQ cleaning.",
        name="tune_x_min",
        type=float,
    )
    params.add_parameter(
        flags="--tunexmax",
        help="Horizontal Tune minimum. For BBQ cleaning.",
        name="tune_x_max",
        type=float,
    )
    params.add_parameter(
        flags="--tuneymin",
        help="Vertical  Tune minimum. For BBQ cleaning.",
        name="tune_y_min",
        type=float,
    )
    params.add_parameter(
        flags="--tuneymax",
        help="Vertical Tune minimum. For BBQ cleaning.",
        name="tune_y_max",
        type=float,
    )

    # fine cleaning
    params.add_parameter(
        flags="--finewindow",
        help="Length of the moving average window. (# data points)",
        name="fine_window",
        type=int,
    )
    params.add_parameter(
        flags="--finecut",
        help="Cut (i.e. tolerance) of the tune for the fine cleaning.",
        name="fine_cut",
        type=float,
    )

    # Plotting
    params.add_parameter(
        flags="--bbqplot",
        help="Save the bbq plot here.",
        name="bbq_plot_out",
        type=str,
    )
    params.add_parameter(
        flags="--bbqplotshow",
        help="Show the bbq plot.",
        name="bbq_plot_show",
        action="store_true",
    )
    params.add_parameter(
        flags="--bbqplottwo",
        help="Two plots for the bbq plot.",
        name="bbq_plot_two",
        action="store_true",
    )
    params.add_parameter(
        flags="--bbqplotfull",
        help="Plot the full bqq data with interval as lines.",
        name="bbq_plot_full",
        action="store_true",
    )
    params.add_parameter(
        flags="--ampdetplot",
        help="Save the amplitude detuning plot here.",
        name="ampdet_plot_out",
        type=str,
    )
    params.add_parameter(
        flags="--ampdetplotshow",
        help="Show the amplitude detuning plot.",
        name="ampdet_plot_show",
        action="store_true",
    )
    params.add_parameter(
        flags="--ampdetplotymin",
        help="Minimum tune (y-axis) in amplitude detuning plot.",
        name="ampdet_plot_ymin",
        type=float,
    )
    params.add_parameter(
        flags="--ampdetplotymax",
        help="Maximum tune (y-axis) in amplitude detuning plot.",
        name="ampdet_plot_ymax",
        type=float,
    )
    params.add_parameter(
        flags="--ampdetplotxmin",
        help="Minimum action (x-axis) in amplitude detuning plot.",
        name="ampdet_plot_xmin",
        type=float,
    )
    params.add_parameter(
        flags="--ampdetplotxmax",
        help="Maximum action (x-axis) in amplitude detuning plot.",
        name="ampdet_plot_xmax",
        type=float,
    )

    # Debug
    params.add_parameter(
        flags="--debug",
        help="Activates Debug mode",
        name="debug",
        action="store_true",
    )
    params.add_parameter(
        flags="--logfile",
        help="Logfile if debug mode is active.",
        name="logfile",
        type=str,
    )

    return params
Exemple #21
0
 def get_instance_parameters():
     params = EntryPointParameters()
     params.add_parameter(
         flags=["--model_dir", "-m"],
         help="Path to model directory (loads tunes and excitation from model!).",
         name="model_dir",
         type=str,
     )
     params.add_parameter(
         flags=["--nattunex"],
         help="Natural tune X without integer part.",
         name="nat_tune_x",
         type=float,
     )
     params.add_parameter(
         flags=["--nattuney"],
         help="Natural tune Y without integer part.",
         name="nat_tune_y",
         type=float,
     )
     params.add_parameter(
         flags=["--acd"],
         help="Activate excitation with ACD.",
         name="acd",
         action="store_true"
     )
     params.add_parameter(
         flags=["--adt"],
         help="Activate excitation with ADT.",
         name="adt",
         action="store_true",
     )
     params.add_parameter(
         flags=["--drvtunex"],
         help="Driven tune X without integer part.",
         name="drv_tune_x",
         type=float,
     )
     params.add_parameter(
         flags=["--drvtuney"],
         help="Driven tune Y without integer part.",
         name="drv_tune_y",
         type=float,
     )
     params.add_parameter(
         flags=["--dpp"],
         help="Delta p/p to use.",
         name="dpp",
         default=0.0,
         type=float,
     )
     params.add_parameter(
         flags=["--energy"],
         help="Energy in Tev.",
         name="energy",
         type=float,
     )
     params.add_parameter(
         flags=["--optics"],
         help="Path to the optics file to use (modifiers file).",
         name="optics",
         type=str,
     )
     params.add_parameter(
         flags=["--fullresponse"],
         help=("If True, fullresponse template will "
               "be filled and put in the output directory."),
         name="fullresponse",
         action="store_true",
     )
     params.add_parameter(
         flags=["--xing"],
         help="If True, x-ing  angles will be applied to model",
         name="xing",
         action="store_true",
     )
     return params
Exemple #22
0
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--meas_dir",
        help="Path to the directory containing the measurement files.",
        name="meas_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--model_dir",
        help="Path to the model to use.",
        name="model_dir",
        required=True,
        type=str,
    )
    params.add_parameter(
        flags="--corrections_dir",
        help=("Path to the directory containing the correction files. "
              "Defaults to 'measurement_dir'/Corrections if not given."
              ),
        name="corrections_dir",
        type=str,
    )
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
        type=str,
    )
    params.add_parameter(
        flags="--cleanup",
        help="Clean results-folder from corrections.",
        type=bool,
        default=True,
        name="clean_up",
    )
    params.add_parameter(
        flags="--filepattern",
        help="Filepattern to use to find correction files in subfolders.",
        name="file_pattern",
        type=str,
        default=r"^changeparameters.*?\.madx$",
    )
    params.add_parameter(
        flags="--show",
        help="Show plots.",
        action="store_true",
        name="show_plots",
    )
    params.add_parameter(
        flags="--changemarker",
        help="Changes marker for each line in the plot.",
        action="store_true",
        name="change_marker",
    )
    return params
Exemple #23
0
    def get_instance_parameters():
        params = EntryPointParameters()
        params.add_parameter(
            flags=["--nattunex"],
            help="Natural tune X without integer part.",
            required=True,
            name="nat_tune_x",
            type=float,
        )
        params.add_parameter(
            flags=["--nattuney"],
            help="Natural tune Y without integer part.",
            required=True,
            name="nat_tune_y",
            type=float,
        )
        params.add_parameter(
            flags=["--acd"],
            help="Activate excitation with ACD.",
            name="acd",
            action="store_true",
        )
        params.add_parameter(
            flags=["--drvtunex"],
            help="Driven tune X without integer part.",
            name="drv_tune_x",
            type=float,
        )
        params.add_parameter(
            flags=["--drvtuney"],
            help="Driven tune Y without integer part.",
            name="drv_tune_y",
            type=float,
        )
        params.add_parameter(
            flags=["--energy"],
            help="Energy in Tev.",
            name="energy",
            type=float,
        )

        params.add_parameter(
            flags=["--dpp"],
            help="Delta p/p to use.",
            name="dpp",
            default=0.0,
            type=float,
        )

        params.add_parameter(
            flags=["--optics"],
            help="Path to the optics file to use (modifiers file).",
            name="optics",
            type=str,
        )

        params.add_parameter(
            flags=["--fullresponse"],
            help=("If present, fullresponse template will" +
                  "be filled and put in the output directory."),
            name="fullresponse",
            action="store_true",
        )
        return params
def get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--files",
        help="Twiss files to plot",
        name="files",
        required=True,
        nargs="+",
        type=basestring,
    )
    params.add_parameter(
        flags=["-y", "--y_cols"],
        help="List of column names to plot (e.g. BETX, BETY)",
        name="y_cols",
        required=True,
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags=["-x", "--x_cols"],
        help="List of column names to use as x-values.",
        name="x_cols",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags=["-e", "--e_cols"],
        help="List of parameters to get error values from.",
        name="e_cols",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--labels",
        help="Y-Lables for the plots, default: y_col.",
        name="labels",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--legends",
        help="Legends for the plots, default: filenames.",
        name="legends",
        type=basestring,
        nargs="+",
    )
    params.add_parameter(
        flags="--output",
        help="Base-Name of the output files. _'y_col'.pdf will be attached.",
        name="output",
        type=basestring,
    )
    params.add_parameter(
        flags="--changemarker",
        help="Changes marker for each line in the plot.",
        action="store_true",
        name="change_marker",
    )
    params.add_parameter(
        flags="--nolegend",
        help="Deactivates the legend.",
        action="store_true",
        name="no_legend",
    )
    params.add_parameter(
        flags="--noshow",
        help="Suppresses opening plotting windows.",
        action="store_true",
        name="no_show",
    )
    params.add_parameter(
        flags="--xy",
        help=
        "Plots X and Y for the give parameters into one figure (two axes).",
        action="store_true",
        name="xy",
    )
    params.add_parameter(
        flags="--autoscale",
        help=
        "Scales the plot, so that this percentage of points is inside the picture.",
        type=float,
        name="auto_scale",
    )
    return params
Exemple #25
0
 def get_instance_parameters():
     params = EntryPointParameters()
     params.add_parameter(
         flags=["--model_dir", "-m"],
         help=
         "Path to model directory (loads tunes and excitation from model!).",
         name="model_dir",
         type=str,
     )
     params.add_parameter(
         flags=["--nattunex"],
         help="Natural tune X without integer part.",
         name="nat_tune_x",
         type=float,
     )
     params.add_parameter(
         flags=["--nattuney"],
         help="Natural tune Y without integer part.",
         name="nat_tune_y",
         type=float,
     )
     params.add_parameter(flags=["--acd"],
                          help="Activate excitation with ACD.",
                          name="acd",
                          action="store_true")
     params.add_parameter(
         flags=["--adt"],
         help="Activate excitation with ADT.",
         name="adt",
         action="store_true",
     )
     params.add_parameter(
         flags=["--drvtunex"],
         help="Driven tune X without integer part.",
         name="drv_tune_x",
         type=float,
     )
     params.add_parameter(
         flags=["--drvtuney"],
         help="Driven tune Y without integer part.",
         name="drv_tune_y",
         type=float,
     )
     params.add_parameter(
         flags=["--dpp"],
         help="Delta p/p to use.",
         name="dpp",
         default=0.0,
         type=float,
     )
     params.add_parameter(
         flags=["--energy"],
         help="Energy in Tev.",
         name="energy",
         type=float,
     )
     params.add_parameter(
         flags=["--optics"],
         help="Path to the optics file to use (modifiers file).",
         name="optics",
         type=str,
     )
     params.add_parameter(
         flags=["--fullresponse"],
         help=("If True, fullresponse template will "
               "be filled and put in the output directory."),
         name="fullresponse",
         action="store_true",
     )
     params.add_parameter(
         flags=["--xing"],
         help="If True, x-ing  angles will be applied to model",
         name="xing",
         action="store_true",
     )
     return params
def _get_params():
    params = EntryPointParameters()
    params.add_parameter(
        flags="--meas_dir",
        help="Path to the directory containing the measurement files.",
        name="meas_dir",
        required=True,
    )
    params.add_parameter(
        flags="--model_dir",
        help="Path to the model to use.",
        name="model_dir",
        required=True,
    )
    params.add_parameter(
        flags="--fullresponse",
        help=("Path to the fullresponse binary file."
              " If not given, calculates the response analytically."),
        name="fullresponse_path",
    )
    params.add_parameter(
        flags="--update_response",
        help="If True, it will update the (analytical) response per iteration.",
        name="update_response",
        action="store_true",
    )
    params.add_parameter(
        flags="--optics_params",
        help="List of parameters to correct upon (e.g. BBX BBY)",
        name="optics_params",
        type=str,
        nargs="+",
        default=DEFAULT_ARGS["optics_params"],
    )
    params.add_parameter(
        flags="--optics_file",
        help=("Path to the optics file to use. If not present will default to "
              "model_path/modifiers.madx, if such a file exists."),
        name="optics_file",
    )
    params.add_parameter(
        flags="--output_dir",
        help=("Path to the directory where to write the output files, will "
              "default to the --meas input path."),
        name="output_path",
        default=DEFAULT_ARGS["output_path"],
    )
    params.add_parameter(
        flags="--output_filename",
        help="Identifier of the output files.",
        name="output_filename",
        default=DEFAULT_ARGS["output_filename"],
    )
    params.add_parameter(
        flags="--svd_cut",
        help=("Cutoff for small singular values of the pseudo inverse. (Method: 'pinv')"
              "Singular values smaller than rcond*largest_singular_value are set to zero"),
        name="svd_cut",
        type=float,
        default=DEFAULT_ARGS["svd_cut"],
    )
    params.add_parameter(
        flags="--model_cut",
        help=("Reject BPMs whose deviation to the model is higher than the "
              "correspoding input. Input in order of optics_params."),
        name="modelcut",
        nargs="+",
        type=float,
    )
    params.add_parameter(
        flags="--error_cut",
        help=("Reject BPMs whose error bar is higher than the "
              "corresponding input. Input in order of optics_params."),
        name="errorcut",
        nargs="+",
        type=float,
    )
    params.add_parameter(
        flags="--weights",
        help=("Weight to apply to each measured quantity. "
              "Input in order of optics_params."),
        name="weights",
        nargs="+",
        type=float,
    )
    params.add_parameter(
        flags="--use_errorbars",
        help=("If True, it will take into account the measured errorbars "
              "in the correction."),
        name="use_errorbars",
        action="store_true",
    )
    params.add_parameter(
        flags="--variables",
        help="List of names of the variables classes to use.",
        name="variable_categories",
        nargs="+",
        default=DEFAULT_ARGS["variables"],
    )
    params.add_parameter(
        flags="--beta_file_name",
        help="Prefix of the beta file to use. E.g.: getkmodbeta",
        name="beta_file_name",
        default=DEFAULT_ARGS["beta_file_name"],
    )
    params.add_parameter(
        flags="--virt_flag",
        help="If true, it will use virtual correctors.",
        name="virt_flag",
        action="store_true",
    )
    params.add_parameter(
        flags="--method",
        help="Optimization method to use. (Not implemented yet)",
        name="method",
        type=str,
        default=DEFAULT_ARGS["method"],
        choices=["pinv"]
    )
    params.add_parameter(
        flags="--max_iter",
        help=("Maximum number of correction re-iterations to perform."
              "A value of `0` means the correction is calculated once (like in the old days)."),
        name="max_iter",
        type=int,
        default=DEFAULT_ARGS["max_iter"],
    )
    params.add_parameter(
        flags="--eps",
        help=("Convergence criterion." 
              "If <|delta(PARAM * WEIGHT)|> < eps, stop iteration.(Not implemented yet)"),
        name="eps",
        type=float,
        default=DEFAULT_ARGS["eps"],
    )
    params.add_parameter(
        flags="--debug",
        help="Print debug information.",
        name="debug",
        action="store_true",
    )
    return params
def _get_params_arguments():
    """ Parameters defined with EntryPointArguments (which is a dict *cough*) """
    args = EntryPointParameters()
    args.add_parameter(name="accel",
                       flags=["-a", "--accel"],
                       help="Which accelerator: LHCB1 LHCB2 LHCB4? SPS RHIC TEVATRON",
                       choices=["LHCB1","LHCB2","LHCB5"],
                       default="LHCB1")
    args.add_parameter(name="dict",
                       flags=["-d", "--dictionary"],
                       help="File with the BPM dictionary",
                       default="/test.notafile",
                       type=str)
    args.add_parameter(name="anumber",
                       flags=["-num", "--anum"],
                       help="Just a number.",
                       type=float,
                       default=19.,
                       )
    args.add_parameter(name="anint",
                       flags=["-i", "--int"],
                       help="Just a number.",
                       type=int,
                       required=True,
                       )
    args.add_parameter(name="alist",
                       flags=["-l", "--lint"],
                       help="Just a number.",
                       type=int,
                       nargs="+",
                       required=True,
                       )
    args.add_parameter(name="anotherlist",
                       flags=["-k", "--alint"],
                       help="list.",
                       type=str,
                       nargs=3,
                       ),
    return args