tesscube API#
- class tesscube.cube.TESSCube(sector: int, camera: int, ccd: int, tica=False, nhdr_blocks=2)[source]#
A class to obtain portions of TESS data cubes from MAST’s AWS bucket.
This class provides methods to efficiently retrieve specific portions of TESS (Transiting Exoplanet Survey Satellite) FFI data cubes, enabling users to extract and analyze the desired segments of data.
- Parameters:
- property cadence_number[source]#
Cadence number for each frame. Note this is not the same as the SPOC provided cadence numbers.
- static from_name(name: str, sector: int)[source]#
Create a TESSCube object from a name.
This method identifies the appropriate TESS cube that contains the given SkyCoord and returns a TESSCube object.
- static from_skycoord(coord: SkyCoord, sector: int)[source]#
Create a TESSCube object from a SkyCoord object.
This method identifies the appropriate TESS cube that contains the given SkyCoord and returns a TESSCube object.
- get_ffi(index: int | None = None, time: Time | None = None, ffi_name: str | None = None, raw: bool = False) HDUList [source]#
Retrieve a Full-Frame Image (FFI) from the data cube.
One of
time
,index
, orffi_name
must be provided to identify the FFI. This method caches up to 4 FFIs for efficient reuse.- Parameters:
index (int, optional) – The index of the FFI to retrieve.
time (astropy.time.Time, optional) – The time at which the FFI was captured.
ffi_name (str, optional) – The name of the FFI file.
raw (bool, optional) – Whether to retrieve the raw FFI (default is False).
- Returns:
The HDUList containing the FFI data.
- Return type:
- get_tpf(target: tuple | SkyCoord = (1014, 1014), shape: tuple = (20, 21), frame_range: tuple | None = None, frame_bin: int = 1, calculate_poscorr=True) HDUList [source]#
Retrieve a Target Pixel File (TPF) from the data cube.
The TPF contains the flux data for a specific target region, defined by either pixel coordinates or a SkyCoord object. The data can be binned over multiple frames (cadences) using
frame_bin
.- Parameters:
target (tuple or SkyCoord, optional) – The (row, column) coordinates or a SkyCoord object for the target region.
shape (tuple of int, optional) – The (number of rows, number of columns) shape of the target region.
frame_range (tuple of int, optional) – The (start, end) frame range to retrieve the data.
frame_bin (int, optional) – The number of frames to bin together (default is 1, i.e. no binning).
calculate_poscorr (bool) – Whether to calculate the
POS_CORR
columns. These are present in SPOC data but not present in some HLSPs. This takes extra time to calculate, but provides extra position information. Setting to False will result in POS_CORR1 and POS_CORR2 being set to zero.
- Returns:
The HDUList containing the TPF data.
- Return type:
Mixin class to enable queries. This is in a separate class for readability.
- async tesscube.query.async_get_ffi(ffi_name: str) HDUList [source]#
Asynchronously retrieves a full-frame image (FFI) FITS file.
- Parameters:
ffi_name (str) – The name of the full-frame image (FFI) as stored in s3.
- Returns:
The HDU list of the retrieved FFI FITS file.
- Return type:
- async tesscube.query.async_get_last_hdu(object_key: str, end: int) PrimaryHDU [source]#
Asynchronously retrieves the last HDU of a cube FITS file.
- Parameters:
- Returns:
The last HDU of the FITS file.
- Return type:
- async tesscube.query.async_get_primary_hdu(object_key: str, nhdr_blocks: int = 2) PrimaryHDU [source]#
Asynchronously retrieves the primary HDU of a cube FITS file.
- Parameters:
- Returns:
The primary HDU of the FITS file, with corrected headers.
- Return type:
- tesscube.query.list_aws_directories(dir='tess/public/')[source]#
Lists the directories in the stpubdata bucket for the given
dir
- tesscube.query.list_aws_files(dir='tess/public/')[source]#
Lists the files in the stpubdata bucket for a given
dir
Utilities to help work with cube data