UniqueCells

class sf3dmodels.arepo.UniqueCells(data, header)[source] [edit on github]

Bases: object

Finds non-repeated cells in the input AREPO dataset.

Parameters:
data : dict

Dictionary with the physical data of the AREPO snapshot.

header : dict

Dictionary with the header information of the AREPO snapshot.

Notes

The search for twin cells is perfomed over the gas particles only.

Methods Summary

getuniques(self, grid) Merges the mass of replicated cells into the survivor twin cell.
mergemass(self) Merges the mass of replicated cells into the survivor twin cell.

Methods Documentation

getuniques(self, grid)[source] [edit on github]

Merges the mass of replicated cells into the survivor twin cell.

Returns:
indices : 1-d numpy.ndarray, length: \(N_{non-repeated}\)

The indices of the non-repeated cells.

Notes

  • The order of the data in the input dictionary is modified for reasons of the redistribution algorithm that finds twin cells.
  • The values in the data['mass'] array will slightly be different as mass from twins was merged into the survivor cells.
  • You can access your original data via the attribute origdata.
>>> A = UniqueCells(data, header) 
>>> inds = A.mergemass() 
>>> new_rho = data['rho'][inds]
>>> orig_data = A.origdata
mergemass(self)[source] [edit on github]

Merges the mass of replicated cells into the survivor twin cell.

Returns:
indices : 1-d numpy.ndarray, length: \(N_{non-repeated}\)

The indices of the non-repeated cells.

Notes

  • The order of the data in the input dictionary is modified for reasons of the redistribution algorithm that finds twin cells.
  • The values in the data['mass'] array will slightly be different as mass from twins was merged into the survivor cells.
  • You can access your original data via the attribute origdata.
>>> A = UniqueCells(data, header) 
>>> inds = A.mergemass() 
>>> new_rho = data['rho'][inds]
>>> orig_data = A.origdata