Skip to content

[Discussion] Create a set of rules around cropping and pixel inclusion #8276

Open

Description

@CyclingNinja

When cropping in a cube, how do we want pixel inclusions behavior to be at the bounding box boundary

Activity

  1. CyclingNinja commented on Jun 19, 2025

    @CyclingNinja
    MemberAuthor

    If you submap(-0.5, 0.5) you get a (1,1) array, ditto for (-0.25, 25)

    Currently you can pass pixel coords to submap, but we don't want that to be the case going forward.

    Fundamentally, any pixels within your bounding box, should be returned. However there are some very specific edgecases.

    Should crop be inclusive of exclusive?
    we're defining a pixel as -0.5->+0.499999.

  2. hayesla commented on Jun 19, 2025

    @hayesla
    Member

    Image

    for context to help with our discussions 🫠

  3. CyclingNinja commented on Jun 19, 2025

    @CyclingNinja
    MemberAuthor

    Now agreed that submap should be inclusive as is the case currently on NDCube crop. i.e. submap includes top right.

    So in the case of submap(bottom_left=(-0.5, -0.5) * u.pix, top_right=(0.5, 0.5) * u.pix) returns a 2 x 2 map.

    Because 0.5, 0.5 is in the top right most pixel.

  4. moved this from Todo to Done in Map-NDCube Refactoron Jun 19, 2025
  5. ayshih commented on Jun 19, 2025

    @ayshih
    Member

    So in the case of submap(bottom_left=(-0.5, -0.5) * u.pix, top_right=(0.5, 0.5) * u.pix) returns a 2 x 2 map.

    I strongly disagree with this result

  6. added
    DiscussionAn issue opened for, or undergoing discussion.
    mapAffects the map submodule
    on Jun 19, 2025
  7. alasdairwilson commented on Sep 14, 2026

    @alasdairwilson
    Member

    @ayshih can I assume this has been resolved in sunpy/ndcube#874 and this can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionAn issue opened for, or undergoing discussion.mapAffects the map submodule

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions