Skip to content

Joining arrays, where boundary is not along an axis #8615

Discussion options

You must be logged in to vote

Thanks @scottyhq for your answer.

Unfortunately my problem is slightly different (i.e. point 3: I want to join them such that the boundaries keep well away from the edges of the image footprints). If you look at my final illustration you can see how the join is equidistant from the edges of the images.

I found a way to implement this by looking for the indexes of null values along the rows of the data, something like this:

  def mask_along_overlap_center(left, right, dim='x'):

      left_finishes = left.bfill(dim=dim).isnull().argmax(dim=dim)
      right_starts = right.notnull().argmax(dim=dim)
      bisection = (left_finishes + right_starts) // 2 
  
      if left.chunks:
        ones =…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@harryC-space-intelligence
Comment options

Answer selected by scottyhq
@scottyhq
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants