cube_cut_from_footprint

astrocut.cube_cut_from_footprint(coordinates: str | SkyCoord, cutout_size, sequence: int | List[int] | None = None, memory_only=False, output_dir: str = '.', verbose: bool = False) List[str] | List[HDUList][source]

Generates cutouts around coordinates of size cutout_size from image cube files hosted on the S3 cloud.

Parameters:
coordinatesstr or astropy.coordinates.SkyCoord object

The position around which to cutout. It may be specified as a string (“ra dec” in degrees) or as the appropriate SkyCoord object.

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.

sequenceint, List[int], optional

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.

memory_onlybool, optional

Default False. If True, the cutouts are stored in memory and not written to disk.

output_dirstr, optional

Default ‘.’. The path to which output files are saved. The current directory is default.

verbosebool, optional

Default False. If True, intermediate information is printed.

Returns:
cutout_fileslist

List of paths to the cutout files if memory_only is False. If memory_only is True, returns a list of cutouts as memory objects.

Examples

>>> from astrocut import cube_cut_from_footprint
>>> cube_cut_from_footprint(
...         coordinates='83.40630967798376 -62.48977125108528',
...         cutout_size=64,
...         sequence=[1, 2],  # TESS sectors
...         output_dir='./cutouts')
['./cutouts/tess-s0001-4-4/tess-s0001-4-4_83.406310_-62.489771_64x64_astrocut.fits',
 './cutouts/tess-s0002-4-1/tess-s0002-4-1_83.406310_-62.489771_64x64_astrocut.fits']