Utils
Some utility functions that can be used throughout the package.
- prodimopy.utils.calc_dustcolumnd(model)[source]
Calculated the vertical column density for every species at every point in the disk (from top to bottom). Very simple and rough method.
- Parameters:
model – the ProDiMo model
- Return cd:
mass column density for the dust at every point
TODO: maye put this back into the data structure as util function or both=
- prodimopy.utils.load_mplstyle(stylename='prodimopy')[source]
Simple utility function to load a matplotlib style.
In case of stylename==”prodimopy” it will load the mplstyle file from within the prodimopy package.
- Parameters:
style (str) – The name of the style that should be loaded. Default: prodimopy
- prodimopy.utils.set_param(paramFileList, param, value)[source]
Utility function that allows to change ProDiMo parameter values in a list of ProDiMo Parameters (e.g. read in from Parameter.in)
If the parameter is not found in the file it will append it at the end of the file.
If value==DELETEPARAM the routine will delete he line containing that parameter.
This routine cannot deal yet with complex parameter structures. Only works with parameters that have a single value.
- Parameters:
paramFileList (list()) – The content of the Parameter.in as a list. You can get it via f.readLines() This can also be a list that already includes changed parameters. Each entry in the list should correspond to one Parameter. Please note this input will be changed directly (i.e. the list is not copied).
param (str) – The ProDiMo parameter name (including the ! )
value (str) – the parameter value. The string will be used as is. If value is “DELETEPARAM” the parameter will be deleted. There are no checks or anything.
- Returns:
list – the paramFileList
_todo (This is quick and dirty … maybe it is worth to make this more elegant and more flexible (e.g. its own class, allow to set comments etc.))