galmoss.profile package

Submodules

galmoss.profile.basic module

class galmoss.profile.basic.Ellip(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, box: Parameters)

Bases: LightProfile

R_box(mode)

The geometric correction factor in Ie to account for deviations from a perfect ellipse, influenced by the level of diskiness or boxiness. Specifically, when box = 0, indicating a perfect ellipse, R_box = 1, implying no geometric correction.

image_via_grid_from(grid: torch.tensor | torch.tensor, mode: str = 'updating_model')

Returns the light profile’s image calculated from a 2D grid. In radial profiles, the profiles are equations with radial, so grid need to transit to radial to do the further calculations.

Parameters:
  • grid – The galaxy-centered grid.

  • mode – Determine which kind of values will be called in parameter object.

Returns:

The model image calculated with the grid.

Return type:

image

image_via_radii_from(radius: torch.tensor, mode: str)

Returns the light profile’s image calculated from a radius matrix.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

Returns:

The model image calculated with the radius.

Return type:

image

make_radius(grid: Tuple[torch.Tensor, torch.Tensor], mode='updating_model')

Calculate the radius from the grid.

rmaj = |cos(θ)(x - xc)| + |sin(θ)(y - yc)| rmin = |- sin(θ)(x - xc)| + |cos(θ)(y - yc)|

r = (rmaj**(B+2) + (rmin/q)**(B+2))**(1/(B+2))

Parameters:
  • grid – The grid, transit to galaxy-centered and revise the value close to zero by the decorator.

  • mode – Determine which kind of values will be called in parameter object.

class galmoss.profile.basic.LightProfile

Bases: object

image_via_grid_from(grid: torch.tensor | torch.tensor, mode: str)

Returns the light profile’s image calculated from a 2D grid.

Parameters:
  • grid – The galaxy-centered grid.

  • mode – Determine which kind of values will be called in parameter object.

Returns:

The model image calculated with the grid.

Return type:

image

manage_params(name: str) dict

To manage the parameters in this profile. The parameters will be divide into fixed/variable params based on the value of their attribute fit, and be stored in correspoding dictionaries. These dictionaries can be called by variable_dic and fixed_dic. This function will also check the length of these parameters, which will raise error if they are not concise.

Parameters:

name – The user-defined name of this profile, which will be used in name the keys of each values in dictionaries like “profile_name” + “_” + “param_name”

galmoss.profile.basic.revise_grid(func)

Transform the grid to galaxy-centered, and then add a shift to avoid the values near to zero. Grid values which are near to zero may cause NaN or Inf in calculations.

Parameters:

func ((profile, *args, **kwargs) -> torch.tensor) – A function that receives a original grid.

Return type:

A function that can accept grids.

galmoss.profile.light_profile module

class galmoss.profile.light_profile.ExpDisk(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, mag: Parameters, scale_l: Parameters, box: Parameters | None = None)

Bases: Ellip, LightProfile

image_via_radii_from(radius, mode='updating_model')

Returns the model image of the Exponential disk profile from radius.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

class galmoss.profile.light_profile.Ferrer(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, mag: Parameters, trunc_r: Parameters, trunc_a: Parameters, trunc_b: Parameters, box: Parameters | None = None)

Bases: Ellip, LightProfile

image_via_radii_from(radius, mode='updating_model')

Returns the model image of the Ferrer profile from radius.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

class galmoss.profile.light_profile.Gaussian(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, inten: Parameters, fwhm: Parameters, box: Parameters | None = None)

Bases: Ellip, LightProfile

image_via_radii_from(radius, mode='updating_model')

Returns the model image of the Gaussion profile from radius.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

class galmoss.profile.light_profile.King(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, inten: Parameters, core_r: Parameters, trunc_r: Parameters, pow_n: Parameters, box: Parameters | None = None)

Bases: Ellip, LightProfile

image_via_radii_from(radius, mode='updating_model')

Returns the model image of the King profile from radius.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

class galmoss.profile.light_profile.Moffat(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, mag: Parameters, con: Parameters, fwhm: Parameters, box: Parameters | None = None)

Bases: Ellip, LightProfile

image_via_radii_from(radius, mode='updating_model')

Returns the model image of the Moffat profile from radius.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

class galmoss.profile.light_profile.Sersic(cen_x: Parameters, cen_y: Parameters, pa: Parameters, axis_r: Parameters, eff_r: Parameters, mag: Parameters, ser_n: Parameters, box: Parameters | None = None)

Bases: Ellip, LightProfile

image_via_radii_from(radius: torch.tensor, mode: str = 'updating_model')

Returns the model image of the sersic profile from radius.

Parameters:
  • radius – The radius of the equivalent circle.

  • mode – Determine which kind of values will be called in parameter object.

sersic_constant(ser_n: torch.tensor) float

A parameter derived from Sersic index which ensures that effective radius contains 50% of the profile’s total integrated light.

class galmoss.profile.light_profile.Sky(sky_bg: Parameters)

Bases: LightProfile

image_via_grid_from(grid: torch.tensor | torch.tensor, mode='updating_model')

Returns the model image of the flat sky light profile from a grid.

Parameters:

grid – The coordinate grid (galaxy-centered).

Module contents