Skip to content

IRIS: DB_HCLASS returned as packed int16 words instead of per-bin uint8 classes #390

Description

@aladinor

Summary

For IRIS/Sigmet RAW files, DB_HCLASS (type 55, 8-bit hydrometeor class) is returned as unsplit int16 words — each element packs TWO 8-bit class values — instead of one class per range bin like the other 8-bit types.

MRE (public IDEAM file)

import fsspec, numpy as np
from xradar.io.backends.iris import open_iris_datatree

url = "s3://s3-radaresideam/l2_data/2024/06/01/Guaviare/GUA240601000308.RAWFXK0"
with fsspec.open(f"simplecache::{url}", s3={"anon": True}) as f:
    local = f.name

ds = open_iris_datatree(local)["sweep_0"].ds
print(ds["DB_HCLASS"].dtype, np.unique(ds["DB_HCLASS"].values)[:8])
# int16 [   0    9   17  105  106  108 2304 2313]

4369 == 0x1111 and 27756 == 0x6C6C are two packed uint8 classes. A byte-level decode of the same rays gives per-bin classes {0, 9, 17, 105–108}, and word == byte0 + 256*byte1 holds element-for-element over the first nbins // 2 columns — the rest of the range dim is not meaningful per-bin data.

Expected

Per-bin uint8 classes (the same 2-bins-per-word unpacking the scaled 8-bit types get). Likely cause: SIGMET_DATA_TYPES[55] has func=None, and the func-less path skips the pair unpacking.

xradar 0.12.1.dev9+gd723857f2 (main), Python 3.12.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions