Utilities
- pygaf.utils.add_constant_to_list(list, const)
Add a constant value to each item of a list.
- Parameters:
list (float) – 2d list of numeric values.
const (float) – Constant value to add to each list item.
- Returns:
2d list.
- pygaf.utils.conductance(K=1.0, B=1.0, W=1.0, L=1.0)
Calculate conductance value from components.
- Parameters:
K (float) – Hydraulic conductivity of external porous medium (units L/T, default 1.0).
B (float) – Thickness of external porous media normal to flow (units L, default 1,0).
W (float) – Width of external porous medium normal to flow (units L, default 1.0); should be equal to 1.0 for 1D flow,
L (float) – Lenghth of external porous medium between the boundary and external head (units L, default 1.0).
- pygaf.utils.deg2rad(deg)
Convert degrees to radians for an angle between -90 and 90 deg.
- Parameters:
deg (float) – Angle in degrees.
- Returns:
Angle in radians.
- pygaf.utils.display_image(fname, dw=8)
Display an image file from the images folder.
- Parameters:
fname (str) – Image file name.
dw (float) – Width of figure (default 8.0).
- pygaf.utils.rotate_grid(x0, y0, x, y, phi)
Rotate the coordinates of a grid.
- Parameters:
x0 (float) – X coordinate of ceter of rotation.
y0 (float) – Y coordinate of center of rotation.
x (float) – 1d list of grid x coordinates.
y (float) – 1d list of grid y coordinates.
phi (float) – Angle of clockwise rotation in radians.
- Returns:
Rotated x as 1d lsit, rotated y as 1d list.
- pygaf.utils.rotate_grid_2d(x0, y0, x, y, phi)
Rotate the coordinates of a grid in 2d format.
- Parameters:
x0 (float) – X coordinate of ceter of rotation.
y0 (float) – Y coordinate of center of rotation.
x (float) – 2d list of grid x coordinates.
y (float) – 2d list of grid y coordinates.
phi (float) – Angle of clockwise rotation in radians.
- Returns:
Rotated x as 2d list, rotated y as 2d list.
- pygaf.utils.rotate_point(x0, y0, x1, y1, phi)
Rotate the coordinates of a point.
- Parameters:
x0 (float) – X coordinate of ceter of rotation.
y0 (float) – Y coordinate of center of rotation.
x1 (float) – X coordinate of point to be rotated.
y1 (float) – Y coordinate of point to be rotated.
phi (float) – Angle of clockwise rotation in radians.
- Returns:
Tupple of rotated x and y coordinates.