I would like to create a new filed, but I encounter one problem here.
The dataset is in Arepo format, and there is one field ('PartType0', 'GFM_Metals'), the dimension of this field is (2716294, 10). For normal field, like ('PartType0', 'Masses'), the dimension is (2716294, ). So field ('PartType0', 'GFM_Metals') has more dimensions.
Below is how I create the new field. As I only need one row from ('PartType0', 'GFM_Metals') , so that:
def _nOxy(field, data):
X_Oxygen = data['PartType0', 'GFM_Metals'][:,4]
rho = data['PartType0', 'Density']
nOxy = X_Oxygen *rho/ ds.quan(mh,'g')
ds.add_field(('PartType0', 'nOxy'), function=_nOxy,
However, it shows error:
IndexError: too many indices for array
The error is from data['PartType0', 'GFM_Metals'][:,4], where yt does not support using [:,4].
So I am wondering if there is any other method to handle this.
I am grateful for your suggestions.