pysgems.dis package
Submodules
pysgems.dis.sgdis module
- class pysgems.dis.sgdis.Discretize(project, dx: float = 1, dy: float = 1, dz: float = 1, xo: Optional[float] = None, yo: Optional[float] = None, zo: Optional[float] = None, x_lim: Optional[float] = None, y_lim: Optional[float] = None, z_lim: Optional[float] = None)[source]
Bases:
Package- __init__(project, dx: float = 1, dy: float = 1, dz: float = 1, xo: Optional[float] = None, yo: Optional[float] = None, zo: Optional[float] = None, x_lim: Optional[float] = None, y_lim: Optional[float] = None, z_lim: Optional[float] = None)[source]
Constructs the grid geometry. The user can not control directly the number of rows and columns but instead inputs the cell size in x and y dimensions. xo, yo, x_lim, y_lim, defining the bounding box of the grid, are None by default, and are computed based on the data points distribution.
- Parameters
project – sgems project
dx – cell size in x dimension
dy – cell size in y dimension
dz – cell size in z dimension
xo – x origin
yo – y origin
zo – z origin
x_lim – x limit
y_lim – y limit
z_lim – z limit
- compute_cells(xyz: array)[source]
Determines cell location for each data point. It is necessary to know the cell number to assign the hard data property to the sgems grid.
- Parameters
xyz – Data points x, y, z coordinates
- my_cell(xyz: array)[source]
Given a point coordinate xyz [x, y, z], computes its cell number by computing the euclidean distance of each cell center.
- Parameters
xyz – x, y, z coordinate of data point
- Returns
cell number
- write_hard_data(subdata: DataFrame, dis_file: Optional[str] = None, cell_file: Optional[str] = None, output_dir: Optional[str] = None)[source]
Removes no-data rows from data frame and compute the mean of data points sharing the same cell. Export the list of shape (n features, m cells, 2) containing the node of each point data with the corresponding value, for each feature.
- Parameters
dis_file – path to the dis file
cell_file – path to the cell file
subdata – Pandas dataframe whose columns are the values of features to save as hard data.
output_dir – Directory where hard data lists will be saved
- Returns
Filtered list of each attribute
- pysgems.dis.sgdis.blocks_from_rc(rows: array, columns: array, layers: array, xo: float = 0, yo: float = 0, zo: float = 0)[source]
Yields blocks defining grid cells
- Parameters
rows – array of x-widths along a row
columns – array of y-widths along a column
layers – array of z-widths along a column
xo – x origin
yo – y origin
zo – z origin
- Returns
generator of (cell node number, block vertices coordinates, block center)