diff --git a/bmad-doc/tao_examples/custom_tao_with_measured_data/README b/bmad-doc/tao_examples/custom_tao_with_measured_data/README index 167030ceda..38348ab46b 100644 --- a/bmad-doc/tao_examples/custom_tao_with_measured_data/README +++ b/bmad-doc/tao_examples/custom_tao_with_measured_data/README @@ -1,6 +1,11 @@ Example of How to Create a Customized Version of Tao --------------------------------------------------- +This example uses real data from the Fermilab Recycler NOvA Ring curtesy of Meiqin Xiao. +Paper: + Linear Modelling and Lattice Correction from Betatron Phase Measurements at the Fermilab Recycler NOvA Ring + Meiqin Xiao(Fermilab), Kyle Hazelwood(Fermilab), Ming-Jen Yang(Fermilab), R. Ainsword(Fermilab) + Directory: tao/examples/custom_tao_with_measured_data diff --git a/bmad-doc/tutorial_ring_design/doc/figures/tunecell.pdf b/bmad-doc/tutorial_ring_design/doc/figures/tunecell.pdf index 6400164b43..b032923455 100644 Binary files a/bmad-doc/tutorial_ring_design/doc/figures/tunecell.pdf and b/bmad-doc/tutorial_ring_design/doc/figures/tunecell.pdf differ diff --git a/bmad-doc/tutorial_ring_design/doc/macros.tex b/bmad-doc/tutorial_ring_design/doc/macros.tex index cabc679667..2109e5d26e 100644 --- a/bmad-doc/tutorial_ring_design/doc/macros.tex +++ b/bmad-doc/tutorial_ring_design/doc/macros.tex @@ -119,6 +119,7 @@ \newcommand{\ltt}{{\sl Long Term Tracking}\xspace} \newcommand{\da}{{\sl Dynamic Aperture}\xspace} \newcommand{\sodom}{{\sl SODOM-2}\xspace} +\newcommand{\spinstrob}{{\sl spin_stroboscope}\xspace} \newcommand{\bmad}{{\sl Bmad}\xspace} \newcommand{\mad}{{\sl MAD}\xspace} \newcommand{\quickplot}{{\sl Quick Plot}\xspace} diff --git a/bmad-doc/tutorial_ring_design/doc/tutorial_ring_design.tex b/bmad-doc/tutorial_ring_design/doc/tutorial_ring_design.tex index 92f7fa919d..a5418e63d3 100644 --- a/bmad-doc/tutorial_ring_design/doc/tutorial_ring_design.tex +++ b/bmad-doc/tutorial_ring_design/doc/tutorial_ring_design.tex @@ -1654,13 +1654,13 @@ \subsection{Example: tao.init for the Tune Cell} \begin{code} ! Require periodic betas in center FoDo cells of 2 o'clock tune cell datum(1) = 'expression: lat::beta.a[QFSS_2##4] - lat::beta.a[QFSS_2##5]' - '' '0' 'end' 'target' 0 10 + '' '' '' 'target' 0 10 datum(2) = 'expression: lat::beta.b[QFSS_2##4] - lat::beta.b[QFSS_2##5]' - '' '0' 'end' 'target' 0 10 + '' '' '' 'target' 0 10 datum(3) = 'expression: lat::alpha.a[QFSS_2##4] - lat::alpha.a[QFSS_2##5]' - '' '0' 'end' 'target' 0 10 + '' '' '' 'target' 0 10 datum(4) = 'expression: lat::alpha.b[QFSS_2##4] - lat::alpha.b[QFSS_2##5]' - '' '0' 'end' 'target' 0 10 + '' '' '' 'target' 0 10 \end{code} The syntax \vn{lat::beta.a[QFSS_2\#\#4]} evaluates to the value of the \vn{a}-mode beta function at the fourth lattice element named \vn{QFSS_2}. @@ -1835,10 +1835,10 @@ \subsection{Example} Values at End of Element: Index name key ... orbit ... spin ... x ... x - 0 BEGINNING Beginning_Ele ... 0.000000E+00 ... 0.000000E+00 - 1 B Sbend ... 5.027722E-03 ... -1.414516E-01 - 2 Q Quadrupole ... -1.599068E-02 ... -7.350543E-02 - 3 END Marker ... -1.599068E-02 ... -7.350543E-02 + 0 BEGINNING Beginning_Ele ... 0.000000E+00 ... 1.000000E+00 + 1 B Sbend ... 2.888946E-02 ... 9.886413E-01 + 2 Q Quadrupole ... -1.847740E-02 ... 9.768026E-01 + 3 END Marker ... -1.847740E-02 ... 9.768026E-01 \end{code} or the \vn{show element} command @@ -1863,7 +1863,7 @@ \subsection{Exercises:} \begin{enumerate}[leftmargin=*] \item {\bf Phase Space:} Construct a lattice with a single drift of 2 meters length. -Set the particle species to be protons with a reference energy of $10^12$~eV (so the approximation +Set the particle species to be protons with a reference energy of $10^{12}$~eV (so the approximation that the particle velocity is speed of light can be made), and Set the initial particle position to have $p_x = 0.2$, $p_z = 1$ with all other coordinates zero. Calculate from first principles what the phase space coordinates will be at the end of the @@ -1988,7 +1988,7 @@ \subsection{Adding RF Cavities} The example files for this section can be found at \vn{/lattices/9_RF/AddingRF/} -In a real machine, electrons emit synchrotron radiation as they bend around the ring, so we need to replenish the energy with an RF system. Let’s put RF cavities in the 10 o’clock straight section of our ring. We will design a special FODO cellwith RF cavities \vn{FODORF} and replace 4 FODO cells in the 10 o’clock straight section. +In a real machine, electrons emit synchrotron radiation as they bend around the ring, so we need to replenish the energy with an RF system. Let’s put RF cavities in the 10 o’clock straight section of our ring. We will design a special FODO cell with RF cavities \vn{FODORF} and replace 4 FODO cells in the 10 o’clock straight section. In the ESR, there are two RF cavities of length $4.017 \textrm{m}$ between each quadrupole with equal drift spaces between each element. We will follow these dimensions as shown in Fig.~\ref{f:fodorf}. @@ -2015,7 +2015,7 @@ \subsection{Example: Consturcting the FODO cell with RF cavities} FODORF: line = (QFSS, DRF, RF0, DRF, RF0, DRF, QDSS, DRF, RF0, DRF, RF0, DRF) \end{code} - \item Replace 4 FODO cells in the 10 o'clock section with \vn{FODORF} by modifying \vn{SEXTANT9} and \vn{SEXTANT9}: + \item Replace 4 FODO cells in the 10 o'clock section with \vn{FODORF} by modifying \vn{SEXTANT9} and \vn{SEXTANT11}: \begin{code} SEXTANT9: line = (4*FODOSSF, SS_TO_ARCF, 20*FODOAF, ARC_TO_SSF, 2*FODOSSF, 2*FODORF) @@ -2036,7 +2036,7 @@ \subsection{Exercises} % \item Modify the \vn{lcavity} in the \vn{cavity.bmad} to have a small length (so the transit time is -small), and set the beginning momentum small enough so the relativistic beta is significantly than +small), and set the beginning momentum small enough so the relativistic beta is significantly less than one. Starting the particle with a finite $z$, calculate the ending $z$ after the cavity and verity that the change in $z$ is consistent with what Bmad calculates. % @@ -3214,32 +3214,12 @@ \subsection{Exercises} \begin{enumerate}[leftmargin=*] % \item {\bf Zero orbit at IP:} -Use 4 horizontal/vertical kickers around the IP (CH/V_104 to CH/V_107, 8 total kickers) to make the orbit exactly 0 at the IP without affecting the rest of the ring. +Use 4 horizontal/vertical kickers around the IP (CH/V\_104 to CH/V\_107, 8 total kickers) to make the orbit exactly 0 at the IP without affecting the rest of the ring. % \end{enumerate} \newpage -%------------------------------------------------------------------------------ -%------------------------------------------------------------------------------ -%\section{Tracking with Ramping and Spin Tracking} - -%------------------------------------------------------------------------------ -%\subsection{Tracking with Ramping} -%The ESR will not be used to accelerate, however to show what ramping in Bmad might look like we include this section. - -%------------------------------------------------------------------------------ -%\subsection{Adding Siberian Snakes} -%Taylor element overview - - - -%------------------------------------------------------------------------------ -%\subsection{Invariant Spin Field Calculations} -%\sodom $\rightarrow$ \ltt - -%\newpage - %------------------------------------------------------------------------------ %------------------------------------------------------------------------------ \appendix diff --git a/bmad-doc/tutorial_ring_design/lattices/8_PhaseSpace/orbit.bmad b/bmad-doc/tutorial_ring_design/lattices/8_PhaseSpace/orbit.bmad index b5a27ff7c8..5e9497a64d 100644 --- a/bmad-doc/tutorial_ring_design/lattices/8_PhaseSpace/orbit.bmad +++ b/bmad-doc/tutorial_ring_design/lattices/8_PhaseSpace/orbit.bmad @@ -2,7 +2,7 @@ beginning[beta_a] = 10. ! m a-mode beta function beginning[beta_b] = 10. ! m b-mode beta function beginning[e_tot] = 10e6 ! eV -parameter[geometry] = open ! or closed +parameter[geometry] = open з! or closed bmad_com[spin_tracking_on] = T particle_start[y] = 0.01 diff --git a/bmad/calculations/exact_bend_multipole/convert.py b/bmad/calculations/exact_bend_multipole/convert.py index 40b4b3450d..df27840393 100755 --- a/bmad/calculations/exact_bend_multipole/convert.py +++ b/bmad/calculations/exact_bend_multipole/convert.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Script for processing the Mathematica output for exact bend multipoles into Fortran form. # The output is a temporary that must be cut and pasted as appropriate. diff --git a/bmad/doc/cover-page.tex b/bmad/doc/cover-page.tex index 115fa85db2..735c8dadd7 100644 --- a/bmad/doc/cover-page.tex +++ b/bmad/doc/cover-page.tex @@ -3,7 +3,7 @@ \begin{flushright} \large - Revision: July 14, 2024 \\ + Revision: July 30, 2024 \\ \end{flushright} \pdfbookmark[0]{Preamble}{Preamble} diff --git a/bmad/doc/example-program.tex b/bmad/doc/example-program.tex index 5f22ab5d77..91430b1b70 100644 --- a/bmad/doc/example-program.tex +++ b/bmad/doc/example-program.tex @@ -24,7 +24,7 @@ \section{A First Program} Consider the example program shown in \fig{f:program}. The source code for this program is provided with \bmad in the directory: \begin{example} - \$ACC_ROOT_DIR/examples/simple_bmad_program + \$ACC_ROOT_DIR/code_examples/simple_bmad_program \end{example} [Note: \vn{\$ACC_ROOT_DIR} is the root directory of the \bmad \vn{Distribution} when you are running ``off-site'' and is root directory of the \vn{Release} when you are running ``on-site''.] diff --git a/bmad/doc/list-element-attributes.tex b/bmad/doc/list-element-attributes.tex index e9040f79ec..3b30097fb2 100644 --- a/bmad/doc/list-element-attributes.tex +++ b/bmad/doc/list-element-attributes.tex @@ -84,24 +84,25 @@ \chapter{List of Element Attributes} \label{s:list.beambeam} \begin{tabular}{llll} \toprule -alias & crab_x3 [1/m$^2$] & p0c [eV] & wrap_superimpose \\ -alpha_a_strong & crab_x4 [1/m$^3$] & ptc_integration_type & x1_limit [m] \\ -alpha_b_strong & crab_x5 [1/m$^4$] & ref_origin & x2_limit [m] \\ -aperture [m] & create_jumbo_slave & ref_time_start [sec] & x_limit [m] \\ -aperture_at & delta_ref_time [sec] & reference & x_offset [m] \\ -aperture_type & descrip & repetition_frequency [Hz] & x_offset_tot [m] \\ -bbi_constant & e_tot [eV] & sig_x [m] & x_pitch [rad] \\ -beta_a_strong [m] & e_tot_strong [eV] & sig_y [m] & x_pitch_tot [rad] \\ -beta_b_strong [m] & ele_origin & sig_z [m] & y1_limit [m] \\ -bs_field [T] & field_calc & species_strong & y2_limit [m] \\ -charge & is_on & spin_tracking_method & y_limit [m] \\ -cmat_11 & ks [1/m] & superimpose & y_offset [m] \\ -cmat_12 & l [m] & symplectify & y_offset_tot [m] \\ -cmat_21 & mat6_calc_method & tilt [rad] & y_pitch [rad] \\ -cmat_22 & n_particle & tilt_tot [rad] & y_pitch_tot [rad] \\ -crab_tilt [rad] & n_slice & tracking_method & z_crossing [m] \\ -crab_x1 & offset [m] & type & z_offset [m] \\ -crab_x2 [1/m] & offset_moves_aperture & wall & z_offset_tot [m] \\ +alias & crab_x4 [1/m$^3$] & ref_origin & x2_limit [m] \\ +alpha_a_strong & crab_x5 [1/m$^4$] & ref_time_start [sec] & x_limit [m] \\ +alpha_b_strong & create_jumbo_slave & reference & x_offset [m] \\ +aperture [m] & delta_ref_time [sec] & repetition_frequency [Hz] & x_offset_tot [m] \\ +aperture_at & descrip & s_twiss_ref [m] & x_pitch [rad] \\ +aperture_type & e_tot [eV] & sig_x [m] & x_pitch_tot [rad] \\ +bbi_constant & e_tot_strong [eV] & sig_y [m] & y1_limit [m] \\ +beta_a_strong [m] & ele_origin & sig_z [m] & y2_limit [m] \\ +beta_b_strong [m] & field_calc & species_strong & y_limit [m] \\ +bs_field [T] & is_on & spin_tracking_method & y_offset [m] \\ +charge & ks [1/m] & superimpose & y_offset_tot [m] \\ +cmat_11 & l [m] & symplectify & y_pitch [rad] \\ +cmat_12 & mat6_calc_method & tilt [rad] & y_pitch_tot [rad] \\ +cmat_21 & n_particle & tilt_tot [rad] & z_crossing [m] \\ +cmat_22 & n_slice & tracking_method & z_offset [m] \\ +crab_tilt [rad] & offset [m] & type & z_offset_tot [m] \\ +crab_x1 & offset_moves_aperture & wall & \\ +crab_x2 [1/m] & p0c [eV] & wrap_superimpose & \\ +crab_x3 [1/m$^2$] & ptc_integration_type & x1_limit [m] & \\ \bottomrule \end{tabular} \vfill diff --git a/bsim/bbu/collect_thresholds.py b/bsim/bbu/collect_thresholds.py index aeb004af8c..9455768835 100644 --- a/bsim/bbu/collect_thresholds.py +++ b/bsim/bbu/collect_thresholds.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os, sys diff --git a/bsim/bbu/test_run.py b/bsim/bbu/test_run.py index 742912675f..1bd92f3caa 100755 --- a/bsim/bbu/test_run.py +++ b/bsim/bbu/test_run.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os, sys, shutil, glob, tempfile, time from bbu import bbu_main, find_threshold, drscan, phase_scan #imports bbu package in user python path diff --git a/bsim/spin_stroboscope/plotting/invariant_spin.py b/bsim/spin_stroboscope/plotting/invariant_spin.py index 4d399bbcef..ea4b229477 100755 --- a/bsim/spin_stroboscope/plotting/invariant_spin.py +++ b/bsim/spin_stroboscope/plotting/invariant_spin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import numpy as np diff --git a/bsim/tune_scan/plotting/tune_scan_density_plot.py b/bsim/tune_scan/plotting/tune_scan_density_plot.py index df5febad85..e9fe4601e5 100755 --- a/bsim/tune_scan/plotting/tune_scan_density_plot.py +++ b/bsim/tune_scan/plotting/tune_scan_density_plot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # To execute this file from within the Python interpreter: # execfile('this_file_name') diff --git a/cpp_bmad_interface/scripts/bmad_enums_to_c.py b/cpp_bmad_interface/scripts/bmad_enums_to_c.py index 8b12971c7c..7db5adf0ec 100755 --- a/cpp_bmad_interface/scripts/bmad_enums_to_c.py +++ b/cpp_bmad_interface/scripts/bmad_enums_to_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Note: # Run this script in the cpp_bmad_interface directory. diff --git a/cpp_bmad_interface/scripts/create_interface.py b/cpp_bmad_interface/scripts/create_interface.py index fddca49b4c..1dab8e42fb 100755 --- a/cpp_bmad_interface/scripts/create_interface.py +++ b/cpp_bmad_interface/scripts/create_interface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Note: Run this script in the cpp_bmad_interface directory. diff --git a/lux/doc/lux.tex b/lux/doc/lux.tex index d1a6ca403d..035f422dfa 100644 --- a/lux/doc/lux.tex +++ b/lux/doc/lux.tex @@ -879,7 +879,7 @@ \section{Python Scripting} Example: \begin{listing}{1} -#!/usr/bin/env python +#!/usr/bin/env python3 import subprocess import glob diff --git a/lux/scripts/combine_det_pix_files.py b/lux/scripts/combine_det_pix_files.py index f10c481a16..15e15928d5 100644 --- a/lux/scripts/combine_det_pix_files.py +++ b/lux/scripts/combine_det_pix_files.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Script to combine det_pix output files from Lux into one det_pix file. # This is useful when a simulation has to be broken up into multiple runs. diff --git a/lux/scripts/plot_det_pix.py b/lux/scripts/plot_det_pix.py index cb4a708377..d4e3dedaab 100755 --- a/lux/scripts/plot_det_pix.py +++ b/lux/scripts/plot_det_pix.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # To execute this file from within the Python interpreter: # execfile('this_file_name') diff --git a/regression_tests/scripts/run_tests.py b/regression_tests/scripts/run_tests.py index 52fb0157ae..aeb8417d88 100755 --- a/regression_tests/scripts/run_tests.py +++ b/regression_tests/scripts/run_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # Script to run regression tests for the Bmad libraries. diff --git a/tao/doc/generate_tex_for_python_commands.py b/tao/doc/generate_tex_for_python_commands.py index 8e9fae73d5..ca83149345 100644 --- a/tao/doc/generate_tex_for_python_commands.py +++ b/tao/doc/generate_tex_for_python_commands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # coding: utf-8 # # Generate documentation for Tao python commands. diff --git a/tao/version/tao_version_mod.f90 b/tao/version/tao_version_mod.f90 index 77fbf8b33b..b60aa2336a 100644 --- a/tao/version/tao_version_mod.f90 +++ b/tao/version/tao_version_mod.f90 @@ -6,5 +6,5 @@ !- module tao_version_mod -character(*), parameter :: tao_version_date = "2024/07/26 21:59:14" +character(*), parameter :: tao_version_date = "2024/07/30 17:00:42" end module diff --git a/util/create_searchf_namelist b/util/create_searchf_namelist index 2d3a4bccdb..5af07b4916 100755 --- a/util/create_searchf_namelist +++ b/util/create_searchf_namelist @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # Script to create the searchf.namelist files so that getf and listf can do faster searches. diff --git a/util/getf b/util/getf index 29a303ff3a..1ca9aa11f6 100755 --- a/util/getf +++ b/util/getf @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # See searchf.py for all documentation diff --git a/util/listf b/util/listf index 1c6faa509c..2d8aaa2c9f 100755 --- a/util/listf +++ b/util/listf @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # See searchf.py for all documentation diff --git a/util/raw_list b/util/raw_list index 405b475a1c..256db4aa20 100755 --- a/util/raw_list +++ b/util/raw_list @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # Script for finding and printing structure definitions. diff --git a/util/searchf.py b/util/searchf.py index 47924bdd95..7a74249d27 100755 --- a/util/searchf.py +++ b/util/searchf.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # searchf.py is the file that holds the code for the scripts: diff --git a/util_programs/elegant_to_bmad/elegant_to_bmad.py b/util_programs/elegant_to_bmad/elegant_to_bmad.py index e7141a4d3e..11685d91ce 100755 --- a/util_programs/elegant_to_bmad/elegant_to_bmad.py +++ b/util_programs/elegant_to_bmad/elegant_to_bmad.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # Script to convert from Elegant lattice format to Bmad lattice format. diff --git a/util_programs/mad_to_bmad/mad8_to_bmad.py b/util_programs/mad_to_bmad/mad8_to_bmad.py index f5caa2c456..6c0e45889b 100644 --- a/util_programs/mad_to_bmad/mad8_to_bmad.py +++ b/util_programs/mad_to_bmad/mad8_to_bmad.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # Script to convert from MAD8 lattice format to Bmad lattice format. diff --git a/util_programs/mad_to_bmad/madx_to_bmad.py b/util_programs/mad_to_bmad/madx_to_bmad.py index 68fe3861f9..33a661a0f1 100644 --- a/util_programs/mad_to_bmad/madx_to_bmad.py +++ b/util_programs/mad_to_bmad/madx_to_bmad.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #+ # Script to convert from MADX lattice format to Bmad lattice format. diff --git a/util_programs/slicktrack_to_bmad/slicktrack_to_bmad.py b/util_programs/slicktrack_to_bmad/slicktrack_to_bmad.py index 91b82da036..c62d0ff4cf 100755 --- a/util_programs/slicktrack_to_bmad/slicktrack_to_bmad.py +++ b/util_programs/slicktrack_to_bmad/slicktrack_to_bmad.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from itertools import tee import sys