Interpolation
superfish.interpolate
Classes
Functions:
superfish.interpolate.get_t7
get_t7(path)
Find T7 files in a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory to search. |
required |
Returns:
| Type | Description |
|---|---|
list of str
|
Paths of the T7 files found. |
Source code in superfish/interpolate.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
superfish.interpolate.interpolate2d
interpolate2d(
sf: Superfish,
zmin: float = ...,
zmax: float = ...,
nz: int = ...,
rmin: float = ...,
rmax: float = ...,
nr: int = ...,
return_fieldmesh: Literal[False] = ...,
) -> FishT7Data | PoissonT7Data
interpolate2d(sf, zmin=-1000, zmax=1000, nz=100, rmin=0, rmax=0, nr=1, return_fieldmesh=False)
Interpolate the solved field onto a grid using SF7.
Runs SF7 on a Superfish object, requesting interpolating data, and reads the resulting Parmela T7 file.
SF7 automatically adjusts the bounds if they are requested outside of the computational domain.
TODO: detect the column labels from the SF object
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sf
|
Superfish
|
Superfish object that has been run. |
required |
zmin
|
float
|
z extent of the grid, in the input units of the program. |
-1000
|
zmax
|
float
|
z extent of the grid, in the input units of the program. |
-1000
|
nz
|
int
|
Number of z points. |
100
|
rmin
|
float
|
Radial extent of the grid, in the input units of the program. |
0
|
rmax
|
float
|
Radial extent of the grid, in the input units of the program. |
0
|
nr
|
int
|
Number of radius points. |
1
|
return_fieldmesh
|
bool
|
Return an openPMD-beamphysics FieldMesh instead of a t7data dict. |
False
|
Returns:
| Type | Description |
|---|---|
FishT7Data or PoissonT7Data or FieldMesh
|
If
Otherwise, an openPMD-beamphysics FieldMesh. |
Source code in superfish/interpolate.py
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 123 124 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 | |