User Forum of Software BASEMENT

BASEMENT
Basic Simulation Environment for computation of environmental flow and natural hazard simulation
Laboratory of Hydraulics, Hydrology and Glaciology (VAW)
ETH Zurich
Basement_Logo

You are not logged in.

#1 2022-05-18 16:27:10

JBarreiro
User
From: Lisbon, Portugal
Registered: 2019-02-12
Posts: 26
Website

Error in interpolation: Zero index encountered in non-zero-indexed fil

Hi,
Hi have a quality mesh that I wish to Z interpolate using a raster (DEM).
When doing so I got this error:

FormatError: Zero index encountered in non-zero-indexed file, C:/Users/joaop/Drive IST/PhD/MAPUTO/SIG/MESH/Modelacao_MAPUTO_quality-mesh.2dm, 3

Traceback (most recent call last):
  File "C:\Users/joaop/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\plugin\gui\worker.py", line 90, in run
    value = self.target(self.feedback, *self.args, **self.kwargs)
  File "C:\Users/joaop/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\plugin\gui\interpol.py", line 216, in worker
    interpol_mesh = Mesh.open(target_layer.source())
  File "C:\Users/joaop/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\core\mesh.py", line 310, in open
    with py2dm.Reader(filename) as reader:
  File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_read.py", line 72, in __enter__
    self.open()
  File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_read.py", line 432, in open
    super().open()
  File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_read.py", line 279, in open
    *scan_metadata(file_, self._filepath, self._zero_index))
  File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_parser\_pyparser.py", line 183, in scan_metadata
    raise FormatError(
py2dm.errors.FormatError: ('Zero index encountered in non-zero-indexed file', 'C:/Users/joaop/Drive IST/PhD/MAPUTO/SIG/MESH/Modelacao_MAPUTO_quality-mesh.2dm', 3)

Any help on this?!
Thanks


João Barreiro
Environmental Engineer (MSc) - PhD Student

Offline

#2 2022-05-18 16:39:09

JBarreiro
User
From: Lisbon, Portugal
Registered: 2019-02-12
Posts: 26
Website

Re: Error in interpolation: Zero index encountered in non-zero-indexed fil

Ok, I solved this problem by changing the directory of the quality mesh to one withouth empty spaces.

Now I got the OSError: 22, Invalid argument. I know this is a known issue... Will the fix get out soon?


João Barreiro
Environmental Engineer (MSc) - PhD Student

Offline

#3 2022-05-30 09:17:28

martin_b
User
From: Herzog Ingenieure AG, CH
Registered: 2022-05-06
Posts: 7

Re: Error in interpolation: Zero index encountered in non-zero-indexed fil

I still encounter this issue even when using a short, no-space path: 'Zero index encountered in non-zero-indexed file'
The error from py2dm refers to the quality mesh 2dm file. I can see that recently generated quality meshes all start with the first node numbered as 0, whereas older 2dm files (from last year or so) start with the first node numbered as 1.

This is a snippet from a recently generated 2dm file:
MESH2D
NUM_MATERIALS_PER_ELEM 0
ND        0  2.604613e+06  1.190787e+06  0.000000e+00
ND        1  2.604693e+06  1.190490e+06  0.000000e+00
ND        2  2.604504e+06  1.190497e+06  0.000000e+00

Best regards,
Martin

Offline

Board footer

Powered by FluxBB