Hi, I got a few question on how to interpolate some models of mine.
My goal is to interpolate the full data cube made from each of my diffraction grating models then, given some initial requirements, retrieve a simple line plot. I currently have three models, model 10, 20, and 30, each containing their own wavelength (Vector{Float64}), depth (Vector{Float64}), and efficiency (Matrix{Float64}) components.
I was able to interpolate my data in 3D space for a single model and pull out my line. Here is a simple version of that code:
function single_interp(mod, δ) #Single model
#Model interpolation
x = mod["wavelength"]
y = mod["depth"]
z = mod["efficiency"]
itp = LinearInterpolation((x, y), z)
# Find grid
x2 = range(extrema(x)..., length=300)
y2 = range(extrema(y)..., length=300)
# Interpolate
z2 = [itp(x,δ) for x in x2] # δ = desired etching depth we want to look at
p = lines(x2,z2)
display(p)
return x2, y2, z2
end
Similarly to this, I want to interpolate between my 3 models and make a similar line plot. Each model covers the same depth and wavelength range, and the model number represents a physical attribute being changed in the models (10, 20, or 30% change to the period of the diffraction grating in this case), so I want to make a function looking similar to:
function multiple_interp(mod, δ, W)
where the W can be a single value (say 15) that represents the interpolated data between any two models. I’m getting stuck on how to bring in all my models into the interpolation function. Later I’ll be moving to adding other models too representing some other change in the grating, so I’ll need to similar function in a 5d and/or 6D data cube too, but figuring out how it works in 4D is my main goal here.
Any help is appreciated, especially since I’m fairly new at working with Julia and data cubes!