Skip to content

Flipped columns/rows in overscan correction #26

@ben-cassese

Description

@ben-cassese

In wcs.locate.get_observability_mask, the criteria for checking whether a coordinate is visible or not is given by:

C, R = wcs._all_world2pix(
            np.asarray([coords.ra.deg[k], coords.dec.deg[k]]).T,
            0,
            tolerance=0.0001,
            maxiter=20,
            adaptive=False,
            detect_divergence=False,
            quiet=True,
        ).T
# Update the mask with those pixels
j = (
    (C >= 0)
    & (R >= 44)
    & (C <= (wcs._naxis[0] - 30))
    & (R <= (wcs._naxis[1] - 44))
)

where j is the flag for observable or not. However, the 2-sided 44 pixel overscan should be applied to the columns, not rows, while the 30 pixel buffer should apply to the rows on the top of the detector, not the columns. Picking a random point in that's visually within the overscan region of an FFI from Sector 1, Camera 4, CCD 4, (RA=97.7, Dec=-62.62), this function incorrectly flags that it would be observable. Flipping the logic to:

j = (
    (C >= 44)
    & (R >= 0)
    & (C <= (wcs._naxis[0] - 44))
    & (R <= (wcs._naxis[1] - 30))
)

correctly flags that it's not visible.

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