Skip to content

grid_from_bounding_box generates points outside the bounding box #598

@braingram

Description

@braingram

Here's a relatively minimal example:

>>  gwcs.grid_from_bounding_box([[0, 5], [0, 5]], step=2, center=False)
array([[[0, 2, 4, 6],
        [0, 2, 4, 6],
        [0, 2, 4, 6],
        [0, 2, 4, 6]],

       [[0, 0, 0, 0],
        [2, 2, 2, 2],
        [4, 4, 4, 4],
        [6, 6, 6, 6]]])
>> gwcs.grid_from_bounding_box([[0, 5], [0, 5]], step=2, center=True)
array([[[0., 2., 4., 6.],
        [0., 2., 4., 6.],
        [0., 2., 4., 6.],
        [0., 2., 4., 6.]],

       [[0., 0., 0., 0.],
        [2., 2., 2., 2.],
        [4., 4., 4., 4.],
        [6., 6., 6., 6.]]])

The 6s are unexpected. I'm not sure if center=False returning int64 is expected (or if center=True/False should return different values).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions