TessFootprintCutout

class astrocut.TessFootprintCutout(coordinates: SkyCoord | str, cutout_size: int | ndarray | Quantity | List[int] | Tuple[int] = 25, fill_value: int | float = nan, limit_rounding_method: str = 'round', sequence: int | List[int] | None = None, verbose: bool = False)[source]

Bases: FootprintCutout

Class for generating cutouts from TESS Full Frame Images (FFIs) hosted on the cloud based on the footprint of the cutout.

Parameters:
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’.

sequenceint | list | None

Default None. Sequence(s) from which to generate cutouts. Can provide a single sequence number as an int or a list of sequence numbers. If not specified, cutouts will be generated from all sequences that contain the cutout. For the TESS mission, this parameter corresponds to sectors.

verbosebool

If True, log messages are printed to the console.

Attributes:
tess_cube_cutoutTessCubeCutout

Object containing the cutouts from the TESS cubes.

cutouts_by_filedict

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

cutoutslist

List of cutout objects.

tpf_cutouts_by_filedict

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

tpf_cutoutslist

List of cutout target pixel file objects.

Methods

cutout()

Generate the cutouts from the cloud FFIs that intersect the cutout footprint.

write_as_tpf(output_dir)

Write the cutouts as Target Pixel Files (TPFs) to the specified directory.

Attributes Summary

ARCSEC_PER_PX

S3_BASE_FILE_PATH

S3_FOOTPRINT_CACHE

Methods Summary

cutout()

Generate the cutouts from the cloud FFIs that intersect the cutout footprint.

parse_size_input(cutout_size, *[, allow_zero])

Makes the given cutout size into a length 2 array.

write_as_tpf([output_dir])

Write the cutouts to disk as target pixel files.

write_as_zip([output_dir, filename])

Package the cutout TPF files into a zip archive.

Attributes Documentation

ARCSEC_PER_PX = 21
S3_BASE_FILE_PATH = 's3://stpubdata/tess/public/mast/'
S3_FOOTPRINT_CACHE = 's3://stpubdata/tess/public/footprints/tess_ffi_footprint_cache.json'

Methods Documentation

cutout()[source]

Generate the cutouts from the cloud FFIs that intersect the cutout footprint.

Raises:
InvalidQueryError

If no files are found for the given sequences. If the given coordinates are not found within the specified sequence(s).

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 = '.') List[str][source]

Write the cutouts to disk as target pixel files.

Parameters:
output_dirstr | Path

The output directory where the cutout files will be saved.

Returns:
cutout_pathslist

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.

Parameters:
output_dirstr | Path, optional

Directory where the TPFs are written and 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:
zip_pathstr

Path to the created zip file.