Skip to content
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

WIP/ENH: wavefront class #68

Closed
wants to merge 84 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
cf27ef0
WIP/ENH: wavefront support
ken-lauer Jul 3, 2024
b9dde15
MAINT: tweaks from balticfish
ken-lauer Aug 1, 2024
28b73fa
FIX: wavefront example after rename
ken-lauer Aug 1, 2024
dcb0379
FIX: gridding and padding
ken-lauer Aug 1, 2024
fcc3580
MAINT: clean and add docstrings
ken-lauer Aug 1, 2024
9e023cb
REF: redo classes after Chris's feedback
ken-lauer Aug 9, 2024
6437d88
DOC: update docstrings
ken-lauer Aug 14, 2024
297a239
CLN: remove operation log
ken-lauer Aug 14, 2024
df9e569
MAINT: add imports and some simple tests
ken-lauer Aug 14, 2024
da47e22
DOC: more docstrings
ken-lauer Aug 14, 2024
89c4268
Merge remote-tracking branch 'origin/master' into wip_wavefront
ken-lauer Aug 14, 2024
db98ddb
REF: inplace kwarg instead
ken-lauer Aug 14, 2024
eb42cdb
CI: 3.10+ for now
ken-lauer Aug 14, 2024
eb191a3
MAINT: slicing on Python pre-3.11
ken-lauer Aug 14, 2024
77e6c25
CI: test on multiple Python versions
ken-lauer Aug 14, 2024
335fa11
MAINT: move to Sequence[...] and use cartesian name in places
ken-lauer Aug 14, 2024
8191fcd
MAINT: simplify shifts
ken-lauer Aug 15, 2024
f1cb8b5
WIP: use ranges more
ken-lauer Aug 15, 2024
e8c66ef
REF: propagate_z -> propagate('z')
ken-lauer Aug 15, 2024
93658ca
ENH: single plane plotting framework
ken-lauer Aug 15, 2024
b8f822b
MAINT: propagate -> drift
ken-lauer Aug 20, 2024
a879cbe
WIP: assuredly incorrect genesis4 import
ken-lauer Aug 20, 2024
3a89b43
TST: updated padding values (to discuss with balticfish)
ken-lauer Aug 21, 2024
c05fc3f
WIP: openpmd wavefront output
ken-lauer Aug 22, 2024
9281388
WIP: split up metadata and add notes after discussion with Chris
ken-lauer Aug 27, 2024
745b08e
WIP: ranges -> grid_spacing and more
ken-lauer Aug 28, 2024
a27b924
DEV: add pre-commit config
ken-lauer Aug 28, 2024
49d8d9a
DEV: update requirements
ken-lauer Aug 28, 2024
e69e261
TST: wavefront with pmd validator
ken-lauer Aug 28, 2024
db122b0
WIP: notebook update with grid_spacing
ken-lauer Aug 28, 2024
4b5da0a
DEV: openpmd-validator 2.0 is required
ken-lauer Aug 29, 2024
214b3c1
WIP: max divergence padding factor
ken-lauer Sep 4, 2024
fdb36a1
MAINT: rename field_[rk]space -> [rk]mesh
ken-lauer Sep 5, 2024
9406561
BLD: openpmd-validator 2.0.x is not on pypi
ken-lauer Sep 5, 2024
c546e6f
CI: switch to miniforge
ken-lauer Sep 5, 2024
9a0ef40
WIP: longitudinal drift propagation direction and more
ken-lauer Sep 11, 2024
8c59736
WIP: swap axes for now
ken-lauer Sep 11, 2024
240fd65
WIP: tweak gaussian axis dimension handling
ken-lauer Sep 11, 2024
bf40ceb
TST: fix tests for adjusted ordering/API
ken-lauer Sep 11, 2024
6102467
WIP: moving from time[fs]->z[m] and fixing along the way
ken-lauer Sep 12, 2024
d84a605
ENH: show better kspace labels
ken-lauer Sep 13, 2024
4429015
ENH: 'nice' axis labels + extents
ken-lauer Sep 13, 2024
857fb0a
ENH: preliminary plot_reciprocal
ken-lauer Sep 13, 2024
1a96935
WIP: plot_reciprocal averages instead of slice
ken-lauer Sep 19, 2024
f04bd59
MAINT: plotting tweaks
ken-lauer Sep 19, 2024
d8542b1
WIP: start of wigner plot
ken-lauer Sep 19, 2024
bed1795
WIP: unsaved tweaks (dpi)
ken-lauer Oct 23, 2024
cdbc797
FIX/ENH: plot(show_power_density)
ken-lauer Nov 6, 2024
9d6097d
ENH: isophase contour for phase plot
ken-lauer Nov 6, 2024
dce70ca
FIX: time-averaged power density
ken-lauer Nov 6, 2024
cbbf647
FIX: scaling and extents from balticfish
ken-lauer Nov 6, 2024
d722ea6
Merge remote-tracking branch 'origin/master' into wip_wavefront
ken-lauer Nov 19, 2024
0a1022c
TST: sigma_t -> sigma_z
ken-lauer Nov 19, 2024
eee53d7
CI: remove defaults channel
ken-lauer Nov 19, 2024
5e62cb1
REF: simplify and remove code surrounding padding
ken-lauer Dec 16, 2024
adf03ec
STY: move to Python 3.9+ syntax
ken-lauer Dec 16, 2024
9fbfe76
MAINT: allow padding adjustment when replacing rmesh
ken-lauer Dec 16, 2024
172cc73
WIP: write genesis 4 format
ken-lauer Dec 16, 2024
490db5b
STY: move to Python 3.9+ syntax
ken-lauer Dec 16, 2024
25a648c
TST: start of write/read genesis4 wavefront
ken-lauer Dec 16, 2024
6eacca7
BLD: lume-genesis for wavefront loading/saving
ken-lauer Dec 16, 2024
fb43d19
ENH: initial round-tripping of pmd wavefront format
ken-lauer Dec 16, 2024
db7ab1d
CLN: remove longitudinal_axis
ken-lauer Dec 16, 2024
dbdd6b1
CLN: remove axis_labels which are now implicitly xyz
ken-lauer Dec 16, 2024
aad8abf
REF: redo plotting interface as requested
ken-lauer Dec 16, 2024
dbdb43b
MAINT: test and fix plot variants
ken-lauer Dec 16, 2024
6091df9
MAINT: re/im -> re_mesh/im_mesh
ken-lauer Dec 16, 2024
26b418b
MAINT: undo label but set title
ken-lauer Dec 16, 2024
657b384
FIX: genesis4 scaling factor
ken-lauer Dec 17, 2024
e28cc13
MAINT: upright units
ken-lauer Dec 17, 2024
6109322
MAINT: remove transpose
ken-lauer Dec 17, 2024
9c46abb
ENH: aspect ratio for wavefront.plot()
ken-lauer Dec 17, 2024
d2f005c
MAINT: 'of mesh' is implied here but not above
ken-lauer Dec 17, 2024
1e4f15a
ENH: support legacy openpmd format from genesis4
ken-lauer Dec 17, 2024
faedafc
ENH: enumerate wavefronts in file
ken-lauer Dec 17, 2024
7ce2dff
MAINT: move tools and genesis import/export around
ken-lauer Dec 17, 2024
7b1143c
TST/FIX: test coverage, cleanup, and associated fixes
ken-lauer Dec 17, 2024
1d5a7fc
MAINT: move around code in an effort to clean up Wavefront a bit
ken-lauer Dec 17, 2024
81c49a3
MAINT: flatten _fft/_ifft for clarity
ken-lauer Dec 17, 2024
ae99fe8
CLN: unused properties
ken-lauer Dec 17, 2024
60edc0d
API: remove .drift and .focus from wavefront
ken-lauer Dec 18, 2024
10a215a
MAINT: re-run notebook after removal of .drift/.focus
ken-lauer Dec 18, 2024
30b5441
MAINT: function calls are too confusing
ken-lauer Dec 18, 2024
3b02642
FIX: conversion coefficient in x/y dimensions
ken-lauer Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MAINT: slicing on Python pre-3.11
  • Loading branch information
