Exemplo n.º 1
0
 def _create_geo_point_grid(self, nx: int, ny: int , dx: int)->api.GeoPointVector:
     gpv = api.GeoPointVector()
     for i in range(nx):
         for j in range(ny):
             z = self.max_elevation * (i + j) / (nx + ny)
             gpv.append(api.GeoPoint(i*dx, j*dx, z))
     return gpv
Exemplo n.º 2
0
 def test_geopoint_vector(self):
     gpv = api.GeoPointVector()
     for i in range(5):
         gpv.append(api.GeoPoint(i, i * 2, i * 3))
     self.assertEqual(len(gpv), 5)
     for i in range(5):
         self.assertEqual(gpv[i].x, i)
         self.assertEqual(gpv[i].y, i * 2)
         self.assertEqual(gpv[i].z, i * 3)
Exemplo n.º 3
0
 def _get_geo_pts(self, raw_fcst):
     # extract geo_pts from first souce vector and return as GeoPointVector
     first_fcst_member = raw_fcst[0][0]
     first_src_vec = first_fcst_member[list(first_fcst_member.keys())[0]]
     start_times, nb_geo_pts = np.unique(
         [src.ts.time(0) for src in first_src_vec], return_counts=True)
     nb_geo_pts = nb_geo_pts[0]
     gpv = api.GeoPointVector()
     for k in range(0, nb_geo_pts):
         gpv.append(first_src_vec[k].mid_point())
     return gpv
Exemplo n.º 4
0
    def setUp(self):
        self.cal = api.Calendar()
        self.dt = api.deltahours(1)
        self.nt = 24 * 10
        self.t0 = self.cal.time(2016, 1, 1)
        self.ta = api.TimeAxis(self.t0, self.dt, self.nt)
        self.ta1 = api.TimeAxisFixedDeltaT(self.t0, self.dt, self.nt)

        self.geo_points = api.GeoPointVector()
        self.geo_points.append(api.GeoPoint(100, 100, 1000))
        self.geo_points.append(api.GeoPoint(5100, 100, 1150))
        self.geo_points.append(api.GeoPoint(100, 5100, 850))