-
Notifications
You must be signed in to change notification settings - Fork 25
Description
What happened?
Hi, I encountered an issue when using the .to_global() method for Slice files in fdsreader. When setting masked=True, an error occurs, whereas setting masked=False works as expected. This suggests that the issue is related to handling the masked option.
Since displaying obstructions for better orientation is very useful, I would appreciate it if you could investigate this issue :) I have attached a demo FDS file for reproduction.
error:
ValueError Traceback (most recent call last)
Cell In[6], line 9
7 slc=sim.slices
8 slc_soot = slc.get_by_id("SOOT_Z_Decke")
----> 9 data_slc, grid_coords = slc_soot.to_global(masked=True, fill=np.nan, return_coordinates=True)
File ~\AppData\Local\anaconda3\Lib\site-packages\fdsreader\slcf\slice.py:648, in Slice.to_global(self, masked, fill, return_coordinates)
644 if masked:
645 slc_data = np.where(mask, slc_data, fill)
647 grid[:, start_idx['x']: end_idx['x'], start_idx['y']: end_idx['y'],
--> 648 start_idx['z']: end_idx['z']] = slc_data.reshape(
649 (self.n_t, end_idx['x'] - start_idx['x'], end_idx['y'] - start_idx['y'],
650 end_idx['z'] - start_idx['z']))
652 if return_coordinates:
653 coordinates = dict()
ValueError: cannot reshape array of size 0 into shape (76,67,69,1)
Steps to reproduce
import fdsreader as fds
import numpy as np
path=r"-----"
sim=fds.Simulation(path)
slc=sim.slices
slc_soot = slc.get_by_id("SOOT_Z_Decke")
data_slc, grid_coords = slc_soot.to_global(masked=True, fill=np.nan, return_coordinates=True)
FDS version used
FDS-6.9.1-0-g889da6a-release
fdsreader version used
1.11.6