コード例 #1
0
ファイル: BB_lib.py プロジェクト: wvangoet/dispersionbeating
def get_positions_of_quads():
    f1 = cl2madx.tfs2pd('pfw_25.txt')
    Table1 = f1.iloc[0].TABLE
    table1 = Table1.to_numpy()

    idx_ssz = []
    ssz = []
    delta = [1.486343, 2.886343]
    for i, elem in enumerate(table1[1:, 0]):
        if elem.startswith('PS') and elem.endswith('START'):
            if (elem[3] == '1') or (elem[3] == '6'):
                ssz.append(table1[i, 2] + delta[1])
                idx_ssz.append(i)
            else:
                ssz.append(table1[i, 2] + delta[0])
                idx_ssz.append(i)
    ssz = np.asarray(np.sort(ssz))

    return ssz
コード例 #2
0
import numpy as np
import pickle
#import pandas
from zoopt import ExpOpt
from scipy.interpolate import interp1d
from cpymad.madx import Madx
from cl2pd import madx as cl2madx
import collections
from BB_lib import *

f1 = cl2madx.tfs2pd('pfw_25.txt')
Table1 = f1.iloc[0].TABLE
table1 = Table1.to_numpy()

idx_ssz = []
ssz = []
delta = [1.486343, 2.886343]
for i, elem in enumerate(table1[1:, 0]):
    if elem.startswith('PS') and elem.endswith('START'):
        if (elem[3] == '1') or (elem[3] == '6'):
            ssz.append(table1[i, 2] + delta[1])
            idx_ssz.append(i)
        else:
            ssz.append(table1[i, 2] + delta[0])
            idx_ssz.append(i)
ssz = np.asarray(np.sort(ssz))

s_possible = np.asarray([
    0, 4, 5, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21, 24, 25, 26, 27, 30, 31,
    34, 35, 38, 39, 44, 45, 48, 49, 50, 54, 55, 58, 59, 62, 64, 66, 67, 70, 71,
    74, 76, 77, 80, 81, 84, 85, 88, 89, 94, 95, 98, 99
コード例 #3
0
                             
                             #'FN99','DN00'])  
 
 focusing_list2 = np.asarray(['FN05','DW06','FN09','DN10','FW17','DW18','FN21','DW22',
                             'FW27','DW28','FW31','DW32','FN35','DN36','FN39','DN40','FN45','DN46',
                             'FN49','DN50','FN55','DW56','FW59','DW60','FN67','DN68','FN71',
                             'DN72','FN77','DN78','FN81','DN82','FN85','DN86','FN89','DN90','FN95','DN96',
                             'TN01','TN11','TN12','TN13','MN14','TN15','MN25','MN26','TN51','MN63','TN65','TN75','FN99','DN00'])
 
 # focusing_list = np.asarray(['FN05','DW06','FN09','DN10','FW17','DW18','FN21','DW22','FW27',
 #                             'DW28','FW31','DW32','FN35','DN36','FN39','DN40','FN45','DN46',
 #                             'FN49','DN50','FN55','DW56','FW59','DW60','FN67','DN68','FN71',
 #                             'DN72','FN77','DN78','FN81','DN82','FN85','DN86','FN89','DN90',
 #                             'FN95','DN96','FN99','DN00'])  
 
 f1 = madx.tfs2pd('pfw_25.txt')
 Table1=f1.iloc[0].TABLE
 table1 = Table1.to_numpy()
 
 
 # f2 = madx.tfs2pd('sol0.txt')
 # f3 = madx.tfs2pd('sol610.txt')
 # f4 = madx.tfs2pd('sol2.txt')
 # f5 = madx.tfs2pd('sol3.txt')
 
 # table2 = f2.iloc[0].TABLE.to_numpy()
 # table3 = f3.iloc[0].TABLE.to_numpy()
 # table4 = f4.iloc[0].TABLE.to_numpy()
 # table5 = f5.iloc[0].TABLE.to_numpy()
 
 # table2 = table2[[i for i,e in enumerate(table2[:,0]) if e in table1[:,0]],:]
コード例 #4
0
focusing_list2 = np.asarray([
    'FN05', 'DW06', 'FN09', 'DN10', 'FW17', 'DW18', 'FN21', 'DW22', 'FW27',
    'DW28', 'FW31', 'DW32', 'FN35', 'DN36', 'FN39', 'DN40', 'FN45', 'DN46',
    'FN49', 'DN50', 'FN55', 'DW56', 'FW59', 'DW60', 'FN67', 'DN68', 'FN71',
    'DN72', 'FN77', 'DN78', 'FN81', 'DN82', 'FN85', 'DN86', 'FN89', 'DN90',
    'FN95', 'DN96', 'TN01', 'TN11', 'TN12', 'TN13', 'MN14', 'TN15', 'MN25',
    'MN26', 'TN51', 'MN63', 'TN65', 'TN75', 'FN99', 'DN00'
])

# focusing_list = np.asarray(['FN05','DW06','FN09','DN10','FW17','DW18','FN21','DW22','FW27',
#                             'DW28','FW31','DW32','FN35','DN36','FN39','DN40','FN45','DN46',
#                             'FN49','DN50','FN55','DW56','FW59','DW60','FN67','DN68','FN71',
#                             'DN72','FN77','DN78','FN81','DN82','FN85','DN86','FN89','DN90',
#                             'FN95','DN96','FN99','DN00'])

f1 = madx.tfs2pd('twiss_no_error.txt')
Table1 = f1.iloc[0].TABLE
table1 = Table1.to_numpy()

f2 = madx.tfs2pd('sol0.txt')
f3 = madx.tfs2pd('sol1.txt')
f4 = madx.tfs2pd('sol2.txt')
f5 = madx.tfs2pd('sol3.txt')

table2 = f2.iloc[0].TABLE.to_numpy()
table3 = f3.iloc[0].TABLE.to_numpy()
table4 = f4.iloc[0].TABLE.to_numpy()
table5 = f5.iloc[0].TABLE.to_numpy()

table2 = table2[[i for i, e in enumerate(table2[:, 0])
                 if e in table1[:, 0]], :]