TessFootprintCutout
- class astrocut.TessFootprintCutout(coordinates: Union[SkyCoord, str], cutout_size: Union[int, ndarray, Quantity, List[int], Tuple[int]] = 25, fill_value: Union[int, float] = nan, limit_rounding_method: str = 'round', sequence: Optional[Union[int, List[int]]] = None, product: str = 'SPOC', verbose: bool = False)[source]
Bases:
FootprintCutoutClass 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.
- productstr, optional
Deprecated since version 1.1.0: This parameter is deprecated and will be removed in a future release. Only “SPOC” products are now supported.
- verbosebool
If True, log messages are printed to the console.
- coordinatesstr |
- Attributes
- tess_cube_cutout
TessCubeCutout 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
CubeCutoutInstanceobject.- 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.
- tess_cube_cutout
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
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_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.- allow_zerobool, optional
If True, allows cutout dimensions to be zero. Default is False.
- cutout_sizeint, array-like,
- Returns
- responsearray
Length two cutout size array, in the form [ny, nx].
- write_as_tpf(output_dir: Union[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: Union[str, Path] = '.', filename: Optional[Union[str, Path]] = 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.