grater_jax.disk_model.SLD_ojax

sld_class.py

Scattered-light disk model class.

This module defines the ScatteredLightDisk class, a JAX-accelerated implementation of the GRaTeR framework for generating synthetic scattered-light disk images. It provides utilities for initializing disk parameters, packing/unpacking arrays for JAX, and computing forward-modeled scattered-light images for debris and protoplanetary disks.

Functions

recommended_num_knots(inclination_deg, ...)

Return a recommended knot count scaled to the scattering angles probed at a given inclination.

vmap(fun[, in_axes, out_axes, axis_name, ...])

Vectorizing map.

Classes

DoubleHenyeyGreenstein_SPF()

Implementation of a scattering phase function with a double Henyey Greenstein function.

DustEllipticalDistribution2PowerLaws()

Two-power-law elliptical dust density distribution model.

EMP_PSF()

Empirical point spread function (PSF) model.

GAUSSIAN_PSF()

Gaussian PSF model.

HenyeyGreenstein_SPF()

Implementation of a scattering phase function with a single Henyey Greenstein function.

InterpolatedUnivariateSpline(x, y[, k, ...])

InterpolatedUnivariateSpline_SPF()

Implementation of a spline scattering phase function.

Jax_class()

Base class for custom JAX-compatible objects that can be compressed into and uncompressed from JAX arrays.

LinearStellarPSF()

Stellar PSF model as a linear combination of reference images.

PositionalStellarPSF()

Stellar PSF model with position-dependent reference image weights.

ScatteredLightDisk()

Generate a synthetic scattered-light disk using a lightweight, JAX-accelerated version of the GRaTeR approach.

StellarPSFReference()

Reference images that the Stellar PSF classes will use.

WinniePSF(psfs, psf_inds_rolls, ...)

A class for spatially-varying PSF convolution with image cubes, including rotation and masking per roll angle.

Winnie_PSF()

Creates a JWST PSF model, using the package Winnie.

partial

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

class grater_jax.disk_model.SLD_ojax.ScatteredLightDisk

Bases: Jax_class

Generate a synthetic scattered-light disk using a lightweight, JAX-accelerated version of the GRaTeR approach.

This class provides utilities to construct surface-brightness images of inclined, possibly eccentric debris/protoplanetary disks for forward modeling and fitting.

Parameters:
  • nx (int, optional) – Number of pixels along the x axis (default 200).

  • ny (int, optional) – Number of pixels along the y axis (default 200).

  • distance (float, optional) – Distance to the star in parsecs (default 70.0).

  • itilt (float) – Inclination with respect to the line of sight in degrees (0 = pole-on; 90 = edge-on).

  • omega (float, optional) – Argument of pericenter in degrees (default 0).

  • pxInArcsec (float, optional) – Pixel scale in arcsec/pixel (default 0.01225).

  • pa (float) – Disk position angle in degrees. PA is measured from North (positive y axis) increasing counter-clockwise toward the projected major axis of the disk. With this convention, PA - 90° equals the PA of the projected semi-minor axis on the presumed front (brighter) side. This is offset by 180° from Esposito et al. (2020) and matches the convention used in VIP’s forward-modeling utilities.

  • distr_params (dict) – Dictionary controlling the dust density distribution. See “distr_params keys” below for expected fields.

  • xdo (float, optional) – Disk offset along the x axis of the disk frame (AU; default 0).

  • ydo (float, optional) – Disk offset along the y axis of the disk frame (AU; default 0).

  • keys (distr_params)

  • -----------------

  • accuracy (float, optional) – Density cutoff used for truncation (default 5e-3).

  • alpha_in (float) – Power-law slope of the inner disk (must be positive; default 5).

  • alpha_out (float) – Power-law slope of the outer disk (must be negative; default -5).

  • sma (float) – Reference radius in AU (default 60).

  • e (float, optional) – Eccentricity (default 0).

  • ksi0 (float, optional) – Scale height at the reference radius in AU (default 1).

  • gamma (float, optional) – Vertical profile exponent (2 = Gaussian, 1 = exponential; default 2).

  • beta (float, optional) – Flaring index (0 = none, 1 = linear; default 1).

  • rmin (float, optional) – Minimum semi-major axis; density is zero below this value (default 0).

