Skip to content

Loading npy files with 1d data #43

@mcrot

Description

@mcrot

Is loading of 1D data from an npy file supposed to work like this?

In [33]: from SurfaceTopography import open_topography

In [34]: import numpy as np

In [35]: arr = np.arange(0,10)

In [36]: np.save("test.npy", arr)

In [37]: r = open_topography("test.npy")

In [38]: r.topography(physical_sizes=(10,))
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-38-9ad2a6e19994> in <module>
----> 1 r.topography(physical_sizes=(10,))

~/miniconda3/envs/topobank/lib/python3.7/site-packages/SurfaceTopography/IO/NPY.py in topography(self, channel_index, physical_sizes, height_scale_factor, info, periodic, subdomain_locations, nb_subdomain_grid_pts)
    112                 heights=self.mpi_file.read(
    113                     subdomain_locations=subdomain_locations,
--> 114                     nb_subdomain_grid_pts=nb_subdomain_grid_pts),
    115                 physical_sizes=physical_sizes,
    116                 periodic=periodic,

~/miniconda3/envs/topobank/lib/python3.7/site-packages/NuMPI/IO/MPIFileIO.py in read(self, subdomain_locations, nb_subdomain_grid_pts)
    286             # number of blocks  : length of data in the non-contiguous
    287             # direction
--> 288             nb_subdomain_grid_pts[iy],
    289             # length of block : length of data in contiguous direction
    290             self.nb_grid_pts[iy]

IndexError: tuple index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions