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)
| 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) |