Notes

The class stores its parameters in a packed array for JAX and provides helpers to pack/unpack dictionaries.

params = {'cosi': 0.0, 'cospa': 0.0, 'distance': 0.0, 'itilt': 0.0, 'nx': 0, 'ny': 0, 'omega': 0.0, 'pa': 0.0, 'pxInAU': 0.0, 'pxInArcsec': 0.0, 'rmin': 0.0, 'sini': 0.0, 'sinpa': 0.0, 'xdo': 0.0, 'ydo': 0.0}
classmethod init(distr_params, itilt, pa, alpha_in, alpha_out, sma, nx=200, ny=200, distance=50.0, omega=0.0, pxInArcsec=0.01225, xdo=0.0, ydo=0.0)

Compute derived geometric parameters and pack them into a distribution parameter array.

Parameters:
  • distr_params (jax.numpy.ndarray) – Existing packed distribution parameter array (used to resolve inclination ambiguity).

  • itilt (float) – Disk inclination with respect to the line of sight, in degrees.

  • pa (float) – Position angle of the disk, in degrees.

  • alpha_in (float) – Inner power-law index of the dust density profile.

  • alpha_out (float) – Outer power-law index of the dust density profile.

  • sma (float) – Semi-major axis (ring radius) of the disk, in AU.

  • nx (int, optional) – Number of pixels along the x axis. Default is 200.

  • ny (int, optional) – Number of pixels along the y axis. Default is 200.

  • distance (float, optional) – Distance to the star in parsecs. Default is 50.

  • omega (float, optional) – Argument of periapsis, in degrees. Default is 0.

  • pxInArcsec (float, optional) – Pixel scale in arcsec/pixel. Default is 0.01225.

  • xdo (float, optional) – Disk offset along the semi-major axis, in AU. Default is 0.

  • ydo (float, optional) – Disk offset along the semi-minor axis, in AU. Default is 0.

Returns:

Packed distribution parameter array.

Return type:

jax.numpy.ndarray

classmethod compute_scattered_light_jax(disk_params, distr_params, distr_cls, phase_func_params, phase_func_cls, x_vector, y_vector, scattered_light_map, image, limage, tmp, halfNbSlices)

Computes the scattered light image of the disk.

Parameters:
  • disk_params (dict) – Parameters describing the disk, see above for full description

  • distr_params (dict) – Parameters describing the dust density distribution function, also defined above

  • distr_cls (class) – Class describing the dust density distribution function (nominally should be DustEllipticalDistribution2PowerLaws, other distributions are not yet implemented)

  • phase_func_params (dict) – Parameters describing the phase function, see your respective phase function class for full description

  • phase_func_cls (class) – Class describing the phase function (options are HenyeyGreenstein_SPF, DoubleHenyeyGreenstein_SPF, InterpolatedUnivariateSpline_SPF)

  • halfNbSlices (integer) – half number of distances along the line of sight

classmethod pack_pars(p_dict)

Pack a parameter dictionary into a JAX array.

The order of parameters in the array is determined by the key order in cls.params.

Parameters:

p_dict (dict) – Dictionary mapping parameter names (str) to values.

Returns:

1D array of parameter values in the order specified by cls.params.

Return type:

jax.numpy.ndarray

classmethod unpack_pars(p_arr)

Unpack a parameter array into a dictionary keyed by parameter names.

Parameters:

p_arr (jax.numpy.ndarray or array-like) – 1D array of parameter values. The order must match the keys in cls.params.

Returns:

Dictionary mapping parameter names (str) to their corresponding values.

Return type:

dict