arlmet.unpack#

arlmet.unpack(packed, nx, ny, precision, exponent, initial_value, driver=None, window=None)[source]#

Unpack an ARL differential byte stream into a 2D field.

This is a vectorized translation of the HYSPLIT PAKINP routine.

Parameters:
  • packed (bytes or bytearray) – The packed byte array to be unpacked.

  • nx (int) – The number of columns in the full data grid.

  • ny (int) – The number of rows in the full data grid.

  • precision (float) – Precision of the packed data. Values with an absolute value smaller than this will be set to zero.

  • exponent (int) – The packing scaling exponent.

  • initial_value (float) – The initial real value at the grid position (0,0).

  • driver (module, optional) – The array library to use for computations. If None, numpy is used by default.

  • window (GridWindow, optional) – Rectangular grid window to unpack. When provided, only the requested subset is reconstructed.

Returns:

Unpacked 2D array with shape (ny, nx) or the requested windowed shape when window is provided.

Return type:

array-like