Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/climatebenchpress/compressor/compressors/jpeg2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def abs_bound_codec(
*,
data_min=None,
data_max=None,
dtype=None,
**kwargs,
):
assert data_min is not None, "data_min must be provided"
assert data_max is not None, "data_max must be provided"
assert dtype is not None, "dtype must be provided"

max_pixel_val = 2**25 - 1 # maximum pixel value for our integer encoding.

Expand All @@ -56,7 +58,7 @@ def abs_bound_codec(
# increase precision for better rounding during linear quantization
numcodecs.astype.AsType(
encode_dtype="float64",
decode_dtype="float32",
decode_dtype=dtype.name,
),
# remap from [min, max] to [0, max_pixel_val]
numcodecs_wasm_fixed_offset_scale.FixedOffsetScale(
Expand Down