synthpop.synthpop_utils
Submodules
- synthpop.synthpop_utils.coordinates_transformation
- synthpop.synthpop_utils.get_subclass
- synthpop.synthpop_utils.json_loader
- synthpop.synthpop_utils.pydantic_1_compatibility
- synthpop.synthpop_utils.sun_info
- synthpop.synthpop_utils.synthpop_control
- synthpop.synthpop_utils.synthpop_logging
- synthpop.synthpop_utils.utils_functions
Attributes
Classes
NameSpace object to store the configuration parameters |
|
Functions
|
|
|
|
|
creates the rotation matrix along a given axis. |
|
Custom JSON loader that removes comments, substitutes filenames. |
|
|
|
synthpop control and help interface |
Package Contents
- synthpop.synthpop_utils.solidangle_to_half_cone_angle(solid_angle)
- synthpop.synthpop_utils.half_cone_angle_to_solidangle(cone_angle)
- synthpop.synthpop_utils.rotation_matrix(theta_rad: float or np.ndarray or None = None, st: float or np.ndarray or None = None, ct: float or np.ndarray or None = None, axis: str = '') numpy.ndarray
creates the rotation matrix along a given axis. These are:
1 0 0 |- RX = | 0 cos -sin |
- 0 sin cos |cos 0 -sin |
- RY = | 0 1 0 |
- sin 0 cos |cos -sin 0 |
- RZ = | sin cos 0 |
- 0 0 1 |
Parameters
- theta_rad: float or np.ndarray or None [rad]
rotation angle
- st, ct: float or np.ndarray or None [rad]
sin(theta) and cos(theta)
- axis: str
string to specify the axis. either ‘x’, ‘y’, or ‘z’
Returns
- rot_matrixnp.ndarray
rotation matrix
- synthpop.synthpop_utils.get_subclass
- synthpop.synthpop_utils.json_loader(filename, json_file_branch=None)
Custom JSON loader that removes comments, substitutes filenames.
Parameters
- filenamestr
filename of the json file implemented
- json_file_branchlist
used to detect recursions
Returns
- data: dictionary
loaded json file with removes comments, substitutes filenames.
- synthpop.synthpop_utils.log_basic_statistics(df, var_name, criteria=None)
- synthpop.synthpop_utils.parser() argparse.Namespace
synthpop control and help interface
- class synthpop.synthpop_utils.Parameters(specific_config: str or None = None, default_config: str = DEFAULT_CONFIG_FILE, model_dir: str = DEFAULT_MODEL_DIR, **kwargs)
NameSpace object to store the configuration parameters defined by keyword arguments, and in the configuration files
- l_set = None
- l_set_type = None
- b_set = None
- b_set_type = None
- _categories
- loc
- model_dir
- sun
- extinction_map_kwargs
- validate_mandatory_input()
checks if all Mandatory files are provided
- location_generator() Iterator[Tuple[float, float]]
converts l_set and b_set into a location generator object as defined by the l/b_set_type
- rest_loc_iterator()
- log_settings()
log the settings as json formatted file
- read_default_config(default_config_file: str)
reads settings from keyword arguments
Parameters
- default_config_file: str
file and path of the default configuration file
Return
- config_dir: str
directory of default_config_file.
- class synthpop.synthpop_utils.PopParams
Bases:
pydantic.BaseModel- imf_func_kwargs: ModuleKwargs
- age_func_kwargs: ModuleKwargs
- metallicity_func_kwargs: ModuleKwargs
- population_density_kwargs: ModuleKwargs
- kinematics_func_kwargs: ModuleKwargs
- evolution_kwargs: ModuleKwargs | List[ModuleKwargs] | None = None
- classmethod parse_jsonfile(filename)
- class synthpop.synthpop_utils.ModuleKwargs
Bases:
pydantic.BaseModel- classmethod validate_filename(values)
- property init_kwargs
- class synthpop.synthpop_utils.SunInfo
Bases:
pydantic.BaseModel
- synthpop.synthpop_utils.default_sun