arlmet.internal_levels#

arlmet.internal_levels(file, *, model_top=25000.0)[source]#

Return HYSPLIT’s internal vertical levels for a run on file with model_top.

HYSPLIT does not read the met at a particle’s own height: it fills its own internal levels at every grid point and reads the particle between two of them. For the run’s top of model domain and the file’s vertical grid, HYSPLIT’s metlvl.f picks one of six grids of heights a k**2 + b k + c; these are the levels sample_points() uses at heights with the same model_top.

Parameters:
  • file (File | str | PathLike[str] | Dataset) – An open ARL file, the path to one, or a Dataset in arlmet.open_dataset()’s layout, such as a converter’s output, as sample_points() takes. Only its vertical axis and source are read; a path is opened and closed here.

  • model_top (float) – The run’s top of model domain [m] (the CONTROL line after the vertical motion option; PYSTILT’s z_top), as in sample_points().

Return type:

InternalLevels

Raises:

ValueError – If model_top is not a positive number.

See also

InternalLevels

The returned levels.

sample_points

Samples on these levels at heights.

Examples

>>> import arlmet
>>> levels = arlmet.internal_levels("met.arl")
>>> levels.zmdl
25000.0
>>> levels.heights[:4]
array([ 10.,  75., 200., 385.])