5.25. crop¶
Crops the data of the FitsArray object.
- FitsArray.crop(self, xs: List[int] | int, ys: List[int] | int, widths: List[int] | int, heights: List[int] | int, output: str | None = None) Self¶
Crops the data of the
FitsArrayobject.Parameters
xsUnion[List[int], int]x coordinate(s).
ysUnion[List[int], int]y coordinate(s).
widthsUnion[List[int], int]width(s).
heightsUnion[List[int], int]height(s).
outputOptional[str]New path to save the files.
Returns
FitsArrayA cropped
FitsArrayobject.
5.25.1. Example:¶
from myraflib import FitsArray
import math
fa = FitsArray.sample()
cropped_fa_1 = fa.crop(10, 10, 100, 100)
cropped_fa_2 = fa.crop(
[x for x in range(10)],
[y for y in range(10)],
100, 100
)