Skip to content

core

Core module for generating models aed their gradients.

model = jax.jit(model, static_argnums=model_static) module-attribute

Generically create models with substructure.

Arguments:

xyz: Coordinate grid to compute profile on.

n_isobeta: Number of isobeta profiles to add.

n_gnfw: Number of gnfw profiles to add.

n_a10: Number of Arnaud2010 profiles to add.

n_gaussian: Number of gaussians to add.

n_egaussian: Number of eliptical gaussians to add.

n_uniform: Number of uniform ellipsoids to add.

n_exponential: Number of exponential ellipsoids to add.

n_powerlaw: Number of power law ellipsoids to add.

n_powerlaw_cos: Number of radial power law ellipsoids with angulas cos term to add.

dz: Factor to scale by while integrating.
    Since it is a global factor it can contain unit conversions.
    Historically equal to y2K_RJ * dr * da * XMpc / me.

beam: Beam to convolve by, should be a 2d array.

params: 1D array of model parameters.

Returns:

model: The model with the specified substructure evaluated on the grid.

model_grad = jax.jit(model_grad, static_argnums=model_grad_static) module-attribute

A wrapper around model that also returns the gradients of the model. Only the additional arguments are described here, see model for the others. Note that the additional arguments are passed before the *params argument.

Arguments:

argnums: The arguments to evaluate the gradient at

params: 1D array of model parameters.

Returns:

model: The model with the specified substructure.

grad: The gradient of the model with respect to the model parameters.

model_tod = jax.jit(model_tod, static_argnums=model_tod_static) module-attribute

A wrapper around model that unwraps it into a TOD. Only the additional arguments are described here, see model for the others. Note that the additional arguments are passed before the *params argument.

Arguments:

dx: RA TOD in units of pixels.
    Should have Dec stretch applied.

dy: Dec TOD in units of pixels.

Returns:

model: The model with the specified substructure.
       Has the same shape as idz.

model_tod_grad = jax.jit(model_tod_grad, static_argnums=model_tod_grad_static) module-attribute

A wrapper around model_tod that also returns the gradients of the model. Only the additional arguments are described here, see model for the others. Note that the additional arguments are passed before the *params argument.

Arguments:

dx: RA TOD in units of pixels.
    Should have Dec stretch applied.

dy: Dec TOD in the same units as xyz.

argnums: The arguments to evaluate the gradient at

Returns:

model: The model with the specified substructure.

grad: The gradient of the model with respect to the model parameters.