MCPcopy Create free account
hub / github.com/NanoComp/meep / add_dft_fields

Method add_dft_fields

python/simulation.py:2989–3036  ·  view source on GitHub ↗

`add_dft_fields(cs, fcen, df, nfreq, freq, where=None, center=None, size=None, yee_grid=False, decimation_factor=0, persist=False)` ##sig Given a list of field components `cs`, compute the Fourier transform of these fields for `nfreq` equally spaced frequencies covering the

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

2987 dft.swigobj = dft.func(*dft.args)
2988
2989 def add_dft_fields(self, *args, **kwargs):
2990 """
2991 `add_dft_fields(cs, fcen, df, nfreq, freq, where=None, center=None, size=None, yee_grid=False, decimation_factor=0, persist=False)` ##sig
2992
2993 Given a list of field components `cs`, compute the Fourier transform of these
2994 fields for `nfreq` equally spaced frequencies covering the frequency range
2995 `fcen-df/2` to `fcen+df/2` or an array/list `freq` for arbitrarily spaced
2996 frequencies over the `Volume` specified by `where` (default to the entire cell).
2997 The volume can also be specified via the `center` and `size` arguments. The
2998 default routine interpolates the Fourier-transformed fields at the center of each
2999 voxel within the specified volume. Alternatively, the exact Fourier-transformed
3000 fields evaluated at each corresponding Yee grid point is available by setting
3001 `yee_grid` to `True`. To reduce the memory-bandwidth burden of accumulating
3002 DFT fields, an integer `decimation_factor` can be specified for updating the DFT
3003 fields at every `decimation_factor` timesteps. If `decimation_factor` is 0 (the default),
3004 this value is automatically determined from the
3005 [Nyquist rate](https://en.wikipedia.org/wiki/Nyquist_rate) of the bandwidth-limited
3006 sources and this DFT monitor. It can be turned off by setting it to 1. Use this feature
3007 with care, as the decimated timeseries may be corrupted by
3008 [aliasing](https://en.wikipedia.org/wiki/Aliasing) of high frequencies.
3009 """
3010 components = args[0]
3011 args = fix_dft_args(args, 1)
3012 freq = args[1]
3013 where = kwargs.get("where", None)
3014 center = kwargs.get("center", None)
3015 size = kwargs.get("size", None)
3016 yee_grid = kwargs.get("yee_grid", False)
3017 decimation_factor = kwargs.get("decimation_factor", 0)
3018 persist = kwargs.get("persist", False)
3019 center_v3 = Vector3(*center) if center is not None else None
3020 size_v3 = Vector3(*size) if size is not None else None
3021 use_centered_grid = not yee_grid
3022 dftf = DftFields(
3023 self._add_dft_fields,
3024 [
3025 components,
3026 where,
3027 center_v3,
3028 size_v3,
3029 freq,
3030 use_centered_grid,
3031 decimation_factor,
3032 persist,
3033 ],
3034 )
3035 self.dft_objects.append(dftf)
3036 return dftf
3037
3038 def _add_dft_fields(
3039 self,

Callers 15

test_array_metadataMethod · 0.95
_load_dump_fields_2dMethod · 0.95
_load_dump_fields_3dMethod · 0.95
get_fragment_statsMethod · 0.95
test_nea2far_periodicMethod · 0.95
gaussian_beamMethod · 0.95
planewave_in_vacuumMethod · 0.95
backwardFunction · 0.95
_add_dft_fieldsMethod · 0.45
test_get_dft_arrayMethod · 0.45

Calls 4

Vector3Class · 0.90
fix_dft_argsFunction · 0.85
DftFieldsClass · 0.85
getMethod · 0.80