Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ess-python-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESS Beam Physics
ess-python-tools
Commits
c287a490
Commit
c287a490
authored
9 years ago
by
Ryoichi Miyamoto
Browse files
Options
Downloads
Patches
Plain Diff
An example for loss_elem2den func in lib_tw added.
parent
da6cb2ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+39
-0
39 additions, 0 deletions
README.md
with
39 additions
and
0 deletions
README.md
+
39
−
0
View file @
c287a490
...
...
@@ -46,6 +46,45 @@ lat.get_tw(file_name_lat_new)
# if lat.lst[i].typ=='STEERER' : lat.lst[i].Bx =0.0; lat.lst[i].By =0.0
```
lib_tw includes a function to convert loss/elem to loss/elem-length. An example:
```
# An example to make a bar plot with an output file of this script can be found in
# https://gitlab01.esss.lu.se/ess-bp/pgfplots-examples/tree/master/loss.den
from ess import lib_tw
file_name_den ='density_file_name'
file_name_ptrn='partran_out_file_name'
file_name_dt ='len.dt_dtl.v85.txt' # File with (half cell length) vs (drift tube length)
#-- An example for a density file
den=DENSITY(file_name_den)
s_from_den =den.s
loss_from_den=den.loss_pow # For a file w/ single run
#loss_from_den=den.loss_pow[Nrun] # For a file w/ multi runs (e.g., file from an error study)
loss_den_from_den=loss_elem2den(s_from_den,loss_from_den,file_name_dt,dtl_dt=5e-6)
# Note:
# - Be careful with the number of runs.
# - The instances for losses are "loss_pow", "loss_num", "loss_pow_ave", and etc for DENSITY class.
# - If file_name_dt isn't given, the half-cell lengths are used in stead of drift-tube lnegths.
# - dlt_dt is a small number used to identify DTL_CEL elements.
#-- An example for a partran out file
ptrn=PARTRAN(file_name_ptrn)
loss_den_from_ptrn=ptrn.loss_den(file_name_dt,dtl_dt=5e-6)
# Note:
# - For PARTRAN class, loss_elem2den function is already implemented as a method.
```
### Library
To be done..
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment