Esempio n. 1
0
 def __getitem__(self, proj_point):
     """Get value for given projection point"""
     # XXX why isn't this next line using the self._point_transformer matrix
     #     that's areadly been created?
     tm = geom.get_transform_matrix(self, self._spec)  # blech
     (x, y) = proj_point
     (tx, ty) = geom.transform_coord(proj_point, tm, src="map", dst="image")
     return self._data[tx, ty]
Esempio n. 2
0
 def setUp(self):
     params = {
         'band': 'LANDSAT_8/OLI_TIRS/sr_band2',
         'x': -1850865,
         'y': 2956785,
         't1': '2013-01-01',
         't2': '2015-01-01'
     }
     # Load the saved data that was originally returned by running the above
     # query against the LCMAP REST service.
     data = json.load(open("tests/data/tiles-result-payload.json"))
     fake_resp = FakeLCMAPRESTResponse(data)
     fake_http = FakeLCMAPHTTP(fake_resp)
     sr = surface_reflectance.SurfaceReflectance(fake_http)
     (self.spec, self.tiles) = sr.tiles(**params)
     self.tile = self.tiles[0]
     self.xform_matrix = geom.get_transform_matrix(self.tile, self.spec)
 def setUp(self):
     params = {
         'band': 'LANDSAT_8/OLI_TIRS/sr_band2',
         'x':    -1850865,
         'y':     2956785,
         't1':   '2013-01-01',
         't2':   '2015-01-01'
     }
     # Load the saved data that was originally returned by running the above
     # query against the LCMAP REST service.
     data = json.load(open("tests/data/tiles-result-payload.json"))
     fake_resp = FakeLCMAPRESTResponse(data)
     fake_http = FakeLCMAPHTTP(fake_resp)
     sr = surface_reflectance.SurfaceReflectance(fake_http)
     (self.spec, self.tiles) = sr.tiles(**params)
     self.tile = self.tiles[0]
     self.xform_matrix = geom.get_transform_matrix(self.tile, self.spec)
Esempio n. 4
0
 def __init__(self, tile, spec, mask=True, shape=True, unscale=True):
     self._tile = tile
     self._spec = spec
     self._data = decode(spec, tile, mask, shape, unscale)
     self._point_transformer = geom.get_transform_matrix(self, spec)
     pass