wolfhece.wolf_array._mnap

WolfArrayMNAP - MNAP mesh array class for WOLF2D simulations.

Extracted from wolf_array.py for modularity.

Author: HECE - University of Liege, Pierre Archambeau 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.wolf_array._mnap.split_floatstring_from_FORTRAN(value: str) list[str][source]

Useful for reading MNAP files written by the FORTRAN executable from old simulations. If the string contains two floats, returns a list where the input is split into two strings. Otherwise, returns a list with the original string as the only element.

!!! A list is returned to handle potential cases in the future where the second float might be needed.

Parameters:

value – Input string potentially containing two floats concatenated.

Returns:

List of strings after splitting.

class wolfhece.wolf_array._mnap.WolfArrayMNAP(fname=None, mold=None, masknull=True, crop=None)[source]

Bases: wolfhece.wolf_array._mb.WolfArrayMB

Inheritance diagram of wolfhece.wolf_array._mnap.WolfArrayMNAP

Matrice MNAP d’une modélisation WOLF2D

Elle contient toutes les informations de maillage en Multi-blocks ainsi que les relations de voisinage de blocs.

Surcharge de WolfArrayMB avec modification des opérations de lecture/écriture car le fichier est au format TEXTE/ASCII et d’une structure spécifique.

contour: wolfhece.PyVertexvectors.Zones[source]

Compute contour lines from this multi-block array.

The array is first converted to a single-block WolfArray before contouring.

Parameters:

levels – Number of levels or explicit list of level values.

Returns:

A Zones object containing the contour polylines.

write_all()[source]

Ecriture de tous les fichiers d’un Wolf array

Parameters:
  • newpath – new path and filename with extension – if None, use the current filename

  • EPSG – EPSG code for geotiff

read_data()[source]

Read binary block data from filename.

Creates WolfArray (GUI-enabled) instances for each block.

read_txt_header()[source]

Surcharge de la lecture du header

Il n’y a pas en tant que tel de header d’un fichier MNAP.

Les informations de translation sont dans le fichier “.trl”.

Les informations de tailles de maille ‘fines’, Nbx, Nby et coordonnées d’origine sont dans le fichier “.par”

get_one_mask(which: int | str)[source]

Return the mask of the block which

get_all_masks()[source]

Return all masks