chump.objects.dataobjects.shpts
define a shapefile object with time-varying property defined by a tseries object
the color scale used for color grid, either 'Normalize' or 'LogNorm', default is 'Normalize' which is linear scale color map.
the color bar argument.
Example:
>>> colorbar = {shrink=0.88, pad=0.01, label='Simulated groundwater elevation (feet)'}
subtract values of another object.
Example:
>>> subtract = {other={csv='obslevel'}, fill_value=0}
set the object as a result of a mathmatic expression.
The expression will be evaluated by the Python's eval
function.
Examples:
>>> [mfbin.simdiff]
>>> calculate = '(simheadA - simHeadB) - (simheadC - simHeadD)'
where simheadA
, simheadB
, simheadC
and simheadD
are names of other mfbin
objects.
call a function in an external Python script after reading the data.
extfunc
sets the file name of the script.
This script needs to be placed in the working directory.
The function name must be "extfunc" and the first argument is the object.
The dataframe of the object can be accessed through obj.dat
where obj is the argument name in your function.
Example:
>>> # code inside the external script
>>> def extfunc(obj):
>>> # extract results for the final 12 month
>>> obj.dat = obj.dat.iloc[-12:]
name of the colum used to label the point features when plotting the shapefile.
Example:
>>> pointlabel = 'WellName'
plotting argument for the point labels
Example:
>>> pointlabelarg = {fontsize='x-small'}
Dissolve geometries within groupby into single observation. This is accomplished by applying the unary_union method to all geometries within a groupself. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.dissolve.html.
Example:
>>> dissolve = {by='hub8', aggfunc='sum'}
Explode multi-part geometries into multiple single geometries. Each row containing a multi-part geometry will be split into multiple rows with single geometries, thereby increasing the vertical size of the GeoDataFrame. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.explode.html.
Example:
>>> explode = true
Spatial join with another geospatial object. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.sjoin.html.
Example:
>>> sjoin = {df={shp='modelgrid'}}
Clip points, lines, or polygon geometries by another geospatial object. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.clip.html.
Example:
>>> clip = {mask={shp='modelarea'}}
Create buffer of distance of the geospatial object. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.buffer.html.
Example:
>>> buffer = {distance=10}
whether to get the centroid. default is false See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.centroid.html.
Example:
>>> centroid = true
whether to get the concave hull of each geometry. default is false See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.concave_hull.html.
Example:
>>> concave_hull = true
whether to get the convex hull of each geometry. default is false See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.convex_hull.html.
Example:
>>> convex_hull = true
Get a simplified representation of each geometry. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.simplify.html.
Example:
>>> simplify = {tolerance=100}
Get a translated geometry. For 2D affine transformations, the 6 parameter matrix is [a, b, d, e, xoff, yoff] See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.affine_transform.html.
Example:
>>> affine_transform = [2, 3, 2, 4, 5, 2]
Get a rotated geometry with a angle in degree. Positive angles are counter-clockwise and negative are clockwise rotations. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.rotate.html.
Example:
>>> rotate = 90
>>> rotate = {angle=90, origin=[0,0]}
Get a scaled geometry by different factors along each dimension. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.scale.html.
Example:
>>> scale = [0.01, 0.01] # scaled x and y 1%
>>> scale = {xfact=0.01, yfact=0.01, origin=[0, 0]} # scaled x and y 1%
Get a skewed geometry sheared by angles (in degrees) along the x and y dimensions. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.skew.html.
Example:
>>> skew = [45, 30]
>>> skew = {xs=45, ys=30, origin=[100, 100]}
Get a translated geometry by offset along each dimension. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.translate.html.
Example:
>>> translate = [2, 3]
>>> translate = {xoff=45, yoff=30}
call a function in an external Python script to write data.
writefunc
sets the file name of the script.
This script needs to be placed in the working directory.
The function name must be "writefunc" and the first argument is the object.
The dataframe of the object can be accessed through obj.dat
where obj is the argument name in your function.
Example:
>>> # code inside the external script
>>> import numpy as np
>>> def writefunc(obj):
>>> # write head results as arrray
>>> nrow = 50
>>> ncol = 100
>>> for (time,layer), r in obj.dat.iterrows():
>>> np.savetxt(f'time{time}_layer{layer}.dat', r.reshape([nrow, ncol]))
Write the geodataframe to a shapefile. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.to_file.html.
Example:
>>> to_file = 'grid.shp'