File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,22 @@ Base.@kwdef mutable struct SphericalHarmonicsDefinedField <: AbstractMagneticFie
194
194
end
195
195
196
196
function SphericalHarmonicsDefinedField (filename:: String )
197
- coeffs_MF, expansion, func = loadTDesign (filename)
197
+
198
+ file = h5open (filename," r" )
199
+
200
+ if haskey (file," coeffs" )
201
+ # load coefficients
202
+ coeffs_MF = MagneticFieldCoefficients (filename)
203
+ func = fastfunc .(coeffs_MF. coeffs)
204
+ else
205
+ # load measured field
206
+ coeffs_MF, expansion, func = loadTDesign (filename)
207
+ end
208
+
198
209
return SphericalHarmonicsDefinedField (func= func)
199
210
end
200
211
212
+
201
213
MPIMagneticFields. fieldType (:: SphericalHarmonicsDefinedField ) = OtherField ()
202
214
MPIMagneticFields. definitionType (:: SphericalHarmonicsDefinedField ) = SphericalHarmonicsDataBasedFieldDefinition ()
203
215
MPIMagneticFields. timeDependencyType (:: SphericalHarmonicsDefinedField ) = TimeConstant ()
You can’t perform that action at this time.
0 commit comments