Skip to content

overwriting sma of EllipseGeometry in EllipseSample constructor #2105

@hgao-astro

Description

@hgao-astro

if geometry:
# when the geometry is inherited from somewhere else,
# its sma attribute must be replaced by the value
# explicitly passed to the constructor.
self.geometry = copy.deepcopy(geometry)
self.geometry.sma = sma

if self.sma > 0.0:
self.sector_angular_width = max(min((inner_sma / self.sma),
self._phi_max), self._phi_min)
self.initial_polar_angle = self.sector_angular_width / 2.0
self.initial_polar_radius = self.radius(self.initial_polar_angle)

When the EllipseSample constructor is provided with both an EllipseGeometry object and an sma, it overwrites the sma attribute of the EllipseGeometry object as expected. However, that is not enough because the EllipseGeometry object has already initialized an initial_polar_radius attribute using the old sma, which will not get updated. Therefore, the first sampled point may have a different radius from the rest. This is not vital when fitting the isophotes, because the samples will be recreated in the iterations; it only causes a noticeable effect in the noniterative mode that simply samples the image without fitting geometric parameters. But, fixing it should help the iterative fitting converge faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions