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

Method output_dft

python/simulation.py:3059–3078  ·  view source on GitHub ↗

Output the Fourier-transformed fields in `dft_fields` (created by `add_dft_fields`) to an HDF5 file with name `fname` (does *not* include the `.h5` suffix).

(self, dft_fields: DftFields, fname: str)

Source from the content-addressed store, hash-verified

3057 )
3058
3059 def output_dft(self, dft_fields: DftFields, fname: str):
3060 """
3061 Output the Fourier-transformed fields in `dft_fields` (created by
3062 `add_dft_fields`) to an HDF5 file with name `fname` (does *not* include the `.h5`
3063 suffix).
3064 """
3065 if self.fields is None:
3066 self.init_sim()
3067
3068 if not self.dft_objects:
3069 raise RuntimeError(
3070 "DFT monitor dft_fields must be initialized before calling output_dft"
3071 )
3072
3073 if hasattr(dft_fields, "swigobj"):
3074 dft_fields_swigobj = dft_fields.swigobj
3075 else:
3076 dft_fields_swigobj = dft_fields
3077
3078 self.fields.output_dft(dft_fields_swigobj, fname)
3079
3080 def get_dft_data(self, dft_chunk):
3081 n = mp._get_dft_data_size(dft_chunk)

Callers 1

test_get_dft_arrayMethod · 0.45

Calls 1

init_simMethod · 0.95

Tested by 1

test_get_dft_arrayMethod · 0.36