Hisreader api-doc#

Hisreader#

class hisreader.HisResults(inputdir: str, outputdir: str, structure_types: Optional[List] = None)[source]#

Class to read results from a D-HYDRO _his.nc file.

__inputdir#

directory where input file is located

Type

str

__outputdir#

directory where output (e.g. csv files) are stored

Type

str

structure_types#

list of structures to load from input file

Type

List

parse_structures(structure_types: List, structure_obj: Type[hisreader.ExtStructure], structure_names_lists: Optional[List] = None) List[source]#

General function to parse structures from His files. returns an object in self for all structures of structure_type and adds their names to a list for convenience.

Parameters
  • structure_types (List) – list containing the structure types that are to be read from the model results

  • structure_obj (ExtStructure) – object used to organize the results per structure

  • structure_names_lists (List) – list containing exactly one list per structure type. These lists contain the structure names to be loaded.

Returns

structure_list (List) – list containing a list per structure type with the loaded structures per type.

read_all_netcdf_variables() None[source]#

User function to create handles for all variables of the NetCDF file self.variable corresponds to self.__ds.variables[variable]

write_csv(output_path: Optional[str] = None, struct_list: Optional[List] = None)[source]#

Writes csvs in output_path for all structures in struct_list, or for all structures that have been parsed.

Parameters
  • output_path (str) – the output path to which the csvs are written

  • struct_list (List) – list containing the names of the structures to be written to files if struct_list is not provided, all structures are written to files

Returns

None