imutil.ccdops.imslice
imutil.ccdops.imslice(
ccd,
trimsec,
fill_value=None,
order_xyz=True,
update_header=True,
verbose=False,
)Slice the ~astropy.nddata.CCDData using one of trimsec, bezels, or slices.
Parameters
ccd :~astropy.nddata.CCDData,~numpy.ndarray-
The ccd to be sliced. If
~numpy.ndarray, it will be converted to~astropy.nddata.CCDDatawith dummy unit (“ADU”). trimsec :str,int,listofint,listof slice,None-
It can have several forms::
- str: The FITS convention section to trim (e.g., IRAF TRIMSEC).
- [list of] int: The number of pixels to trim from the edge of the image (bezel). If list, it must be [bezel_lower, bezel_upper].
- [list of] slice: The slice of each axis (
slice(start, stop, step))
If a single
int/slice is given, it will be applied to all the axes. order_xyz :bool= True-
Whether the order of trimsec is in xyz order. Works only if the
trimsecis bezel-like (intorlistofint). If it is slice-like,trimsecmust be in the pythonic order (i.e.,[slice_for_axis0, slice_for_axis1, ...]). Default:True. fill_value :Noneorfloat-like, optional. = None-
If
None, it removes the pixels outside of it. If given asfloat-like (includingnp.nan), the bezel pixels will be replaced with this value. Default:None.
Notes
Similar to ccdproc.trim_image or imcopy. Compared to ccdproc, it has flexibility, and can add LTV/LTM to header.