-
Notifications
You must be signed in to change notification settings - Fork 12
Remove expand_lattice command and introduce post_expansion.
#293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
4a9e8b2
57dcb4b
c42d52c
80e438a
67ee704
5c1beef
2e5f2b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,11 +15,14 @@ PALS: | |
| load: # [list] Files to load. See the "Load Files" section. | ||
| notes: # [list] Optional notes of interest. | ||
| phase_space_coordinates: # [enum] Type of phase space coordinates | ||
| post_expansion: # [list] Post-expansion setup. | ||
|
DavidSagan marked this conversation as resolved.
Outdated
|
||
| reminders: # [list] Optional reminder messages to be printed when file is read. | ||
| version: # [string] Version of the PALS schema used in this file | ||
| ``` | ||
| The difference between `notes` and `reminders` is that reminder messages are meant to be | ||
| printed (or otherwise communicated to the user) every time the file is read. | ||
| The set of node types that can be used under the `post_expansion` node is the same as the | ||
| `facility` node except for lattice and `use` nodes. | ||
|
DavidSagan marked this conversation as resolved.
Outdated
|
||
|
|
||
| Example: | ||
| ```{code} YAML | ||
|
|
@@ -57,6 +60,48 @@ to be outside of the PALS standard and will be ignored by a PALS parser. | |
| PALS file `authors` are optional, but recommended to enable data provenance and contacts. | ||
| Per author, the `name` is required; the `orcid`, `affiliation` and `email` fields are optional. | ||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:facility)= | ||
| ## `facility` and `post_expansion` | ||
|
|
||
| Constructing the lattice can be divided into two phases. | ||
| The first, "pre-expansion", phase basically involves defining lattice elements, controllers, | ||
| beam lines, etc., and ends with [lattice expansion](#s:lattice.expand). | ||
| The second, "post-expansion", phase basically involves making modifications to the expanded lattice. | ||
| Essentially, the information needed for the pre-expansion phase is put in the `facility` sub-node | ||
| of `PALS` and the information for the post-expansion phase is put in the `post_expansion` sub-node. | ||
| Example: | ||
| ```{code} yaml | ||
| PALS: | ||
| facility: | ||
| - q1: | ||
| kind: Quadrupole | ||
| MagneticMultipoleP: | ||
| Kn1L: 0.375 | ||
|
|
||
| - bline: | ||
| kind: Beamline | ||
| line: | ||
| - q1: | ||
| repeat: 3 | ||
|
|
||
| - lat: | ||
| kind: Lattice | ||
| branches: bline | ||
|
|
||
| post_expansion: | ||
| - set: | ||
| parameter: q1>MagneticMultipoleP.Kn1L | ||
| value: PARAMETER * (1 + 1e-4*random_gauss()) | ||
|
Comment on lines
+90
to
+93
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am saving this question for a later PR. Essentially what I will propose is that a plain
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unresolving this conversation just so it remains visible, since it refers to a fix that will be addressed (hence likely referenced through link) in a future PR.
DavidSagan marked this conversation as resolved.
|
||
| ``` | ||
| In this example, the expanded lattice has three elements named `q1`. | ||
| To add a random error to each of these, the lattice has to be expanded before a `set` command is used, | ||
| and this is accomplished by placing a `set` command under the `post_expansion` node. | ||
| If the `set` command had appeared in the `facility` node, and not in the `post_expansion` node, then | ||
| when the set command is executed, the set would be applied to the value of `Kn1L` in the definition | ||
| of `q1`. In this case, the result would be that all three of the `q1` elements in the expanded lattice would | ||
| have the same value of `Kn1L`. | ||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:parameters)= | ||
| ## Parameters | ||
|
|
||
|
DavidSagan marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,8 @@ crab1: | |
| voltage: 1.0e6 | ||
| ``` | ||
|
|
||
| Lattice element definitions may only be placed as a child node of the [`facility`](#s:palsroot) node | ||
| Lattice element definitions may only be placed as a child node of the [`facility`](#s:palsroot) | ||
| or [`post_expansion`](#s:palsroot) nodes, | ||
|
Comment on lines
+42
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do we explain what a new element definition means after expansion has completed? If there is no insertion/superposition mechanism, such a definition is inert and we should point that out, no?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Insertion and superposition will be needed post expansion so a new element definition will make sense. This will need a future PR.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as #293 (comment): Unresolving this conversation just so it remains visible, since it refers to a fix that will be addressed (hence likely referenced through link) in a future PR.
DavidSagan marked this conversation as resolved.
|
||
| or "in place" in a `line` within a [`BeamLine`](#s:beamline.components). Example: | ||
| ```{code} yaml | ||
| PALS: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.