private static double ExtrapolValue(PowerDistribution pd, double wavelength) { int i = 0; double step = pd.Step; double wlInf = pd.Low; if (wavelength < wlInf) { return(pd.Power[0]); } double wlSup = wlInf + step; while (wlSup < wavelength)// && i<pd.Power.Length - 2) { wlInf = wlSup; wlSup += step; i++; } if (i >= pd.Power.Length - 1) { return(pd.Power[pd.Power.Length - 1]); } //return pd.Power[i]; double ratio = (wavelength - wlInf) / (wlSup - wlInf); return(pd.Power[i] + (pd.Power[i + 1] - pd.Power[i]) * ratio); }
public Observer(PowerDistribution x, PowerDistribution y, PowerDistribution z) { XDistribution = x; YDistribution = y; ZDistribution = z; }