...
- Select a beamline to be modelled
- Decide whether to run extant or design model
- If "extant", run LEM lite, to check energy profile
- Run the XAL model (can take 30s - 1 minute). Check resulting energy.
\[If you ran xalGetModel, then inspect the model plots \ ]Wiki Markup - Run the XAL XML Writer (to create the model upload file)
- Upload the model to the database. Password for upload is here.
Note: there is no "back" facility. Just abort (ctrl-c to get to the matlab prompt, and start over).
...
This procedure runs through what you have to do to run a new model whose output will be used by LCLS applications. Click on any of the thumbnail images for a larger view.
...
From
lclshome,
select
User
Dev
Displays
panel.
!image:lclshomeUserDev.jpg|thumbnail!unmigrated-wiki-markupRun
one
of
the
matlab
scripts
xalRunModel
or
xalGetModel !image:userDevPnl.jpg|thumbnail!xalGetModel
*xalRunModel*simply
runs
the
model
and
creates
the
upload
files
*xalGetModel*is
as
xalRunModel,
but
additionally
returns
("gets")
the
model
data
to
your
matlab
session.
It
also
creates
model
plots.
Eitherof
these
buttons
will
start
the
corresponding
matlab
script...
!xalGetModel.jpg|thumbnail! .
...which
immediately
prompt
for
you
to
*Select
a
beamline*
: !image:selectabeamline.jpg|thumbnail! \\ The following is a:
\\
The following is a run-throughof
running
xalGetModel
for
the
Extant
machine.
[Click
here
to
see
the
full
transcript
of
this
example
|^xalGetModelRun.jpg].
The procedure is as
The procedure is as follows:- For example, select "Cathode to Dump" (as shown in the example above). This runs the LCLS "Full Machine" model, from the LCLS Cathode to the main Dump. See Why are all models from Cathode to some location.
Wiki Markup *Select
whether
to
"Run
extant
machine
or
design
model?
(x/d)
\[d\]:*".
Hit
x
or
d,
and
RETURN.
Running the
Running the "design"model
(choice
"d")
causes
the
XAL
model
to
be
run
with
the
element
setpoint
values
in
the
model
input
files.
Those
design
setpoint
values
are,
[to
the
extent
possible,
identical
to
the
MAD
design|#modeldiffs].
Running
the
"extant"
model
(choice
"x")
will
cause
the
model
execution
to
first
replace
the
design
values
of
beamline
devices,
with
the
actual
readback
values,
as
acquired
through
EPICS
and
AIDA,
prior
to
running
the
envelope
tracker.
ThatThat is,
"extant"
is
equivalent
to
what
was
called
"DATABASE"
in
the
SLC
modelling
system;
it
describes
the
extant
machine
at
the
time
the
model
is
run.
!image:xalGetModelextant.jpg|thumbnail!*Stages
of
running
the
(extant)
model
are
as
follows:*
Wiki Markup *1)
"Initial
Twiss"*
is
displayed.
Check
the
initial
conditions
which
will
be
used
for
the
model
run.
These
are
presently
taken
from
the
SLC
marker
point
80.
You
can
check
these
at
any
time
with
AIDAWeb
([MARK:VX80:80//twiss
the
values
are
Energy
(GeV),
psix,
betax
(m),
alphax
,
etax
(m),
etax',
psiy,
betay
(m),
alphay,
etay
(m),
etay')
Ifthese
appear
fine,
then
confirm
to
continue. !image:extantinitconditions.jpg|thumbnail!continue.
*2) "Run LEM
*2) "Run LEMWiki Markup 'Lite'"*.
This
will
calculate
and
display
the
fudge
factors
and
predicted
energy.
When
it
has
completed,
_check
in
particular
that
the
final
energy
at
the
undulator_
(see
Energy
column,
and
the
row
of
output
labelled
"BSY")
is
reasonable,
e.g.
9.25
GeV.
If
energy
appears
fine,
then
confirm
to
continue.
!image:checkenergies.jpg|thumbnail!Wiki Markup *3)
"Run
XAL
machine
model."*
This
can
take
up
to
a
minute
to
execute,
so
please
be
patient.
When
it
has
completed,
if
you
ran
xalGetModel,
you
should
get
3
plots
-
the
dispersion,
betas,
and
energy
vs
Z.
The
plots
may
overlap,
and
the
energy
plot
is
on
the
bottom,
so
move
the
others
to
check
it.
!image:energyGraph.jpg|thumbnail!- 4) "Create MAD patch file". This stage is always entered, you don't need to do anything. It only takes a moment to create these.
Wiki Markup "Create
and
upload
XML
model
files
to
Oracle?
(y/n)
\[n\]:
"
If
it
all
looks
good,
and
you
want
to
upload
to
Oracle,
say
"y".
!image:oracleuploadprompt.jpg|thumbnail!5) "Run XML writer." If you said "y" to create the upload files, you'll now see "Run XML writer." This is where the file containing the model results to be uploaded to Oracle, is created. This also takes half a minute or so.
When it has completed, you should see that 3 files have been created: E.g.Code Block /u1/lcls/physics/onlinemodel/xal/xalElements_20090120_115855.xml created /u1/lcls/physics/onlinemodel/xal/xalDevices_20090120_115855.xml created /u1/lcls/physics/onlinemodel/xal/xalModel_20090120_115855.mat created
- Upload the XAL model online on the web.
The last part of xalGetModel gives some tips of uploading. It remins you where to find the model files in the browser, and the URL of this help. See next the section of help with uploading the model files.
...
At the end of running the model, xalGetModel or xalRunModel should have launched a Firefox browser, open at the web page you use to upload the model into Oracle. The Firefox page should look like this:
The password for user name MACHINE_MODEL, is recorded in the physics logbook entry /lclselog/data/2009/02/06.01
If you do NOT see this page (and unfortunately, sometimes Firefox does fail to start at the right page) you can use the "XAL Model" tab (see picture) in Firefox to take you to there.
You can log into the web application at any time at the URL: https://oraweb.slac.stanford.edu/apex/slacprod/f?p=400. (See note on supported hosts) You might want to do this to inspect the data
The password for user name MACHINE_MODEL, is recorded in the physics logbook entry /lclselog/data/2009/02/06.01The procedure for uploading the model procedure for uploading the model files into Oracle:
Once you're in the web application you should see "Select Device File" and "Select Elements File". These 2 files (of the 3) created by the above model running procedure must be uploaded to Oracle in unison. When a file has been entered for BOTH of these, you can hit "Submit" at the bottom of the dialog screen to start the process of Upload into Oracle.
- Select Device File
Hit the "Select Device File" button. You can either enter a full filename by hand, or use the filebrowser, to browse to /mccfs2/u1/lcls/physics/onlinemodel/xal/ and select the Devices file you created in the process above. in our example above this files was named "xalDevices_20090120_115855.xml". (Tip: since there are many files in this directory, hit "Last Modified" twice, to sort the files by date, latest first). Select the xalDevices file you created, and hit the Open icon (with a picture of a folder!) in the filebrowser dialog to make the selection. (It's a bit confusing using the word "Open" to mean "Select" - talk to Oracle about that - they went cheap and used the firefox file selection widget, designed for selecting a file to open, but they use it to mean "select"). - Select Elements File
Hit the "Select Elements File" button. The filebrowser should open at the right directory - amazing! Hit "Last Modified" twice to sort the files again, and click on the xalElements file you created in step 2.2.5 above. Hit "Open".
(You do not need to upload the xalElements file at all). - Comments.
Enter a comment. Please include 2 items in your comment:- Your name, nickname, mark, catchphrase, or other distinguishing refrain from which your personal guilt can be established.
- The Energy at the undulator predicted in step 2.2.3 above!
*Submit*.
Whenyou
are
finished,
the
screen
should
look
something
like
this: !image:comment.jpg|thumbnail! Hit the "Submit" button. The time to upload is about 1 minute! Note that additional time is presently spent creating the screen which echos the upload data, but in fact the model data is available for use as soon as you see the XML Upload Results table: !image:XMLUploadResults.jpg|thumbnail!
Review the model data.
this:
Hit the "Submit" button. The time to upload is about 1 minute! Note that additional time is presently spent creating the screen which echos the upload data, but in fact the model data is available for use as soon as you see the XML Upload Results table:
Review the model data.
Hit the "Run Data" tab to review the uploaded results of any model which has been uploaded, including the last. Hit the little spectacles icon next to a model upload to view the model parameters of each element calculated as part of that model. Hit the "Run Data" tab to review the uploaded results of any model which has been uploaded, including the last. Hit the little spectacles icon next to a model upload to view the model parameters of each element calculated as part of that model.
!image:checkRunData.jpg|thumbnail! Wiki Markup
This interface takes a while to load the data, but it can do it for any uploaded model.
Alternatively, use AIDA to check the Rmats of the model elements for the latest upload.
AIDA Model Queries Anchor model model
Aida Query | Description |
---|---|
Latest Design Full Machine (Cathode to Dump) model Rmats for all devices | |
Latest Design Cathode to Gun Spectrometer model Rmats for all devices | |
Latest Design Cathode to 135 Mev Spectrometer model Rmats for all devices | |
Latest Design Cathode to 52 line model Rmats for all devices | |
Latest Extant (from actual device settings) Full Machine (Cathode to Dump) model Rmats for all devices | |
Latest Extant (from actual device settings) Cathode to Gun Spectrometer model Rmats for all devices | |
Latest Extant (from actual device settings) Cathode to 135 Mev Spectrometer model Rmats for all devices | |
Latest Extant (from actual device settings) Cathode to 52 line model Rmats for all devices |
Model Notes
Anchor | ||||
---|---|---|---|---|
|
...
Update the AIDA Directory service
Having uploaded a new model, we have to tell Aida to update its database of the names of XAL modelled devices. We will teach first aidadev, then aidaprod databases. These are, respectively, the Oracle usernames (ie subschema) of the Aida directory services used on the aida development and production networks.
This section is included for completeness. It is NOT now normal to run this procedure after every model upload, since new devices are seldom added, so please don't bother! Also, Elie has written an automatic procedure to replace this, so we don't have to do it by hand.
Having uploaded a new model, we have to tell Aida to update its database of the names of XAL modelled devices. We will teach first aidadev, then aidaprod databases. These are, respectively, the Oracle usernames (ie subschema) of the Aida directory services used on the aida development and production networks.
Log Log into an AFS Solaris machine like tersk02, and set up the cdsoft environment
Code Block |
---|
ssh -l<your-username> tersk09
tersk> source /afs/slac/g/cd/soft/dev/script/ENVS.csh
|
Enter sqlplus for user AIDADEV on database SLACPROD (SLACPROD will be set by sourcing ENVS.csh above).
Code Block |
---|
sqlplus AIDADEV/<aidadbpassword>
|
...
aida_xal_names_update takes an optional parameter, to specify whether or not to set the service-id to 202 of names it finds to be already in the aida directory. The default (or "N") is not to set the service-id (that is, leave names which are in both the SLC namespace and EPICS name, assigned to the SLC modelling environment (service id 63). If given, and valued "Y", all names modelled by XAL will be assigned to the XAL model service id (202). That is, while we're testing XAL, use the default; when we're sure about XAL, with an EXTANT machine model, and a plan for what to do when devices for like the end station need model, then use Y to switch all modelling of those devices over to XAL.
Code Block |
---|
SQL> exec aida_xal_names_update [Y];
PL/SQL procedure successfully completed. <-- you should see this
|
...
You can see which names are assigned to the XAL model server by AIDA, use the following sql script
Code Block |
---|
SQL> @show_IA_given_serviceid 202
|
Now go over and update the AIDAPROD names too (don't wait, all names should be in sync), run aida_all_changes again, and verify the names added again.
Code Block |
---|
SQL> connect aidaprod/<aidadbpassword>
Connected.
SQL> exec aida_xal_names_update [Y];
SQL> @show_IA_given_serviceid 202
|
...
https://seal.slac.stanford.edu/aidaweb/modelling.jsp
Developers Guide
At the time of writing (31/Jul/08), Elie's upload parser has some restrictions:
Syntax and constraints of the modelOutput xml files:
...