Overlap

class sf3dmodels.grid.Overlap(GRID)[source] [edit on github]

Bases: sf3dmodels.grid.NeighbourRegularGrid

Host class with functions to overlap submodels either from files or from prop objects into a single regular grid.

Parameters:
GRID : Struct

Grid structure where submodels will be merged in.

Attributes:
min_values : dict, optional

Dictionary containing the base minimum values for the final-overlaped physical properties.

Methods Summary

fromfiles(self, columns[, submodels, …]) Overlaps submodels from files.
fromprops(self, props) In preparation.

Methods Documentation

fromfiles(self, columns, submodels='all', weighting_dens='all', rt_code='lime', folder='./Subgrids')[source] [edit on github]

Overlaps submodels from files. The input files structure is the same as that of the files written by submodel.

Parameters:
columns : array_like, shape (ncols,)

List object containing the column names of the input submodel files.

submodels : ‘all’ or array_like, optional

If ‘all’: reads all the ‘.dat’ files within folder.

If array_like: File names to be considered by the algorithm.

Defaults to ‘all’.

weighting_dens : str, optional

Density column name for weighting the non-density properties. See equations in the Notes section.

If ‘all’: The algorithm takes the sum of all the density columns multiplied by their respective atomic mass.

Defaults to ‘all’.

rt_code : ‘lime’ or ‘radmc3d’, optional

Radiative transfer code that is going to be used later with the output prop.

folder : str, optional

Folder name were the submodel files are located. Defaults to ‘./Subgrids’.

Returns:
final_dict : dict

Dictionary containing the overlaped properties. The dictionary keys are the physical properties from the input columns.

Notes

The overlaping is computed via a direct addition for the densities ( \(\rho\)) and a weighted-by-density average for the remaining properties (\(X\)) as follows:

\[ \begin{align}\begin{aligned}\rho_{\rm tot} &= \sum^{N}_{i=0} \rho_i,\\X &= \frac{\sum^{N}_{i=0} \rho_{i} X_i } {\rho_{\rm tot}},\end{aligned}\end{align} \]

where \(N\) is the number of submodels involved in the process and \(\rho\) the weighting density specified via weighting_dens.

fromprops(self, props)[source] [edit on github]

In preparation.