wolfhece.hydrology.read ======================= .. py:module:: wolfhece.hydrology.read .. autoapi-nested-parse:: 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 --------------- .. py:data:: NOT_A_FILE :value: -1 .. py:class:: FileIO(filename, absPath='') .. py:attribute:: name :type: str .. py:attribute:: directory :type: str .. py:attribute:: fileTxt :type: str .. py:attribute:: fileDat :type: str .. py:attribute:: type :type: int .. py:attribute:: updated :type: bool .. py:attribute:: hasTwin :type: bool .. py:method:: read() .. py:method:: get_name(fileName) .. py:method:: get_directory(fileName) .. py:method:: check_format(fileName) .. py:method:: check_twin() .. py:method:: check_twin_same() .. py:method:: update_dat2txt() .. py:method:: update_txt2dat() .. py:function:: read_bin_old(path, fileName, nbBytes=[], uniform_format=-1, hydro=False) -> list .. py:function:: read_bin(path, fileName, format='', nbBytes=[], uniform_format=-1, hydro=False, oldVersion=True) -> list .. py:function:: read_binary_file(path, fileName, format='', buffer_size=-1, init_offset=8) .. py:function:: is_relative_path(path: str) .. py:function:: relative_2_absolute(fileName: str, prefix: str = '', applyCWD: bool = True) -> tuple[bool, str] .. py:function:: read_hydro_file(path: str, fileName: str, nbCol: int = 6, nbCol_data: int = 1) -> tuple[numpy.array, numpy.array] .. py:function:: parse_hydro_data(data: numpy.array) -> tuple[numpy.array, numpy.array] .. py:function:: write_excel_from_dict(data: dict[str:dict[str:np.array]], path: str, fileName: str, time: numpy.array = None, summary: dict[str:np.array] = {}) .. py:function:: check_path(fileName: str, prefix: str = '', applyCWD: bool = True) -> tuple[bool, str] .. py:function:: write_binary_file(path: str, fileName: str, data: list, format: str = '') .. py:function:: read_txt_file(path: str, fileName: str, sep: str = '\t', header: int = 2) -> tuple[numpy.array, numpy.array] Read a text file and return the data as two numpy arrays. :param path: The path to the text file. :type path: str :param fileName: The name of the text file. :type fileName: str :param sep: The separator used in the text file. Default is tab. :type sep: str :param header: The number of header lines to skip. Default is 0. :type header: int :returns: A tuple containing two numpy arrays: time and values. :rtype: tuple .. py:function:: write_txt_file(path: str, fileName: str, data: numpy.array, sep: str = '\t', header: str = None, format: list = ['%d'] * 6 + ['%.15f']) -> None