Skip to content

flux computed in ellipses rotated by pi/2 instead of theta #351

@richellevc

Description

@richellevc

In photometry.py, line 90 to 94, the fluxes of the sources are computed in ellipses that are all rotated by pi/2.
See code snippet below:

# Calcuate the equivilent of flux_auto
flux, fluxerr, flag = sep.sum_ellipse(data, sources['x'], sources['y'],
                                      sources['a'], sources['b'],
                                      np.pi / 2.0, 2.5 * kronrad,
                                      subpix=1, err=error)

The same is passed to sep.sum_ellipse when computing background fluxes in the ellipses (line 141 to 144):

# Calculate the average background at each source
bkgflux, fluxerr, flag = sep.sum_ellipse(bkg.back(), sources['x'], sources['y'],
                                         sources['a'], sources['b'], np.pi / 2.0,
                                         2.5 * sources['kronrad'], subpix=1)

This might be a bug, as the ellipse parameters of the extracted sources are (a,b,theta), so each aperture is rotated by a different angle theta. If this is indeed a bug, suggested solutions would be:

# Calcuate the equivilent of flux_auto
flux, fluxerr, flag = sep.sum_ellipse(data, sources['x'], sources['y'],
                                      sources['a'], sources['b'],
                                      sources['theta'], 2.5 * kronrad,
                                      subpix=1, err=error)

# Calculate the average background at each source
bkgflux, fluxerr, flag = sep.sum_ellipse(bkg.back(), sources['x'], sources['y'],
                                         sources['a'], sources['b'], sources['theta'],
                                         2.5 * sources['kronrad'], subpix=1)

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