Skip to content
Snippets Groups Projects

Draft: TEST RELEASE 3.11.4

Closed Karim Ahmed requested to merge test/3_11_4_release into master
1 file
+ 17
7
Compare changes
  • Side-by-side
  • Inline
@@ -5,7 +5,17 @@ from pathlib import Path
REGULAR_SHAPE = (512, 1024)
DIR_PATH = package_directory = Path(__file__).resolve().parent
def get_strixel_parameters(kind):
"""Returns a dictionary of strixel parameters stored in .npz file
based on the given kind.
Args:
kind (str): Specifies the type of strixel parameters to retrieve.
There is two possible values: "A0123" or "A1256"
Returns:
(dict): Dictionary contating the strixel parameters.
"""
strx_parameters = {}
if kind == "A0123":
@@ -39,20 +49,19 @@ def store_double_pixel_indices():
with np.load(file_path) as data:
for double_col in [765, 1539, 2313]:
for col in range(double_col, double_col+12):
for row in range(84 if ((col-double_col) // 4) == 1 else 86):
ydouble.append(row)
xdouble.append(col)
for col in range(double_col, double_col+12):
for row in range(84 if ((col-double_col) // 4) == 1 else 86):
ydouble.append(row)
xdouble.append(col)
np.savez(file_path, **data, ydouble=ydouble, xdouble=xdouble)
def to_strixel(data, out=None, kind="A0123"):
"""Transform from regular to strixel geometry.
Only the last two axes are considered for transformation, input data
may have any number of additional axes in front.
Args:
data (array_like): Data in regular geometry.
out (array_like, optional): Buffer for transformed output, a new
@@ -69,7 +78,8 @@ def to_strixel(data, out=None, kind="A0123"):
strx = get_strixel_parameters(kind)
if out is None:
out = np.zeros((*data.shape[:-2], *strx["frame_shape"]), dtype=data.dtype)
out = np.zeros(
(*data.shape[:-2], *strx["frame_shape"]), dtype=data.dtype)
out.reshape(*out.shape[:-2], -1)[..., ~strx["mask"]] = data.reshape(
*data.shape[:-2], -1)[..., strx["lut"]]
Loading