Skip to content

open_nexradlevel2_datatree fails on S3/fsspec cached Level II files (record_number is None) #382

Description

@syedhamidali

Reading NEXRAD Level II data fails when using S3 or fsspec cached files.

Example (fails):

import fsspec
import xradar as xd
file = (
    "unidata-nexrad-level2/2013/05/20/"
    "KTLX/KTLX20130520_201643_V06.gz"
)
local_file = fsspec.open_local(
    f"simplecache::s3://{file}",
    s3={"anon": True},
    filecache={"cache_storage": "./cache"},
)
dtree = xd.io.open_nexradlevel2_datatree(local_file)

Also fails with direct S3 access:

file = (
    "noaa-nexrad-level2/2013/05/20/"
    "KTLX/KTLX20130520_201643_V06"
)
dtree = xd.io.open_nexradlevel2_datatree(
    f"s3://{file}",
    storage_options={"anon": True},
)

Error

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Occurs in init_next_record because record_number is None.

⸻

Environment

  • xradar 0.2.2
  • Python 3.12
  • fsspec + s3fs latest

⸻

Notes

  • File downloads correctly, issue happens during parsing
  • Same file works when converted to CfRadial and opened with open_cfradial1_datatree

⸻

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions