-
Notifications
You must be signed in to change notification settings - Fork 30
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
Allows reading laser envelope from Wake-T #356
base: development
Are you sure you want to change the base?
Conversation
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.
Thanks for this PR! See comments below.
@@ -68,29 +68,32 @@ def __init__(self, wavelength, pol, array, dim, axes, axes_order=["x", "y", "t"] | |||
) | |||
else: # dim = "rt" | |||
assert axes_order in [["r", "t"], ["t", "r"]] | |||
assert len(array.shape) == 3, "Field array is not 3D." |
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.
With these changes, can we still read FBPIC output successfully? And use lasy as we do for the FBPIC-Wake-T handshake?
@@ -75,8 +79,10 @@ def __init__( | |||
field, | |||
coord=None, | |||
is_envelope=None, | |||
is_waket=None, |
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.
For the record: we do this at the moment, but before the next release we need to make sure the code work without such a specific option.
else: | ||
s = io.Series(path + "/" + prefix + "_%T.h5", io.Access.read_only) | ||
if is_waket: | ||
filepath = path + "/" + prefix + "%T.h5" |
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.
This maybe should be fixed in Wake-T.
if field == "a": | ||
array = (m_e * c * omg0 / e) * array |
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.
Could you use vector_potential_to_field
instead?
Reading Wake-T files with
FromOpenPMDProfile
was not working well.This PR includes a patch to make it work.
It may serve as a basis to discuss a better and more general implementation of
FromOpenPMDProfile
andFromArrayProfile
classes.angularFrequency
attribute in the hdf5 file, which is very specific forLASY
envelope files only. Now, a new variableis_waket
can be passed toFromOpenPMDProfile
to read the Wake-T file. We should generalize the method. In the meantime this serves as a patch.FromArrayProfile
, which still treated the field array as 2D in some cases. This PR implement that the field array is always 3D.angularFrequency
is calculated when reading from a non-envelope laser file, such as the ones provided by FBPIC. In these cases,FromOpenPMDProfile
obtains the central frequency with thefield_to_envelope
method. However, I have observed non-sensical values of this parameter. This affected the vector potential,a
, to electric field,E
, envelope transformation when reading Wake-T files, which needs the right value for the central angular frequency of the laser.a
toE
transformation when reading from Wake-T envelope files, and to circumvent the problem on the previous point, this PR allowslambda0
to be passed directly toFromOpenPMDProfile
, so this value will be used instead of the one calculated byfield_to_envelope
.