CutoutFactory
- class astrocut.CutoutFactory[source]
Bases:
objectClass for creating image cutouts from TESS image cube files.
This class encompasses all of the cutout functionality. In the current version this means creating cutout target pixel files from both SPOC (Science Processing Operations Center) and TICA (Tess Image CAlibration) full frame image cubes.
This class is maintained for backwards compatibility. For maximum flexibility, we recommend using the
TessCubeCutoutclass.Methods Summary
cube_cut(cube_file, coordinates, cutout_size)Takes a cube file (as created by
CubeFactory), and makes a cutout target pixel file of the given size around the given coordinates.Methods Documentation
- cube_cut(cube_file: Union[str, Path, S3Path], coordinates: Union[SkyCoord, str], cutout_size: Union[int, ndarray, Quantity, List[int], Tuple[int]], product: str = 'SPOC', target_pixel_file: Optional[str] = None, output_path: Union[str, Path] = '.', memory_only: bool = False, threads: Union[int, Literal['auto']] = 1, verbose: bool = False)[source]
Takes a cube file (as created by
CubeFactory), and makes a cutout target pixel file of the given size around the given coordinates. The target pixel file is formatted like a TESS pipeline target pixel file.This function is maintained for backwards compatibility. For maximum flexibility, we recommend using the
TessCubeCutoutclass.- Parameters
- cube_filestr
The cube file containing all the images to be cutout. Must be in the format returned by ~astrocut.make_cube.
- coordinatesstr or
astropy.coordinates.SkyCoordobject The position around which to cutout. It may be specified as a string (“ra dec” in degrees) or as the appropriate
SkyCoordobject.- cutout_sizeint, array-like,
Quantity The size of the cutout array. If
cutout_sizeis a scalar number or a scalarQuantity, then a square cutout ofcutout_sizewill be created. Ifcutout_sizehas two elements, they should be in(ny, nx)order. Scalar numbers incutout_sizeare assumed to be in units of pixels.Quantityobjects must be in pixel or angular units.- productstr
The product type to make the cutouts from. Can either be ‘SPOC’ or ‘TICA’ (default is ‘SPOC’).
- target_pixel_filestr
Optional. The name for the output target pixel file. If no name is supplied, the file will be named:
<cube_file_base>_<ra>_<dec>_<cutout_size>_astrocut.fits- output_pathstr
Optional. The path where the output file is saved. The current directory is default.
- memory_onlybool
Optional. If true, the cutout is made in memory only and not saved to disk. Default is False.
- threadsint, “auto”, default=1
Number of threads to use when making remote (e.g. s3) cutouts, will not use threads for local access <=1 disables the threadpool, >1 sets threadpool to the specified number of threads, “auto” uses
concurrent.futures.ThreadPoolExecutor’s default: cpu_count + 4, limit to max of 32- verbosebool
Optional. If true intermediate information is printed.
- Returns