read_binary

pylook.io.read_binary(filename, data_endianness=None, unrecognized_units='ignore', clean_header=True)

Read a look binary formatted file into a dictionary of united arrays.

Parameters
  • filename (string) – Filename or path to file to read

  • data_endianness (string) – Endianness of the data section of the file. None, ‘big’, or ‘little’. None interprets the file as it believes fit, big and little force the endianness.

  • unrecogized_units (string) – ‘ignore’ (defualt) assigns dimensionless to unrecognized units, ‘error’ will fail if unrecognized units are encountered.

  • clean_header (boolean) – Remove extra whitespace in the header data column names and units. Default True.

Returns

  • data (dict) – Dictionary of pint.Quantity arrays for each column of data.

  • metadata (dict) – Metadata from the header of the file

Notes

The data section of the file is written in the native format of the machine used to produce the file. Endianness of data is little by default, but may be changed to ‘big’ to accomodate older files or files written on power pc chips.

Examples using pylook.io.read_binary