@@ -235,22 +235,26 @@ function interpolation_setup(fil::String)
235
235
end
236
236
237
237
"""
238
- interpolation_setup(;Γ,lon,lat,path,url )
238
+ interpolation_setup(;Γ,lon,lat,filename )
239
239
240
240
Download or recompute interpolation coefficients.
241
241
242
242
- `λ=interpolation_setup()` to download "interp_coeffs_halfdeg.jld2"
243
243
- `λ=interpolation_setup(Γ=Γ)` to recompute interpolation to `lon,lat`
244
+ - `λ=interpolation_setup(Γ=Γ,lon=lon,lat=lat,filename=filename)` to
245
+ recompute interpolation to `lon,lat` and save to location and file `filename`,
246
+ defaulting to `tempname()*"_interp_coeffs.jld2"`.
244
247
"""
245
248
function interpolation_setup (;Γ= NamedTuple (),
246
249
lon= [i for i= - 179. :2.0 : 179. , j= - 89. :2.0 : 89. ],
247
- lat= [j for i= - 179. :2.0 : 179. , j= - 89. :2.0 : 89. ])
250
+ lat= [j for i= - 179. :2.0 : 179. , j= - 89. :2.0 : 89. ],
251
+ filename= tempname ()* " _interp_coeffs.jld2" )
248
252
249
253
if isempty (Γ)
250
254
fil= joinpath (MeshArrays. mydatadep (" interp_halfdeg" )," interp_coeffs_halfdeg.jld2" )
251
255
else
252
256
(f,i,j,w)= InterpolationFactors (Γ,vec (lon),vec (lat))
253
- fil= tempname () * " _interp_coeffs.jld2 "
257
+ fil= filename
254
258
MeshArrays. write_JLD2 (fil; lon= lon, lat= lat, f= f, i= i, j= j, w= w)
255
259
end
256
260
interpolation_setup (fil)
0 commit comments