Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
This repository was archived by the owner on Dec 15, 2020. It is now read-only.

extract_array_2d can give results of different size. #21

Closed

Description

@hamogu
>>> large_array = np.arange(30).reshape(5,6)
>>> extract_array_2d(large_array, (3, 4), (7, 7))
 array([[65, 66, 67, 68, 69],
       [75, 76, 77, 78, 79],
       [85, 86, 87, 88, 89]])
>>> extract_array_2d(large_array, (3, 4), (0, 0))
array([[0, 1, 2],
       [6, 7, 8]])

It would be useful for me if we had either:

  • an option to return where the position I put in falls on the new image ((1,2) in the first example and (0,0) in the second example) or
  • an option to always return a (3,4) array, but fill missing values in some way (e.g. nan or return a mask of invalid entires) or
  • both (via a keyword).
    What do peopele think?

Activity

  1. hamogu commented on Jan 22, 2015

    @hamogu
    MemberAuthor

    Yes, it does. I'll open it as an astropy issue and also provide a working example (I must have edited the example above and broke it in the process).

  2. astrofrog commented on Jan 11, 2016

    @astrofrog
    Member

    Looks like this was fixed in astropy/astropy#3727 - @hamogu, feel free to re-open an issue on the astropy repository if not.

  3. hamogu commented on Jan 11, 2016

    @hamogu
    MemberAuthor

    Yes, it's fixed there.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions