arlmet.open_dataset#
- arlmet.open_dataset(filename_or_obj, *, drop_variables=None, bbox=None, bbox_crs=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 noleveldimension. 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, and so is a record flagged missing.The
levelcoordinate holds the file’s ARL level indices (surface is 0, so upper-air levels start at 1). Withlevels=the kept levels keep their original indices, which may therefore have gaps.The
forecast_hour(time)coordinate holds each time step’s forecast hour, the one its index record stores. A data record’s own forecast hour can differ (an accumulated field taken from a 6-hour forecast may say 6 where the index record says 0), but it is not represented here: HYSPLIT reads a data record’s forecast hour only as the missing flag, and the hour it uses is the index record’s.arlmet.DataRecord.forecastreads a record’s own hour.Values are as the file stores them. On a mass-coupled WRF file (source
AWRFwithMUU0andMUV0, the time-averaged winds ofarw2arl)UWND,VWNDandWWNDare coupled to the column mass, and theirdescriptionattribute gives the conversion HYSPLIT makes (UWND * MSFU / MUU0, …);arlmet.sample_points()returns the converted winds.ARL metadata is accessible via the
.arlaccessor: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 (
str|PathLike[str]) – Path to the ARL file.drop_variables (
Sequence[str] |None) – Variable names to omit from the resulting dataset.bbox (
tuple[float,float,float,float] |None) – Geographic bounding box(west, south, east, north)in degrees. On a projected grid the crop is the smallest rectangle of cells that holds the box’s part on the grid (arlmet.Grid.window_from_bbox()).bbox_crs (
Any) – The coordinate reference systembboxis in ("EPSG:32612", anythingpyproj.CRS.from_user_input()takes), making the box(xmin, ymin, xmax, ymax)in its units; the default is degrees (arlmet.Grid.window_from_bbox()).
- Returns:
attrsholdssource,vertical_flagandarlmet_version, the arlmet version that built the Dataset.- Return type: