arlmet.open_dataset#

arlmet.open_dataset(filename_or_obj, *, drop_variables=None, bbox=None, levels=None)[source]#

Open an ARL meteorology file as an xarray Dataset.

Surface-only variables (e.g. SHGT, T02M, PRSS) have dimensions (time, lat, lon) with no level dimension. Upper-air variables (e.g. UWND, VWND, TEMP) have dimensions (time, level, lat, lon). An upper-air variable stored on only some levels (or times) is NaN where the file has no record for it; write_dataset() writes no record for such all-NaN slices.

The level coordinate holds the file’s ARL level indices (surface is 0, so upper-air levels start at 1). With levels= the kept levels keep their original indices, which may therefore have gaps.

ARL metadata is accessible via the .arl accessor:

ds = arlmet.open_dataset("met.arl")
ds.arl.grid  # Grid object (survives isel/sel)
ds.arl.vertical_axis  # VerticalAxis
ds.isel(level=0)  # selects level 0 for upper vars; sfc vars unchanged
Parameters:
  • filename_or_obj (path-like) – Path to the ARL file.

  • drop_variables (sequence of str, optional) – Variable names to omit from the resulting dataset.

  • bbox (tuple[float, float, float, float], optional) – Geographic bounding box (west, south, east, north) in degrees.

  • levels (iterable of int, optional) – ARL level indices to keep.

Return type:

xarray.Dataset