easy_vic_build.bulid_Domain
Build and modify VIC domain files.
Public functions
buildDomainCreate
domain.ncwith mask, area, fraction, and grid-length variables.cal_mask_frac_area_lengthCompute domain mask/fraction/area/length arrays from grid and basin geometry.
modifyDomain_for_pourpointForce the domain mask at the nearest grid cell to a pour-point location.
addElevIntoDomainAppend elevation from level-1 parameters into the domain file.
Functions
|
Append |
|
Build |
|
Compute mask/fraction/area/length arrays for domain generation. |
|
Compute grid edges from center coordinates. |
Generate a global UTM zone dictionary (Zone 1-60, N/S) |
|
|
Set domain mask to |
|
Map level-1 mask to level-0 grid by cell-center lookup. |
- easy_vic_build.bulid_Domain.generate_utm_proj_map() dict[source]
Generate a global UTM zone dictionary (Zone 1-60, N/S)
- easy_vic_build.bulid_Domain.buildDomain(evb_dir, dpc_VIC, reverse_lat=True, basin_shp=None, prefine_mask=None)[source]
Build
domain.ncfor the current case.- Parameters:
evb_dir (Evb_dir) – Case directory manager. Output is written to
evb_dir.domainFile_path.dpc_VIC (object) – DPC object that provides at least
grid_shp(and optionallybasin_shpwhenbasin_shpis not passed explicitly).reverse_lat (bool, optional) – Whether latitude axis is arranged north-to-south.
basin_shp (geopandas.GeoDataFrame, optional) – Basin polygon used to compute active-grid fractions. If
None, it is taken fromdpc_VICcache.prefine_mask (numpy.ndarray, optional) – If provided, this array is written to
maskinstead of computed mask.
- Return type:
None
- easy_vic_build.bulid_Domain.cal_mask_frac_area_length(dpc_VIC, reverse_lat=True, plot=False, basin_shp=None)[source]
Compute mask/fraction/area/length arrays for domain generation.
- Parameters:
dpc_VIC (object) – DPC object that provides cached
grid_shpand optionallybasin_shp.reverse_lat (bool, optional) – Whether latitude axis is arranged north-to-south.
plot (bool, optional) – If
True, create a quick diagnostic plot.basin_shp (geopandas.GeoDataFrame, optional) – Basin polygon for intersection area calculation.
- Returns:
(mask, frac_grid_in_basin, frac_full_one, area, x_length, y_length).- Return type:
tuple
- easy_vic_build.bulid_Domain.modifyDomain_for_pourpoint(evb_dir, pourpoint_lon, pourpoint_lat)[source]
Set domain mask to
1at the grid nearest to the pour point.- Parameters:
evb_dir (Evb_dir) – Case directory manager.
pourpoint_lon (float) – Pour-point longitude.
pourpoint_lat (float) – Pour-point latitude.
- Return type:
None
- easy_vic_build.bulid_Domain.addElevIntoDomain(evb_dir, params_dataset_level1)[source]
Append
elevvariable into an existing domain file.- Parameters:
evb_dir (Evb_dir) – Case directory manager.
params_dataset_level1 (netCDF4.Dataset) – Parameter dataset that contains
elevwith shape(lat, lon).
- Return type:
None
- easy_vic_build.bulid_Domain.centers_to_edges(centers)[source]
Compute grid edges from center coordinates.
- easy_vic_build.bulid_Domain.remap_level1_to_level0_mask(lon_level1, lat_level1, mask_level1, lon_level0, lat_level0)[source]
Map level-1 mask to level-0 grid by cell-center lookup.
Each level-0 grid cell inherits the mask value of the level-1 cell in which its center falls.
- Returns:
Remapped mask with
(len(lat_level0), len(lon_level0))shape.- Return type:
numpy.ndarray