public static DenseMatrix T2(DenseMatrix T1, DenseMatrix LR, DenseMatrix dH) { return(MatrixFactory.New((r, c) => { float t1 = T1[r, c]; float lr = LR[r, c]; float dh = dH[r, c]; return (t1 + lr * dh / 1000); })); }
public static DenseMatrix Hypso(this DenseMatrix Z1, DenseMatrix T1, float levelP1, DenseMatrix T2, float levelP2) { float fP = (float)Math.Log(levelP1 / levelP2); DenseMatrix Z2 = MatrixFactory.New((r, c) => { var z1 = Z1[r, c]; var t1 = T1[r, c]; var t2 = T2[r, c]; var tv = AbsoluteConstants.WaterFreezePoint + 0.5f * (t1 + t2); var z2 = z1 + (AbsoluteConstants.Rsd * tv) / (AbsoluteConstants.g) * fP; return(z2); }); return(Z2); }
public DenseMatrix DataToMatrix <T>(T[] data, Func <T, float> conversionFunc, bool flipUpDown = true) { DenseMatrix mat = MatrixFactory.New((r, c) => { int sc = (180 + c) % EW; int dataIdx = r * EW + sc; float dataElement = conversionFunc(data[dataIdx]); return(dataElement); }); if (flipUpDown) { return(mat.FlipUpDown()); } return(mat); }
public static DenseMatrix GetRefTemp(EarthModel earth) { return(MatrixFactory.New((r, c) => GetRefTemp(earth, r, c))); }
public static DenseMatrix GetRefTempYearlyDelta_MidLevel(EarthModel earth) { return(MatrixFactory.New((r, c) => GetRefTempYearlyDelta_MidLevel(earth, r, c))); }