Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
masawdah committed Sep 25, 2023
1 parent 4ee3653 commit 5c008a5
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions xvec/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,6 @@ def agg_geom(self, geom, trans,var, stat='mean'):
# Convert the GeoSeries to a GeometryArray
geometry_array = geo_series.geometry.array

#stat_results = []
#for var in ds.data_vars:
xar_chunk = self._obj[var]
mask = rasterio.features.geometry_mask(geometry_array, out_shape=(xar_chunk.shape[0], xar_chunk.shape[1]), transform= trans)
masked_data = xar_chunk * mask[:, :, np.newaxis]
Expand All @@ -964,9 +962,6 @@ def agg_geom(self, geom, trans,var, stat='mean'):

def spatial_agg(self, geometries, stat='mean', chunk_size = 2):
transform = self._obj.rio.transform()
#geometries = gdf.geometry.values


num_cores = multiprocessing.cpu_count()
geometry_chunks = [geometries[i:i + chunk_size] for i in range(0, len(geometries), chunk_size)]

Expand Down Expand Up @@ -1054,9 +1049,6 @@ def agg_polys(

vec_cube = self._obj.xvec.spatial_agg(polygons, stat='mean', chunk_size = 2)

#.xvec.set_geom_indexes
# weightmap = xa.pixel_overlaps(self._obj, polygons)
# agg_df = xa.aggregate(s1_wgs84, weightmap, stat = stats).to_dataframe()
return vec_cube

def extract_points(
Expand Down

0 comments on commit 5c008a5

Please sign in to comment.