diive.ReadFileType¶
- class diive.ReadFileType(filepath, filetypeconfig=None, filetype=None, data_nrows=None, output_middle_timestamp=True)[source]¶
Bases:
objectRead a single data file using the settings of a filetype configuration.
Methods
__init__(filepath[, filetypeconfig, ...])Read the file.
Return the
(data_df, metadata_df)read from the file.- Parameters:
- __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 fromdiive.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.