Proposed new CROP_BY_ROI functionality for NDCube
Description
This issue proposes a new method or function, crop_to_roi. It would allow users supply an ROI defined by any number of real world vertices. The function would then crop the NDCube to the minimum rectangular cube in pixel coordinates that contains all vertices. In cases where the world coordinate system is aligned to the pixel grid, this would be degenerate with NDCube.crop, although allow any number of inputs, unlike NDCube.crop. However, in cases where the world coordinate system is rotated relative to the pixel grid, it can produce very different results. This would enable users to interact with NDCube based on regions or locations of interest rather than bounding boxes. This could be far more convenient is cases where the world and pixel grids are not aligned or where the user has an irregularly shaped region of interest.
An enhancement to this function could be that a polygon in world space could be constructed and array elements that fall outside the polygon could be masked. A use case would be to easily integrate flux within a region of interest. This feature could have a few customizable options. For example,based on kwargs, array elements inside the polygon could be masked, instead of outside. Likewise pixels that straddle the boundary could be masked or unmasked.