Ejemplo n.º 1
0
def _write_sbs_data_for_matchers(input_data):
    for matcher in input_data.matchers:
        for beam in matcher.get_beams():
            _write_sbs_data(beam, str(matcher.get_ip()),
                            matcher.get_match_data(beam).get_beam_match_path(),
                            matcher.get_match_data(beam).get_range_start_name(),
                            )
Ejemplo n.º 2
0
def _manipulate_twiss_cors(input_data, function):
    for matcher in input_data.matchers:
        for beam in matcher.get_beams():
            matcher_path = matcher.get_match_data(beam).get_beam_match_path()
            matcher_path_sbs = os.path.join(matcher_path, "sbs")
            if os.path.isdir(matcher_path_sbs):
                twiss_cor_path = os.path.join(
                    matcher_path_sbs,
                    "twiss_IP" + str(matcher.get_ip()) + "_cor.dat"
                )
                function(twiss_cor_path)
                twiss_cor_back_path = os.path.join(
                    matcher_path_sbs,
                    "twiss_IP" + str(matcher.get_ip()) + "_cor_back.dat"
                )
                function(twiss_cor_back_path)