Writers
superfish.writers
Classes
Functions:
superfish.writers.fish_externalfield_data
fish_externalfield_data(
t7data,
eleAnchorPt="beginning",
fieldScale=1,
RFphase=0,
z_offset=0,
name=None,
normalize_by_Ez0=False,
)
Convert Fish t7data to openPMD external field data.
.. deprecated:: Use direct parsing with openPMD-beamphysics instead.
Superfish fields oscillate as::
Er, Ez ~ cos(wt)
Hphi ~ -sin(wt)
For complex fields oscillating as e^-iwt::
Re(Ex*e^-iwt) ~ cos
Re(-iB*e^-iwt) ~ -sin
and therefore B = -i * mu_0 * H_phi is the complex magnetic field in Tesla.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t7data
|
FishT7Data
|
Parsed T7 data in the native Superfish units, as returned by
:func: |
required |
eleAnchorPt
|
(beginning, center, end)
|
Element anchor point attribute. |
"beginning"
|
fieldScale
|
float
|
Unused. |
1
|
RFphase
|
float
|
RF phase attribute. |
0
|
z_offset
|
float
|
Offset added to the grid origin in z, in meters. |
0
|
name
|
str
|
Name attribute. |
None
|
normalize_by_Ez0
|
bool
|
Normalize the fields by the maximum on-axis Ez. |
False
|
Returns:
| Type | Description |
|---|---|
ExternalFieldData
|
Keys |
Source code in superfish/writers.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
superfish.writers.poisson_externalfield_data
poisson_externalfield_data(
t7data,
eleAnchorPt="beginning",
fieldScale=1,
type="electric",
z_offset=0,
name=None,
normalize_by_fz0=False,
)
Convert Poisson t7data to openPMD external field data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t7data
|
PoissonT7Data
|
Parsed T7 data in the native Superfish units, as returned by
:func: |
required |
eleAnchorPt
|
(beginning, center, end)
|
Element anchor point attribute. |
"beginning"
|
fieldScale
|
float
|
Unused. |
1
|
type
|
(electric, magnetic)
|
Type of field data in |
"electric"
|
z_offset
|
float
|
Offset added to the grid origin in z, in meters. |
0
|
name
|
str
|
Name attribute. |
None
|
normalize_by_fz0
|
bool
|
Normalize the fields by the maximum on-axis z field. |
False
|
Returns:
| Type | Description |
|---|---|
ExternalFieldData
|
Keys |
Source code in superfish/writers.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
superfish.writers.write_fish_t7
write_fish_t7(filename, t7data, fmt='%10.8e')
Write a T7 file from a FISH t7data dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path of the T7 file to write. |
required |
t7data
|
FishT7Data
|
Parsed T7 data, as returned by
:func: |
required |
fmt
|
str
|
Number format for the data columns. |
'%10.8e'
|
Returns:
| Type | Description |
|---|---|
str
|
The filename written to. |
See Also
superfish.parsers.parse_fish_t7
Source code in superfish/writers.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
superfish.writers.write_poisson_t7
write_poisson_t7(filename, t7data, fmt='%10.8e')
Write a T7 file from a POISSON t7data dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path of the T7 file to write. |
required |
t7data
|
PoissonT7Data
|
Parsed T7 data, as returned by
:func: |
required |
fmt
|
str
|
Number format for the data columns. |
'%10.8e'
|
Returns:
| Type | Description |
|---|---|
str
|
The filename written to. |
See Also
superfish.parsers.parse_poisson_t7
Source code in superfish/writers.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |