TessCubeCutout

class astrocut.TessCubeCutout(input_files: List[str | Path | S3Path], coordinates: SkyCoord | str, cutout_size: int | ndarray | Quantity | List[int] | Tuple[int] = 25, fill_value: int | float = nan, limit_rounding_method: str = 'round', threads: int | Literal['auto'] = 1, verbose: bool = False)[source]

Bases: CubeCutout

Class for creating cutouts from TESS full frame image cubes.

Parameters:
input_fileslist

List of input image files.

coordinatesstr | SkyCoord

Coordinates of the center of the cutout.

cutout_sizeint | array | list | tuple | Quantity

Size of the cutout array.

fill_valueint | float

Value to fill the cutout with if the cutout is outside the image.

limit_rounding_methodstr

Method to use for rounding the cutout limits. Options are ‘round’, ‘ceil’, and ‘floor’.

threadsint | ‘auto’

The number of threads to use for making the cutouts. If ‘auto’, the number of threads will be set to the number of available CPUs.

verbosebool

If True, log messages are printed to the console.

Attributes:
cutouts_by_filedict

Dictionary where each key is an input cube filename and its corresponding value is the resulting cutout as a CubeCutoutInstance object.

cutoutslist

Return a list of cutouts as CubeCutout.CubeCutoutInstance objects.

tpf_cutouts_by_filedict

Dictionary where each key is an input cube filename and its corresponding value is the resulting cutout target pixel file object.

tpf_cutoutslist

Return the cutouts as a list of astropy.io.fits.HDUList target pixel file objects.

Methods

write_as_tpf(output_dir, output_file)

Write the cutouts to target pixel files.

Attributes Summary

cutouts

Return a list of cutouts as CubeCutout.CubeCutoutInstance objects.

tpf_cutouts

Return the cutouts as a list of astropy.io.fits.HDUList target pixel file objects.

Methods Summary

cutout()

Generate cutouts from a list of input cube files.

parse_size_input(cutout_size, *[, allow_zero])

Makes the given cutout size into a length 2 array.

write_as_tpf([output_dir, output_file])

Write the cutouts to disk as target pixel files.

write_as_zip([output_dir, filename])

Package the cutout TPF files into a zip archive without writing intermediate files.

Attributes Documentation

cutouts

Return a list of cutouts as CubeCutout.CubeCutoutInstance objects.

tpf_cutouts

Return the cutouts as a list of astropy.io.fits.HDUList target pixel file objects.

Methods Documentation

cutout()

Generate cutouts from a list of input cube files.

Returns:
cutoutslist

List of cutout memory objects.

static parse_size_input(cutout_size, *, allow_zero: bool = False) ndarray

Makes the given cutout size into a length 2 array.

Parameters:
cutout_sizeint, array-like, Quantity

The size of the cutout array. If cutout_size is a scalar number or a scalar Quantity, then a square cutout of cutout_size will be created. If cutout_size has two elements, they should be in (ny, nx) order. Scalar numbers in cutout_size are assumed to be in units of pixels. Quantity objects must be in pixel or angular units.

allow_zerobool, optional

If True, allows cutout dimensions to be zero. Default is False.

Returns:
responsearray

Length two cutout size array, in the form [ny, nx].

write_as_tpf(output_dir: str | Path = '.', output_file: str = None)[source]

Write the cutouts to disk as target pixel files.

Parameters:
output_dirstr | Path

The output directory where the cutout files will be saved.

output_filestr

The output filename. If not provided or more than one cutout is created, the filename will be generated based on the input filename. This parameter is included so that CubeCutout is backwards compatible with CutoutFactory.cube_cut.

Returns:
cutoutslist

List of file paths to cutout target pixel files.

write_as_zip(output_dir: str | Path = '.', filename: str | Path | None = None) str[source]

Package the cutout TPF files into a zip archive without writing intermediate files.

Parameters:
output_dirstr | Path, optional

Directory where the zip will be created. Default ‘.’.

filenamestr | Path | None, optional

Name (or path) of the output zip file. If not provided, defaults to ‘astrocut_{ra}_{dec}_{size}.zip’. If provided without a ‘.zip’ suffix, the suffix is added automatically.

Returns:
str

Path to the created zip file.