Example #1
0
def _create_input_ps():
    iotools.create_dirs(BASE_OUTPUT)
    iotools.copy_item(join(PS_MODEL, "elements.str"),
                      join(BASE_OUTPUT, "elements.str"))
    iotools.copy_item(join(PS_MODEL, "PS_LE_LHC_low_chroma.str"),
                      join(BASE_OUTPUT, "strengths.madx"))
    iotools.write_string_into_new_file(
        join(BASE_OUTPUT, MODIFIERS_MADX),
        f"call, file='{join(BASE_OUTPUT, 'elements.str')}';\n"
        f"call, file='{join(BASE_OUTPUT, 'strengths.madx')}';\n")
Example #2
0
def copy_calibration_files(outputdir, calibrationdir):
    if calibrationdir is None:
        return None
    calibs = {}
    for plane in PLANES:
        cal_file = f"calibration_{plane.lower()}.out"
        iotools.copy_item(os.path.join(calibrationdir, cal_file),
                          os.path.join(outputdir, cal_file))
        calibs[plane] = tfs.read(os.path.join(outputdir,
                                              cal_file)).set_index("NAME")
    return calibs
Example #3
0
def _create_input_lhc():
    iotools.create_dirs(BASE_OUTPUT)
    iotools.copy_item(join(COMP_MODEL, "opticsfile.24_ctpps2"),
                      join(BASE_OUTPUT, "strengths.madx"))
    iotools.write_string_into_new_file(
        join(BASE_OUTPUT, MODIFIERS_MADX),
        f"call, file='{join(BASE_OUTPUT, 'strengths.madx')}';\n")
    iotools.write_string_into_new_file(join(BASE_OUTPUT, "corrections.madx"),
                                       "\n")
    iotools.write_string_into_new_file(join(BASE_OUTPUT, "extracted_mqts.str"),
                                       "\n")