ken-lauer committed Aug 14, 2024
commit eb191a3a55bf3d17d35eae917a28eb9ef9aa1119
13 changes: 9 additions & 4 deletions pmd_beamphysics/wavefront.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,13 @@ def create_gaussian_pulse_3d_with_q(
Rayleigh range [m].
sigma_t : float
Time RMS [fs]
ranges : tuple of (float, float) pairs
Low and high domain range for each dimension of the wavefront.
First axis must be time [s].
Remaining axes are expected to be spatial (x, y) [m].
grid : tuple of ints
Data gridding.
dtype : np.dtype, default=np.complex64

Returns
-------
Expand Down Expand Up @@ -540,7 +547,7 @@ class WavefrontPadding:
@property
def ifft_slices(self):
"""Slices to extract the real space data from its padded form (i.e., post-ifft)."""
return [slice(pad, -pad) for pad in self.pad]
return tuple(slice(pad, -pad) for pad in self.pad)

@property
def pad_shape(self) -> Tuple[Tuple[int, int], ...]:
Expand Down Expand Up @@ -719,7 +726,7 @@ def _ifft(self):
axes=(0, 1, 2),
phasors=self.phasors,
workers=workers,
)[*self._pad.ifft_slices]
)[self._pad.ifft_slices]

def propagate_z(self, z_prop: float, *, inplace: bool = False) -> Wavefront:
"""
Expand Down Expand Up @@ -875,8 +882,6 @@ def gaussian_pulse(
Rayleigh range [m].
sigma_t : float
Time RMS [fs]
t_mid : float
Center of the time window size [fs].

Returns
-------
Expand Down