-
Notifications
You must be signed in to change notification settings - Fork 2
Output undulator structure in setup_source function in srwl_bl.py. #9
Conversation
Still a problem here, before we merge. The undulator is output from setup_source, but now calc_all doesn't work:
The problem is here: |
env/work/srw_python/srwl_bl.py
Outdated
@@ -3043,6 +3043,7 @@ def setup_source(v): #MR20160617 - moved from Sirepo .jinja template | |||
del v.und_g | |||
if hasattr(v, 'gbm_pen'): | |||
del v.gbm_pen | |||
mag = SRWLMagFldU([SRWLMagFldH(1, 'v', v.und_by, v.und_phy, v.und_sy, 1), SRWLMagFldH(1, 'h', v.und_bx, v.und_phx, v.und_sx, 1)], v.und_per, v.und_per) #BN20180515 - output undulator structure as mag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend to split the line to 2 or 3, it's hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll do that
Now there's a problem passing the undulator into set_und_sin due to https://github.com/radiasoft/SRW-light/blob/master/env/work/srw_python/srwl_bl.py#L283-L287 I think this is a bug. |
After most recent fix, it looks like it works for me. But I'd appreciate a review of all the changes here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the two images added to git:
- env/work/srw_python/uti_plot-0.png
- env/work/srw_python/uti_plot-1.png
I'm not sure the changes won't break anything... I'd recommend to use SRW from this branch and try it with Sirepo locally. If all the existing examples reproduce the results which are on alpha/beta servers, that's good to merge.
Ok, I removed .png files. |
I get the point about the tabulated undulator. I should understand how this is represented in python. I see the structure is created in python here |
No description provided.