public void Do_MCP_Uncertainty_test() { Continuum thisInst = new Continuum(""); string Filename = testingFolder + "\\MCP testing.cfm"; thisInst.Open(Filename); Met thisMet = thisInst.metList.metItem[0]; MCP thisMCP = thisMet.mcp; UTM_conversion.Lat_Long theseLL = thisInst.UTM_conversions.UTMtoLL(thisMet.UTMX, thisMet.UTMY); MERRA merra = thisInst.merraList.GetMERRA(theseLL.latitude, theseLL.longitude); thisMCP.numWD = 16; thisMCP.Do_MCP_Uncertainty(thisInst, merra, thisMet); Assert.AreEqual(thisMCP.uncertOrtho.Length, 12, 0, "Wrong number of uncertainty objects"); Assert.AreEqual(thisMCP.uncertOrtho[0].NWindows, 12, 0, "Wrong number of monthly intervals"); Assert.AreEqual(thisMCP.uncertOrtho[7].NWindows, 5, 0, "Wrong number ofintervals"); Assert.AreEqual(thisMCP.uncertOrtho[5].WSize, 6, 0, "Wrong wrong window size"); Assert.AreEqual(thisMCP.uncertOrtho[0].avg, 6.411818, 0.001, "Wrong average LT Estimate in uncertainty calculation"); thisInst.Close(); }
public void CalcAvgSD_Uncert_test() { Continuum thisInst = new Continuum(""); string Filename = testingFolder + "\\MCP testing.cfm"; thisInst.Open(Filename); Met thisMet = thisInst.metList.metItem[0]; MCP thisMCP = thisMet.mcp; UTM_conversion.Lat_Long theseLL = thisInst.UTM_conversions.UTMtoLL(thisMet.UTMX, thisMet.UTMY); thisInst.merraList.MERRAfolder = MERRA2Folder; MERRA merra = thisInst.merraList.GetMERRA(theseLL.latitude, theseLL.longitude); thisMCP.numWD = 16; thisInst.metList.numWD = 16; thisMCP.Do_MCP_Uncertainty(thisInst, merra, thisMet); Assert.AreEqual(thisMCP.uncertOrtho[0].avg, 6.411818, 0.001, "Wrong calculated average of LT estimates in uncertainty analysis"); Assert.AreEqual(thisMCP.uncertOrtho[0].stDev, 0.19069, 0.001, "Wrong calculated standard deviation of LT estimates in uncertainty analysis"); thisInst.Close(); }