pnps.geometry#
The beam layouts: where the input holes are, and where the signal appears.
Two layouts share the propagation and the chi3 response; only the input differs.
"tg", transient grating: the four-hole boxcar. Holes at(+-d, +-d)withd = (mask_spacing + mask_diam) / 2; gate 1 at(+d, +d), gate 2 at(+d, -d)and the delayed test arm at(-d, +d), so the signalk_test - k_g1 + k_g2appears in the fourth corner,(-d, -d)."sd", self-diffraction: two holes on the x axis,s = mask_spacing + mask_diamapart centre to centre. The probe E sits at(-s/2, 0)and the delayed gate G at(+s/2, 0); the signal2 k_E - k_Gappears one slot further out, at(-3s/2, 0). The layout is symmetric about the axis so that both beams are cut from the same part of the illumination: the signal isE^2 G*, and an energy imbalance between the two would not cancel. The gate, which appears once and conjugated, carries the delay.
Positions are in the mask plane, in the stored transverse axes (a mask-plane position
x is the stored wavevector kx = x omega / (c f_foc)). The input former takes the
layout as three arms, gate 1, gate 2 and the test arm (pnps.form_input.ARMS),
with a weight each: self-diffraction puts the probe in the gate-1 slot, the gate in the
test slot and gives gate 2 no weight.
The signal region is what i_omega_full sums, the un-windowed signal against which
the windows’ collection efficiency is measured (SignalRegion): for TG the
quadrant kx, ky < 0 (the same at every frequency), for SD the half-plane beyond the
bisector between the signal and the probe, mask-plane x < -s, which moves with
frequency, inside air’s light cone.
Module Attributes
The beam layouts: |
Functions
|
Refuse an unknown layout. |
|
Return the input holes of a layout. |
|
Return a signal region as a mask of the state, for the NumPy references. |
|
Return where the signal appears in the mask plane, where the windows go. |
|
Return the SD signal region as a mask-plane edge, or None for TG. |
|
Return the momentum region of the signal, what |
Classes
|
The input holes of a layout, in the former's arm order. |
|
The momentum region of the signal, what |
- pnps.geometry.Geometry#
The beam layouts:
"tg"(four-hole boxcar) and"sd"(self-diffraction).alias of
Literal[‘tg’, ‘sd’]
- class pnps.geometry.Layout(holes, weights)[source]#
Bases:
NamedTupleThe input holes of a layout, in the former’s arm order.
- Attributes:
- holesnumpy.ndarray
Hole centres
(3, 2)in the mask plane, m, for gate 1, gate 2 and the test arm.- weightsnumpy.ndarray
Arm weights
(3,), each 1.0 or 0.0: an arm of weight zero is not part of the layout.
- holes: Float[ndarray, 'n_arms 2']#
Alias for field number 0
- weights: Float[ndarray, 'n_arms']#
Alias for field number 1
- class pnps.geometry.SignalRegion(kx_max, ky_max, kperp2_max)[source]#
Bases:
NamedTupleThe momentum region of the signal, what
i_omega_fullsums.{kx < kx_max(omega), ky < ky_max(omega), kx^2 + ky^2 < kperp2_max(omega)}.- Attributes:
- kx_max, ky_maxnumpy.ndarray
Exclusive upper bounds on the stored wavevectors per frequency bin,
(n_omega,), rad/m;-infexcludes a bin,+infleaves an axis free.- kperp2_maxnumpy.ndarray
Exclusive upper bound on
kx^2 + ky^2per bin,(n_omega,), rad^2/m^2;+inffor none.
- kx_max: Float[ndarray, 'n_omega']#
Alias for field number 0
- ky_max: Float[ndarray, 'n_omega']#
Alias for field number 1
- kperp2_max: Float[ndarray, 'n_omega']#
Alias for field number 2
- pnps.geometry.check_geometry(geometry)[source]#
Refuse an unknown layout.
- Parameters:
- geometrystr
The layout’s name.
- Raises:
- ConfigError
If
geometryis not one ofGeometry.
- pnps.geometry.input_layout(geometry, mask_diam, mask_spacing)[source]#
Return the input holes of a layout.
- Parameters:
- geometry{“tg”, “sd”}
The layout.
- mask_diam, mask_spacingfloat
Hole diameter and edge-to-edge spacing, m.
- Returns:
- Layout
The hole centres and arm weights.
- Raises:
- ConfigError
For an unknown layout.
Examples
>>> from pnps.geometry import input_layout >>> layout = input_layout("sd", 1e-3, 1e-3) >>> layout.holes.tolist(), layout.weights.tolist() ([[-0.001, 0.0], [-0.001, 0.0], [0.001, 0.0]], [1.0, 0.0, 1.0])
- pnps.geometry.region_mask(region, ky, kx)[source]#
Return a signal region as a mask of the state, for the NumPy references.
- Parameters:
- regionSignalRegion
The region.
- ky, kxnumpy.ndarray
The stored momentum axes, rad/m.
- Returns:
- numpy.ndarray
True inside the region,
(n_y, n_x, n_omega).
- pnps.geometry.signal_centre(geometry, mask_diam, mask_spacing)[source]#
Return where the signal appears in the mask plane, where the windows go.
- Parameters:
- geometry{“tg”, “sd”}
The layout.
- mask_diam, mask_spacingfloat
Hole diameter and edge-to-edge spacing, m.
- Returns:
- tuple of float
(x, y)in m:(-d, -d)for TG,(-3s/2, 0)for SD.
- Raises:
- ConfigError
For an unknown layout.
Examples
>>> from pnps.geometry import signal_centre >>> signal_centre("tg", 1e-3, 1e-3), signal_centre("sd", 1e-3, 1e-3) ((-0.001, -0.001), (-0.003, 0.0))
- pnps.geometry.signal_half_plane(geometry, f_foc, mask_diam, mask_spacing)[source]#
Return the SD signal region as a mask-plane edge, or None for TG.
The SD region is the half of the mask beyond the gate-side edge
x = sin solprop’s physical axes (this package’s storedkx < -s omega / (c f_foc), negated), at the input mapping’s distancef_foc: ahalf_plane_x_gerow of a solprop aperture set. The TG quadrant is a fixed momentum box instead.- Parameters:
- geometry{“tg”, “sd”}
The layout.
- f_focfloat
Focal length of the input mapping, m.
- mask_diam, mask_spacingfloat
Hole diameter and edge-to-edge spacing, m.
- Returns:
- tuple of float or None
(edge, distance)in m, or None for TG.
- Raises:
- ConfigError
For an unknown layout.
Examples
>>> signal_half_plane("sd", 0.1, 1e-3, 1e-3) (0.002, 0.1) >>> signal_half_plane("tg", 0.1, 1e-3, 1e-3) is None True
- pnps.geometry.signal_region(geometry, omega, f_foc, mask_diam, mask_spacing)[source]#
Return the momentum region of the signal, what
i_omega_fullsums.- Parameters:
- geometry{“tg”, “sd”}
The layout.
- omeganumpy.ndarray
Absolute angular frequency, FFT-ordered, rad/s.
- f_focfloat
Focal length of the input mapping, m.
- mask_diam, mask_spacingfloat
Hole diameter and edge-to-edge spacing, m.
- Returns:
- SignalRegion
TG: the quadrant
kx, ky < 0at every bin, the second half of each FFT-ordered axis. SD:kx < -s omega / (c f_foc)at positive frequencies, anyky, inside air’s light conekx^2 + ky^2 < (omega / c)^2, and nothing at the other frequencies, where the mapping diverges. The SD region is a half-plane of the mask, which only light that can leave the slab into air reaches; it is solprop’s half-plane aperture (signal_half_plane()), which reaches the same columns.
- Raises:
- ConfigError
For an unknown layout.