Model

class peebee.models.Model

Bases: object

Base class for gravitational potential models.

Provides the foundation for all gravitational acceleration models in peebee. Subclasses must implement the accel method to define the specific physics.

Attributes Summary

n_opt_params

Get the number of optional parameters (those with default values).

n_req_params

Get the number of required parameters (those without default values).

nparams

Get the total number of model parameters.

Methods Summary

a_gal_sph(**kwargs)

accel(x, y, z, **kwargs)

Compute the acceleration at given coordinates.

alos(**kwargs)

atan(**kwargs)

get_log_params()

Get dictionary of parameter names and their log status.

get_param_default(param_name)

Get the default value for a specific parameter.

get_param_names()

Get list of all parameter names.

log_corr_params()

Get parameters in linear space for physics calculations.

log_corr_params_dict()

Get parameters in linear space for physics calculations.

param_names_to_str()

Generate a string representation of parameter names with required/optional status.

set_params(params[, ignore_name_check])

Set all model parameters from a dictionary.

toggle_log_params(param_names)

Toggle parameters to be stored/optimized in log10 space.

update_params(params)

Update a subset of model parameters by name.

Attributes Documentation

n_opt_params

Get the number of optional parameters (those with default values).

Returns:

n_opt_params (int) - Number of optional parameters

n_req_params

Get the number of required parameters (those without default values).

Returns:

n_req_params (int) - Number of required parameters

nparams

Get the total number of model parameters.

Returns:

nparams (int) - Total number of parameters

Methods Documentation

a_gal_sph(**kwargs)
accel(x, y, z, **kwargs)

Compute the acceleration at given coordinates. Must be implemented by subclasses.

X (array_like):

X coordinates (kpc)

Y (array_like):

Y coordinates (kpc)

Z (array_like):

Z coordinates (kpc)

**kwargskwargs:

Additional keyword arguments specific to the model

Returns:

acceleration (tuple) - Three-component acceleration (ax, ay, az) in mm/s/yr

alos(**kwargs)
atan(**kwargs)
get_log_params()

Get dictionary of parameter names and their log status.

Returns:

log_status (dict) - Dictionary with parameter names as keys and boolean log status as values

get_param_default(param_name)

Get the default value for a specific parameter.

Param_name (str):

Name of the parameter

Returns:

default_value (float or None) - Default value for the parameter, or None if no default

get_param_names()

Get list of all parameter names.

Returns:

param_names (list) - List of parameter name strings

log_corr_params()

Get parameters in linear space for physics calculations.

Returns:

params_linear (list) - Parameter values converted from log10 space to linear space where applicable

log_corr_params_dict()

Get parameters in linear space for physics calculations.

Returns:

params_linear (dict) - Parameter values converted from log10 space to linear space where applicable

param_names_to_str()

Generate a string representation of parameter names with required/optional status.

Returns:

param_str (str) - Comma-separated parameter names with ‘(req.)’ for required params

set_params(params, ignore_name_check=False)

Set all model parameters from a dictionary.

Params (dict):

Dictionary of parameter names and values

Ignore_name_check (bool, optional):

Skip parameter name validation. Default is False.

Returns:

None

toggle_log_params(param_names)

Toggle parameters to be stored/optimized in log10 space.

Param_names (list or str):

List of parameter names to toggle as log10, or single parameter name

Returns:

None

update_params(params)

Update a subset of model parameters by name.

Params (dict):

Dictionary of parameter names and values to update

Returns:

None