wolfhece.hydrology.read

Author: HECE - University of Liege, Pierre Archambeau, Christophe Dessers Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

wolfhece.hydrology.read.NOT_A_FILE = -1[source]
class wolfhece.hydrology.read.FileIO(filename, absPath='')[source]
name: str[source]
directory: str[source]
fileTxt: str[source]
fileDat: str[source]
type: int[source]
updated: bool[source]
hasTwin: bool[source]
read()[source]
get_name(fileName)[source]
get_directory(fileName)[source]
check_format(fileName)[source]
check_twin()[source]
check_twin_same()[source]
update_dat2txt()[source]
update_txt2dat()[source]
wolfhece.hydrology.read.read_bin_old(path, fileName, nbBytes=[], uniform_format=-1, hydro=False) list[source]
wolfhece.hydrology.read.read_bin(path, fileName, format='', nbBytes=[], uniform_format=-1, hydro=False, oldVersion=True) list[source]
wolfhece.hydrology.read.read_binary_file(path, fileName, format='', buffer_size=-1, init_offset=8)[source]
wolfhece.hydrology.read.is_relative_path(path: str)[source]
wolfhece.hydrology.read.relative_2_absolute(fileName: str, prefix: str = '', applyCWD: bool = True) tuple[bool, str][source]
wolfhece.hydrology.read.read_hydro_file(path: str, fileName: str, nbCol: int = 6, nbCol_data: int = 1) tuple[numpy.array, numpy.array][source]
wolfhece.hydrology.read.parse_hydro_data(data: numpy.array) tuple[numpy.array, numpy.array][source]
wolfhece.hydrology.read.write_excel_from_dict(data: dict[str:dict[str:np.array]], path: str, fileName: str, time: numpy.array = None, summary: dict[str:np.array] = {})[source]
wolfhece.hydrology.read.check_path(fileName: str, prefix: str = '', applyCWD: bool = True) tuple[bool, str][source]
wolfhece.hydrology.read.write_binary_file(path: str, fileName: str, data: list, format: str = '')[source]
wolfhece.hydrology.read.read_txt_file(path: str, fileName: str, sep: str = '\t', header: int = 2) tuple[numpy.array, numpy.array][source]

Read a text file and return the data as two numpy arrays.

Parameters:
  • path (str) – The path to the text file.

  • fileName (str) – The name of the text file.

  • sep (str) – The separator used in the text file. Default is tab.

  • header (int) – The number of header lines to skip. Default is 0.

Returns:

A tuple containing two numpy arrays: time and values.

Return type:

tuple

wolfhece.hydrology.read.write_txt_file(path: str, fileName: str, data: numpy.array, sep: str = '\t', header: str = None, format: list = ['%d'] * 6 + ['%.15f']) None[source]