Created
March 14, 2018 19:13
-
-
Save bekozi/5ebd20bca06283040f820bf0830ba472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ocgis | |
from ocgis.test.base import create_gridxy_global, create_exact_field | |
# Path to the input ESRI Shapefile. | |
# PATH_SHP = '/home/benkoziol/l/data/bekozi-work/i53-jh-camel-watersheds/basin_set_full_res/HCDN_nhru_final_671.shp' | |
PATH_SHP = '/gcs/camels/basin_dataset_public_v1p2/shapefiles/merge/basinset_gf_nhru.shp' | |
# Path to example exact data for testing. | |
DATA_PATH = 'camels_source.nc' | |
# Create some source field test data. | |
grid = create_gridxy_global(crs=ocgis.crs.Spherical()) | |
field = create_exact_field(grid, 'foo', ntime=3) | |
field.write(DATA_PATH) | |
# Spatially average each geometry and write the data to a time series file. | |
ops = ocgis.OcgOperations(dataset={'uri': DATA_PATH}, geom=PATH_SHP, aggregate=True, output_format='nc', | |
prefix='aggdata', add_auxiliary_files=False) | |
ops.execute() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bekozi - If I were to run this with
mpirun
, would the weights/aggregation steps be done in parallel (per geometry object)?