Skip to content

Commit 458d3ab

Browse files
JoschDjgray-19
andauthored
Twiss Elements: Select ALL (#492)
We noticed that in the twiss elements the hkicker and vkicker magnets are missing. Instead of adding each class individually (and potentially missing some) we could just do a select, flag=twiss, clear; and output all. The file-size for the LHC changes from 7.1MB to 8.3MB which is acceptable, imho. If we really cared about the file-size we could remove the Drifts (pattern="^[^D].*" probably). It seems the issue with IP2/8 was due to the model_elements not containing some elements. So this PR fixes that, and tests the IP2/8 data that we tried in the CCC. --------- Co-authored-by: Joshua Gray <[email protected]> Co-authored-by: jgray-19 <[email protected].
1 parent 0c8de3c commit 458d3ab

38 files changed

+9152
-4868
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# OMC3 Changelog
22

3-
#### Unreleased -
3+
#### 2025-04-01 - v0.23.01 - _jdilly_, _jgray_
4+
5+
- Changed:
6+
- `twiss_elements` via macro now contain all elements in the sequence.
7+
8+
- Fixed:
9+
- `check_corrections` does not error when different markers in the model and the measurement.
410

511
- Added:
612
- Bad BPMs summary: NANS reason.

omc3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
__title__ = "omc3"
1212
__description__ = "An accelerator physics tools package for the OMC team at CERN."
1313
__url__ = "https://github.com/pylhc/omc3"
14-
__version__ = "0.23.0"
14+
__version__ = "0.23.1"
1515
__author__ = "pylhc"
1616
__author_email__ = "[email protected]"
1717
__license__ = "MIT"

omc3/check_corrections.py

Lines changed: 248 additions & 132 deletions
Large diffs are not rendered by default.

omc3/model/madx_macros/general.macros.madx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,11 @@ select_monitors(): macro = {
3030
*/
3131
select_elements(): macro = {
3232
select, flag=twiss, clear;
33-
select, flag=twiss, class=monitor, column=name, s, betx, alfx, bety, alfy,
34-
mux, muy, dx, dy, dpx, dpy, x, y, ddx, ddy,
35-
k1l, k1sl, k2l, k3l, k4l, wx, wy, phix,
36-
phiy, dmux, dmuy, keyword, dbx, dby,
37-
r11, r12, r21, r22;
38-
select, flag=twiss, class=monitor;
39-
select, flag=twiss, class=instrument;
40-
select, flag=twiss, class=marker;
41-
select, flag=twiss, class=quadrupole;
42-
select, flag=twiss, class=skewquadrupole;
43-
select, flag=twiss, class=sextupole;
44-
select, flag=twiss, class=octupole;
45-
select, flag=twiss, class=multipole;
46-
select, flag=twiss, class=tkicker;
47-
select, flag=twiss, class=rcollimator;
48-
select, flag=twiss, class=collimator;
49-
select, flag=twiss, class=rbend;
50-
select, flag=twiss, class=drift;
33+
select, flag=twiss, column=name, s, betx, alfx, bety, alfy,
34+
mux, muy, dx, dy, dpx, dpy, x, y, ddx, ddy,
35+
k1l, k1sl, k2l, k3l, k4l, wx, wy, phix,
36+
phiy, dmux, dmuy, keyword, dbx, dby,
37+
r11, r12, r21, r22;
5138
}
5239

5340

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@ Q1 %le 0.28
2+
@ Q2 %le 0.31
3+
* NAME S BETXMDL BETX ERRBETX DELTABETXMDL DELTABETX ERRDELTABETX
4+
$ %s %le %le %le %le %le %le %le
5+
"MQXA.1L2" 169.958 62.88101972 77.3774965795 0.0635708649554 14.4964768595 0.230538196169 0.00101097064326
6+
"BPMSW.1L2.B1" 171.328 56.76438139 56.5958703237 0.0466001573307 -0.1685110663 -0.00296860570262 0.000820940106975
7+
"BPMSW.1L2.B1_DOROS" 171.328 56.76438139 56.5958703237 0.0466001573307 -0.1685110663 -0.00296860570262 0.000820940106975
8+
"MBXWT.1L2" 173.198 49.02186243 52.137886348 0.0429567783221 3.116023918 0.0635639643934 0.000876277974617
9+
"MBWMD.1L2" 183.483 18.95158114 22.6969687316 0.0188080872953 3.7453875916 0.19762929351 0.000992428397207
10+
"IP2" 192.923 9.990333754 10.7511486109 0.0087747799167 0.7608148569 0.0761550990822 0.000878327004159
11+
"MBAW.1R2" 204.9433 24.40065371 18.562226406 0.0153793971702 -5.838427304 -0.239273397073 0.000630286276466
12+
"MBXWT.1R2" 214.178 55.11894745 47.6953203901 0.0393243492902 -7.4236270599 -0.134683759457 0.000713445214567
13+
"BPMSW.1R2.B1" 214.518 56.57577933 51.9137223559 0.0427735354334 -4.6620569741 -0.0824037605723 0.000756039703561
14+
"BPMSW.1R2.B1_DOROS" 214.518 56.57577933 51.9137223559 0.0427735354334 -4.6620569741 -0.0824037605723 0.000756039703561
15+
"MQXA.1R2" 222.258 129.0787338 71.7077503717 0.0589424366204 -57.3709834283 -0.444465031065 0.000456639408252
16+
"BPMSW.1L5.B1" 10168.21165 2119.16672 2147.24911571 2.33009296872 28.08239571 0.0132516217082 0.00109953263551
17+
"IP5" 10189.77565 0.2194418099 0.258777640929 0.00816616114174 0.039335831029 0.179254040271 0.0372133329809
18+
"BPMSW.1R5.B1" 10211.33965 2119.37894 2110.19927604 2.30182507409 -9.17966396 -0.00433129903612 0.00108608471597
19+
"MQXA.1L8" 20152.9004 265.146913 358.560028927 0.288360102418 93.413115927 0.352307009235 0.00108754840536
20+
"BPMSW.1L8.B1" 20154.2704 234.6832947 243.99779326 0.217849785992 9.31449856 0.0396896531213 0.000928271380673
21+
"BPMSW.1L8.B1_DOROS" 20154.2704 234.6832947 243.99779326 0.217849785992 9.31449856 0.0396896531213 0.000928271380673
22+
"MBXWS.1L8" 20155.4904 209.1321222 225.505344034 0.206141350439 16.373221834 0.0782912814242 0.000985699127759
23+
"MBXWH.1L8" 20172.3154 8.282499733 15.0238790269 0.0400565891838 6.7413792939 0.813930517503 0.00483629223967
24+
"IP8" 20175.8654 2.003665923 1.91872011491 0.00251467062254 -0.08494580809 -0.0423951952843 0.00125503488065
25+
"MBLW.1R8" 20183.6154 32.00384178 18.2014378074 0.0448167222593 -13.8024039726 -0.431273347352 0.00140035445017
26+
"MBXWS.1R8" 20197.0204 225.4267671 238.073345573 0.214112106474 12.646578473 0.0561006070206 0.000949807821087
27+
"BPMSW.1R8.B1_DOROS" 20197.4604 234.8159331 257.068151711 0.226055115335 22.252218611 0.0947645175403 0.000962690701396
28+
"BPMSW.1R8.B1" 20197.4604 234.8159331 257.068151711 0.226055115335 22.252218611 0.0947645175403 0.000962690701396
29+
"MQXA.1R8" 20205.2004 577.6246886 374.3872979 0.297911683102 -203.2373907 -0.351850249325 0.000515753029574
30+
"BPMSW.1L1.B1" 23497.79062 2113.961148 2099.17870466 2.33597644249 -14.78244334 -0.00699276964195 0.00110502335613
31+
"IP1" 23519.36962 0.2202900763 0.256423730281 0.00751596559194 0.036133653981 0.164027606635 0.0341184937523
32+
"BPMSW.1R1.B1" 23540.93362 2111.195498 2063.23351864 2.30786092804 -47.96197936 -0.0227179242308 0.00109315358536
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@ Q1 %le 0.28
2+
@ Q2 %le 0.31
3+
* NAME S BETYMDL BETY ERRBETY DELTABETYMDL DELTABETY ERRDELTABETY
4+
$ %s %le %le %le %le %le %le %le
5+
"MQXA.1L2" 169.958 62.85326745 80.974520448 0.0752792348908 18.121252998 0.288310436882 0.00119769803456
6+
"BPMSW.1L2.B1" 171.328 56.74223816 58.6687626939 0.0555119078711 1.9265245339 0.0339522126087 0.00097831720551
7+
"BPMSW.1L2.B1_DOROS" 171.328 56.74223816 58.6687626939 0.0555119078711 1.9265245339 0.0339522126087 0.00097831720551
8+
"MBXWT.1L2" 173.198 49.00670166 53.8889203918 0.0512483746948 4.8822187318 0.0996234916129 0.00104574217319
9+
"MBWMD.1L2" 183.483 18.96092407 22.4196721616 0.0223714116358 3.4587480916 0.182414532057 0.00117986926973
10+
"IP2" 192.923 10.00146384 9.92151246225 0.0086856272865 -0.07995137775 -0.00799396758605 0.000868435603573
11+
"MBAW.1R2" 204.9433 24.38537787 18.7618314799 0.0187469785039 -5.6235463901 -0.230611410661 0.000768779495804
12+
"MBXWT.1R2" 214.178 55.06156096 50.7134265925 0.0484074929773 -4.3481343675 -0.0789685997217 0.000879152209514
13+
"BPMSW.1R2.B1" 214.518 56.51648046 55.322018497 0.0525281418329 -1.194461963 -0.0211347549118 0.000929430520184
14+
"BPMSW.1R2.B1_DOROS" 214.518 56.51648046 55.322018497 0.0525281418329 -1.194461963 -0.0211347549118 0.000929430520184
15+
"MQXA.1R2" 222.258 69.18871039 76.9218526661 0.0716990574947 7.7331422761 0.111768845416 0.00103628261158
16+
"BPMSW.1L5.B1" 10168.21165 2104.578527 2094.70480413 2.26456198055 -9.87372287 -0.00469154405185 0.00107601686109
17+
"IP5" 10189.77565 0.2209726052 0.226920173701 0.00324173153728 0.005947568501 0.0269154110557 0.0146702869994
18+
"BPMSW.1R5.B1" 10211.33965 2104.585113 2108.46530211 2.27498305074 3.88018911 0.00184368362488 0.00108096509696
19+
"MQXA.1L8" 20152.9004 265.9906963 344.589024587 0.329909060032 78.598328287 0.295492772418 0.00124030300541
20+
"BPMSW.1L8.B1" 20154.2704 235.4392947 236.154698968 0.249984842307 0.715404268 0.0030385933194 0.00106178045863
21+
"BPMSW.1L8.B1_DOROS" 20154.2704 235.4392947 236.154698968 0.249984842307 0.715404268 0.0030385933194 0.00106178045863
22+
"MBXWS.1L8" 20155.4904 209.8139177 218.611849843 0.236706427053 8.797932143 0.0419320712346 0.00112817314336
23+
"MBXWH.1L8" 20172.3154 8.322150306 16.4051743455 0.0486102502319 8.0830240395 0.971266288434 0.00584106852731
24+
"IP8" 20175.8654 1.998645815 2.02650253528 0.00186443862757 0.02785672028 0.013937797318 0.00093285094016
25+
"MBLW.1R8" 20183.6154 32.01126024 14.9758796438 0.0460425307503 -17.0353805962 -0.53216838289 0.00143832296527
26+
"MBXWS.1R8" 20197.0204 225.8117665 212.95864899 0.232398033544 -12.85311751 -0.0569196092357 0.00102916706754
27+
"BPMSW.1R8.B1_DOROS" 20197.4604 235.2209748 230.275533428 0.245549381089 -4.945441372 -0.0210246614963 0.00104390937627
28+
"BPMSW.1R8.B1" 20197.4604 235.2209748 230.275533428 0.245549381089 -4.945441372 -0.0210246614963 0.00104390937627
29+
"MQXA.1R8" 20205.2004 313.7943335 337.469775739 0.324744498046 23.675442239 0.0754489157753 0.00103489599198
30+
"BPMSW.1L1.B1" 23497.79062 2119.524012 2102.82938767 2.27195837485 -16.69462433 -0.00787659127025 0.00107191914882
31+
"IP1" 23519.36962 0.2197108633 0.225721271193 0.00306205483368 0.006010407893 0.0273559886968 0.0139367475403
32+
"BPMSW.1R1.B1" 23540.93362 2116.773701 2112.79676772 2.27950405708 -3.97693328 -0.00187877111196 0.00107687659574

0 commit comments

Comments
 (0)