chump.objects.dataobjects.shpts

define a shapefile object with time-varying property defined by a tseries object

source

set the file path of this data.

tseries: dict

set the tseries object for this shapefile. The values of the shapefile will be updated using this tseries object.

Example:

>>> [shpts.ETtseries]
>>> source = 'ETzone.shp'
>>> tseries = {tseries='ET'}
norm: str

the color scale used for color grid, either 'Normalize' or 'LogNorm', default is 'Normalize' which is linear scale color map.

colorbararg: dict

the color bar argument.

Example:

>>> colorbar = {shrink=0.88, pad=0.01, label='Simulated groundwater elevation (feet)'}
a_scale

apply scaling value a_scale to all values.

a_offset

apply offset value a_offset to all values.

limits

drop values not in limits.

Example:

>>> limits = [1000, 5000]
abslimits

drop the absolute values not in abslimits.

Example:

>>> abslimits = [1, 1e10]
add

add values of another object.

Example:

>>> add = {other={csv='obslevel'}, fill_value=0}
subtract

subtract values of another object.

Example:

>>> subtract = {other={csv='obslevel'}, fill_value=0}
mul

multiply values of another object.

Example:

>>> mul = {other={csv='obslevel'}, fill_value=1}
div

divide values of another object.

Example:

>>> div = {other={csv='obslevel'}, fill_value=1}
calculate

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.

extfunc

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:]
plotarg

plotting argument for the object

size

name of the column representing the symbol size when plotting the shapefile

sizescale

a factor to be multiplied with the size column. Default is 1.0.

sizelegendarg

argument used for the sizes in the legend.

pointlabel

name of the colum used to label the point features when plotting the shapefile.

Example:

>>> pointlabel = 'WellName'
pointlabelarg

plotting argument for the point labels

Example:

>>> pointlabelarg = {fontsize='x-small'}
legend

whether represent this object to the legend

legendlabel

set the name displayed in the legend, default is the object name

dissolve

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

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
sjoin

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

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'}}
buffer

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}
centroid

whether to get the centroid. default is false See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.centroid.html.

Example:

>>> centroid = true
concave_hull

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
convex_hull

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
simplify

Get a simplified representation of each geometry. See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.simplify.html.

Example:

>>> simplify = {tolerance=100}
affine_transform

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]
rotate

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]}
scale

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%
skew

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]}
translate

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}
zcol

set the column name defining the Z position, used in vplot.

writedata

set writedata to true to export the data. The data will saved as a CSV or SHP file.

writefunc

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]))
to_file

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'