pyrsig.xdr package

Module contents

pyrsig.xdr.from_xdr(inf, na_values=None, decompress=False, as_dataframe=True)[source]

Currently supports profile, site and swath (v2.0). Each is in XDR format with a custom set of header rows in text format. The text header rows also describe the binary portion of the file.

Infers RSIG format using first 40 characters.

  • Site 2.0: from_site

  • Profile 2.0: from_profile

  • Swath 2.0: from_swath

  • Point 1.0: from_point

  • CALIPSO 1.0: from_calipso

  • Polygon 1.0: from_polygon

  • Grid 1.0: from_grid

  • Subset 9.0: from_subset

Parameters:
  • inf (file) – Data file in XDR format with RSIG headers

  • na_values (scalar) – Used to remove known missing values.

  • decompress (bool) – If True, decompress to temporary file. If False, do not decompress to temporary file (was never compressed)

  • as_dataframe (bool) – If True (default), return data as a pandas.Dataframe. If False, return a xarray.Dataset. Only subset and grid support as_dataframe.

Returns:

df – Dataframe with XDR content

Return type:

pd.DataFrame

pyrsig.xdr.from_xdrfile(path, na_values=None, decompress=None, as_dataframe=True, decompress_inline=True)[source]

Currently supports profile, site and swath (v2.0). Each is in XDR format with a custom set of header rows in text format. The text header rows also describe the binary portion of the file.

Parameters:
  • path (str) – Path to file in XDR format with RSIG headers

  • decompress (bool) – If None, use decompress if path ends in .gz If True, decompress to temporary file. If False, do not decompress to temporary file (was never compressed)

  • decompress_inline (bool) – if True (default), use gzip.open to decompress and read file if False, decompress file on disk

  • as_dataframe (bool) – If True (default), return data as a pandas.Dataframe. If False, return a xarray.Dataset. Only subset and grid support as_dataframe.

Returns:

df – Dataframe with XDR content

Return type:

pd.DataFrame