Example #1
0
 @Test
 public void testCalcDwdz() {
   mw.setReproject(false);
   Assert.assertEquals(-1, mw.calcdwdz(lats1, lons1, u1, zeros), e);
   Assert.assertEquals(-1, mw.calcdwdz(lats1, lons1, zeros, v1), e);
   Assert.assertEquals(-1, mw.calcdwdz(lats1, lons1, u1, ones), e);
   Assert.assertEquals(-1, mw.calcdwdz(lats1, lons1, ones, v1), e);
   Assert.assertEquals(-2, mw.calcdwdz(lats1, lons1, u1, v1), e);
   Assert.assertEquals(-0.5, mw.calcdwdz(lats2, lons1, u1, zeros), e);
   Assert.assertEquals(-1.0, mw.calcdwdz(lats1, lons2, u1, zeros), e);
   Assert.assertEquals(-0.5, mw.calcdwdz(lats2, lons2, u1, zeros), e);
   Assert.assertEquals(-1.0, mw.calcdwdz(lats2, lons1, zeros, v1), e);
   Assert.assertEquals(-0.5, mw.calcdwdz(lats1, lons2, zeros, v1), e);
   Assert.assertEquals(-0.5, mw.calcdwdz(lats2, lons2, zeros, v1), e);
   Assert.assertEquals(-1.0, mw.calcdwdz(lats2, lons2, u1, v1), e);
   Assert.assertEquals(1.0, mw.calcdwdz(lats2, lons2, u3, v3), e);
 }
Example #2
0
 @Test
 public void testLinearX() {
   mw.setReproject(false);
   mw.setInputUFile("C:/Temp/Linear_Xn2_u.nc");
   mw.setInputVFile("C:/Temp/Zeros_n2_v.nc");
   mw.setOutputWFile("C:/Temp/Test_W_x.nc");
   mw.setInTimeName("Time");
   mw.setOutTimeName("Time");
   mw.go();
 }
Example #3
0
 @Test
 public void testDy() {
   Assert.assertEquals(0.0d, mw.dy(zeros), e);
   Assert.assertEquals(0.0d, mw.dy(ones), e);
   Assert.assertEquals(0.0d, mw.dy(u1), e);
   Assert.assertEquals(1.0d, mw.dy(v1), e);
   Assert.assertEquals(0.0d, mw.dy(u2), e);
   Assert.assertEquals(2.0d, mw.dy(v2), e);
   Assert.assertEquals(0.0d, mw.dy(u3), e);
   Assert.assertEquals(-1.0d, mw.dy(v3), e);
   Assert.assertEquals(14d, mw.dy(seq), e);
 }
Example #4
0
 @Test
 public void testDx() {
   Assert.assertEquals(0.0d, mw.dx(zeros), e);
   Assert.assertEquals(0.0d, mw.dx(ones), e);
   Assert.assertEquals(1.0d, mw.dx(u1), e);
   Assert.assertEquals(0.0d, mw.dx(v1), e);
   Assert.assertEquals(2.0d, mw.dx(u2), e);
   Assert.assertEquals(0.0d, mw.dx(v2), e);
   Assert.assertEquals(-1.0d, mw.dx(u3), e);
   Assert.assertEquals(0.0d, mw.dx(v3), e);
   Assert.assertEquals(3.0d, mw.dx(seq), e);
 }
Example #5
0
 @Test
 public void testIntegrate() {
   mw.setReproject(false);
   Assert.assertArrayEquals(zero_arr, mw.integrate(zeros_3D, zeros_3D, lons1, lats1), (float) e);
   Assert.assertArrayEquals(zero_arr, mw.integrate(ones_3D, zeros_3D, lons1, lats1), (float) e);
   Assert.assertArrayEquals(zero_arr, mw.integrate(zeros_3D, ones_3D, lons1, lats1), (float) e);
   Assert.assertArrayEquals(zero_arr, mw.integrate(ones_3D, ones_3D, lons1, lats1), (float) e);
   Assert.assertArrayEquals(seq_arr1, mw.integrate(u3D1, zeros_3D, lons1, lats1), (float) e);
   Assert.assertArrayEquals(seq_arr1, mw.integrate(zeros_3D, v3D1, lons1, lats1), (float) e);
   Assert.assertArrayEquals(zero_arr, mw.integrate(v3D1, u3D1, lons1, lats1), (float) e);
   Assert.assertArrayEquals(seq_arr3, mw.integrate(u3D1, v3D1, lons1, lats1), (float) e);
   Assert.assertArrayEquals(seq_arr1, mw.integrate(u3D1, v3D1, lons2, lats2), (float) e);
 }