ehpor / hcipy

A framework for performing optical propagation simulations, meant for high contrast imaging, in Python.

Home Page:https://hcipy.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a function to pad regularly-spaced grids

ivalaginja opened this issue · comments

Not possible for irregular grids, but this would be very useful for regularly spaced grids.

I do have that code somewhere. Let me dig it up and I will start a PR for it.

A small addition to this: cropping. The grid.subset() method is kinda meant to do that, but it's currently not smart enough to detect that you've selected a region which is still separated and so can return a Grid with SeparatedCoords. Right now, it always returns a UnstructuredCoords grid.

As a side question: what would be the arguments to this Grid.pad() function? I'd like to avoid anything to do with pixels, so it has to be physical distances in each of the axes.

Yes, I do use size units in my functions. So that should be okay. I might do this tomorrow because I have to figure out where I exactly used it....

So exactly the same problem as me XD. I also have it somewhere, but I'll let you put in the PR.