Skip to content

Tutorial 2 fails in spod.get_data #50

@MemorXuxu

Description

@MemorXuxu

Hello,
when running the tutorial 2,in the line 138 'data = spod.get_data(data)' and the error shows up. Could anyone give me a hand to solve it?
Best wishes!
XUxu

The error log is shown as below:
Reconstructed data saved in: D:\spod\PySPOD-main\tutorials\tutorial2\spod_results\nfft730_novlp0_nblks10\coeffs_0_365\reconstructed.npy
Elapsed time: 0.45338940620422363 s.
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1762: ComplexWarning: Casting complex values to real discards the imaginary part
return math.isfinite(val)
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1398: ComplexWarning: Casting complex values to real discards the imaginary part
return np.asarray(x, float)
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1762: ComplexWarning: Casting complex values to real discards the imaginary part
return math.isfinite(val)
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1398: ComplexWarning: Casting complex values to real discards the imaginary part
return np.asarray(x, float)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev\pydevd.py", line 1534, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:\spod\PySPOD-main\tutorials\tutorial2\tutorial2.py", line 138, in
data = spod.get_data(data)
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\pyspod-2.0.0-py3.9.egg\pyspod\spod\base.py", line 826, in get_data
d = d[...,np.newaxis]
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\dataarray.py", line 876, in getitem
return self.isel(indexers=self._item_key_to_dict(key))
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\dataarray.py", line 1501, in isel
ds = self._to_temp_dataset()._isel_fancy(
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\dataset.py", line 3029, in _isel_fancy
new_var = var.isel(indexers=var_indexers)
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\variable.py", line 1033, in isel
return self[key]
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\variable.py", line 797, in getitem
dims, indexer, new_order = self._broadcast_indexes(key)
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\variable.py", line 642, in _broadcast_indexes
return self._broadcast_indexes_outer(key)
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\variable.py", line 724, in _broadcast_indexes_outer
return dims, OuterIndexer(tuple(new_key)), None
File "C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\xarray-2024.6.0-py3.9.egg\xarray\core\indexing.py", line 434, in init
raise TypeError(
TypeError: invalid indexer array, does not have integer dtype: array(None, dtype=object)
python-BaseException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions