GXPG class¶
- class GXPG(handle=0)[source]¶
GXPG class.
Pager methods for large 2-D arrays This class handles very-large 2-D arrays in which efficient access is required along both rows and columns.
Note:
Typically a grid is accessed using the
GXIMG
class, and aGXPG
is obtained from theGXIMG
using theGXIMG.get_pg
function. Following operations on theGXPG
, it can be written back to theGXIMG
usingGXIMG.set_pg
.- copy(pgs)[source]¶
Copy the data from one pager to another.
New in version 5.0.
License: Geosoft Open License
- copy_subset(pgs, y_row_d, x_col_d, y_row_s, x_col_s, ny, nx)[source]¶
Copy a subset of data from one pager to another.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: 2D Only
- copy_subset_3d(pgs, sliced, n, vv, slices, rows, cols, n_slice, n_row, n_col)[source]¶
Copy a subset of data from one pager to another.
- Parameters:
sliced (int) – Z (slice) Origin on destination
n (int) – Y (row) Origin on destination
vv (int) – X (col) Origin on destination
slices (int) – Z (slice) Origin on source
rows (int) – Y (row) Origin on source
cols (int) – X (col) Origin on source
n_slice (int) – Number of Z (slice) to copy
n_row (int) – Number of Y (rows) to copy
n_col (int) – Number of X (columns) to copy
New in version 8.0.
License: Geosoft Open License
Note: 2D Only
- classmethod create(row, col, type)[source]¶
Creates a Pager object
- Parameters:
row (int) – # elements in y (# of row)
col (int) – # elements in x (# of column)
type (int) – GS_TYPES constants
- Returns:
GXPG
Object- Return type:
New in version 5.0.
License: Geosoft Open License
- classmethod create_3d(slice, row, col, type)[source]¶
Creates a Pager object
- Parameters:
slice (int) – # elements in z (# of slices)
row (int) – # elements in y (# of row)
col (int) – # elements in x (# of column)
type (int) – GS_TYPES constants
- Returns:
GXPG
Object- Return type:
New in version 6.2.
License: Geosoft Open License
- classmethod create_s(bf)[source]¶
Create a 2D
GXPG
from serialized source.New in version 5.0.
License: Geosoft Open License
Note: For 3D pagers, use CreateBF_PG.
- dummy()[source]¶
Sets the Entire pager to dummy.
New in version 5.0.
License: Geosoft Open License
- e_type()[source]¶
Gets the type of pager.
- Returns:
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- get(col, row)[source]¶
Read a single value from a 2D
GXPG
- Parameters:
col (int) – iBx - element # in x (column #)
row (int) – iBy - element # in y (row #)
- Return type:
float
New in version 8.3.
License: Geosoft Open License
Note: This is a low-performance method.
- is_null()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- n_cols()[source]¶
Gets the # of columns in pager.
- Returns:
# of columns.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- n_rows()[source]¶
Gets the # of rows in pager.
- Returns:
# of rows.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- n_slices()[source]¶
Gets the # of slices (z) in pager.
- Returns:
# of rows.
- Return type:
int
New in version 6.2.
License: Geosoft Open License
- range(min, max)[source]¶
Computes the range of the entire pager.
- Parameters:
New in version 5.0.
License: Geosoft Open License
- re_allocate(n_row, n_col)[source]¶
Changes the size of Pager
- Parameters:
n_row (int) – Number of Y (rows) to reallocate
n_col (int) – Number of X (columns) to reallocate
New in version 5.0.
License: Geosoft Open License
- re_allocate_3d(n_slice, n_row, n_col)[source]¶
Changes the size of 3D Pager
- Parameters:
n_slice (int) – Number of Z (slices) to reallocate
n_row (int) – Number of Y (rows) to reallocate
n_col (int) – Number of X (columns) to reallocate
New in version 6.2.
License: Geosoft Open License
- read_bf(bf, dir, conv, rev_x, rev_y, rev_z)[source]¶
Read the contents of a 2D or 3D pager to from a
GXBF
.- Parameters:
dir (int) – PG_3D_DIR constants
conv (int) – PG_BF_CONV constants
rev_x (int) – Reverse X
rev_y (int) – Reverse Y
rev_z (int) – Reverse Z
New in version 6.2.
License: Geosoft Open License
- read_col(col, o, n, vv)[source]¶
Read a set of elements in X (column) from pager into vv
- Parameters:
New in version 5.0.
License: Geosoft Open License
- read_col_3d(slice, col, o, n, vv)[source]¶
Read a set of elements in X (column) from pager into vv
- Parameters:
New in version 6.2.
License: Geosoft Open License
- read_ra(ra, dir, rev_x, rev_y, rev_z, dummy)[source]¶
Read the contents of a 2D or 3D pager to from an
GXRA
.- Parameters:
dir (int) – PG_3D_DIR constants
rev_x (int) – Reverse X
rev_y (int) – Reverse Y
rev_z (int) – Reverse Z
dummy (str) – Dummy
New in version 6.2.
License: Geosoft Open License
Note: Each line must hold only 1 value
- read_row(row, o, n, vv)[source]¶
Read a set of elements in Y (row) from pager into vv
- Parameters:
New in version 5.0.
License: Geosoft Open License
- read_row_3d(slice, row, o, n, vv)[source]¶
Read a set of elements in Y (row) from pager into vv
- Parameters:
New in version 6.2.
License: Geosoft Open License
- read_trace_3d(col, row, o, n, vv)[source]¶
Read a set of elements in Z (trace) from pager into vv
- Parameters:
New in version 6.3.
License: Geosoft Open License
- serial(bf)[source]¶
Serialize a 2D
GXPG
to aGXBF
.New in version 5.0.
License: Geosoft Open License
Note: For 3D pagers, use
write_bf
.
- set(col, row, value)[source]¶
Write a single value to a 2D
GXPG
- Parameters:
col (int) – iBx - element # in x (column #)
row (int) – iBy - element # in y (row #)
value (float) – value to set
New in version 9.10.
License: Geosoft Open License
Note: This is a low-performance method.
- statistics(st)[source]¶
Compute the statistics of a pager object.
- Parameters:
st (GXST) – hST - statistics object
New in version 6.3.1.
License: Geosoft End-User License
- write_bf(bf, dir, conv, rev_x, rev_y, rev_z)[source]¶
Write the contents of a 2D or 3D pager to a
GXBF
.- Parameters:
dir (int) – PG_3D_DIR constants
conv (int) – PG_BF_CONV constants
rev_x (int) – Reverse X
rev_y (int) – Reverse Y
rev_z (int) – Reverse Z
New in version 6.2.
License: Geosoft Open License
- write_bf_ex(bf, dir, conv, rev_x, rev_y, rev_z, p_dummy)[source]¶
Write the contents of a 2D or 3D pager to a
GXBF
.- Parameters:
dir (int) – PG_3D_DIR constants
conv (int) – PG_BF_CONV constants
rev_x (int) – Reverse X
rev_y (int) – Reverse Y
rev_z (int) – Reverse Z
p_dummy (float) – Dummy value
New in version 9.3.
License: Geosoft Open License
- write_col(col, o, n, vv)[source]¶
Write a set of elements in X (column) from vv into pager
- Parameters:
New in version 5.0.
License: Geosoft Open License
- write_col_3d(slice, col, o, n, vv)[source]¶
Write a set of elements in X (column) from vv into pager
- Parameters:
New in version 6.2.
License: Geosoft Open License
- write_row(row, o, n, vv)[source]¶
Write a set of elements in Y (row) from vv into pager
- Parameters:
New in version 5.0.
License: Geosoft Open License
- write_row_3d(slice, row, o, n, vv)[source]¶
Write a set of elements in Y (row) from vv into pager
- Parameters:
New in version 6.2.
License: Geosoft Open License
- write_trace_3d(col, row, o, n, vv)[source]¶
Write a set of elements in Z (trace) from pager into vv
- Parameters:
New in version 6.3.
License: Geosoft Open License
- write_wa(wa, dir, rev_x, rev_y, rev_z, dummy)[source]¶
Write the contents of a 2D or 3D pager to a
GXWA
- Parameters:
dir (int) – PG_3D_DIR constants
rev_x (int) – Reverse X
rev_y (int) – Reverse Y
rev_z (int) – Reverse Z
dummy (str) – Dummy
New in version 6.2.
License: Geosoft Open License
Note: Each line will hold only 1 value
PG_3D_DIR constants¶
3D Pager direction
PG_BF_CONV constants¶
Pager binary conversions