the mode expansion array is not but has to be initialized with zeros, probably just use np.zeros https://github.com/skuschel/postpic/blob/0a21d72c3bb3e558f01a86c22199a2b310b2c84d/postpic/datareader/openPMDh5.py#L278C14-L278C22