diive.ReadFileType

class diive.ReadFileType(filepath, filetypeconfig=None, filetype=None, data_nrows=None, output_middle_timestamp=True)[source]

Bases: object

Read a single data file using the settings of a filetype configuration.

Methods

__init__(filepath[, filetypeconfig, ...])

Read the file.

get_filedata()

Return the (data_df, metadata_df) read from the file.

Parameters:
  • filepath (str)

  • filetypeconfig (dict)

  • filetype (str)

  • data_nrows (int)

  • output_middle_timestamp (bool)

__init__(filepath, filetypeconfig=None, filetype=None, data_nrows=None, output_middle_timestamp=True)[source]

Read the file. Get the result with get_filedata().

Parameters:
  • filepath (str) – Path to the data file.

  • filetypeconfig (dict) – Filetype settings as dict, as read from a filetype YAML file. Used only if filetype is not given.

  • filetype (str) – Name of a built-in filetype configuration (a key from diive.configs.filetypes.get_filetypes()), e.g. 'EDDYPRO-FLUXNET-CSV-30MIN'. Takes precedence over filetypeconfig.

  • data_nrows (int) – Number of data rows to read. None reads all rows.

  • output_middle_timestamp (bool) – If True, the output timestamp index marks the middle of each averaging interval.

Example

See examples/io/io_read_single_file_with_readfiletype.py.

get_filedata()[source]

Return the (data_df, metadata_df) read from the file.

Return type:

tuple[DataFrame, DataFrame]