tess-bite
Take a quick bite out of TESS Full Frame Images using HTTP range requests.
tess-bite is a user-friendly package which provides fast access to sections of TESS Full-Frame Image (FFI) data. It uses the HTTP range request mechanism to download only those parts of an FFI that are required to obtain a cut-out image.
Installation
python -m pip install tess-bite
Example use
Obtain a Target Pixel File for a stationary object:
>>> from tess_bite import bite
>>> bite("Alpha Cen", shape=(10, 10))
TargetPixelFile("Alpha Cen")
Obtain a Target Pixel File centered on a moving asteroid:
>>> from tess_bite import bite_asteroid
>>> bite_asteroid("Vesta", start="2019-04-28", stop="2019-06-28)
TargetPixelFile("Vesta")
Obtain a cut-out image from a single FFI:
>>> from tess_bite import bite_ffi
>>> bite_ffi(url, col=50, row=20, shape=(20, 20))
Quickly download the header of an FFI:
>>> from tess_bite import bite_header
>>> bite_header(url, ext=0)
FitsHeader
What are HTTP range requests?
Tess-bite is powered by the HTTP range request protocol. This is a mechanism which allows a client to request specific bytes from a file on a web server. For example, downloading a 3-by-3 pixel square of 4-byte pixel values from a TESS image can be done very quickly using a HTTP request as follows:
>>> import httpx
>>> url = "https://mast.stsci.edu/portal/Download/file?uri=mast:TESS/product/tess2019142115932-s0012-2-1-0144-s_ffic.fits"
>>> resp = httpx.get(url, headers={"Range": "bytes=80000-80012,80020-80032,80040-80052"})
>>> print(resp.text)
--00000000000000000103
Content-Type: application/octet-stream
Content-Range: bytes 80000-80012/35553600
DA@DLR½DW˜oD
--00000000000000000103
Content-Type: application/octet-stream
Content-Range: bytes 80020-80032/35553600
³D .]DªJD
--00000000000000000103
Content-Type: application/octet-stream
Content-Range: bytes 80040-80052/35553600
D-aöD+W/DRD
--00000000000000000103--
Of course the difficult part is to translate pixel coordinates to byte positions, and to convert bytes to pixel values. Tess-bite takes care of these steps for you!
Documentation
Coming soon!
Similar services
TESScut is an excellent API service which allows cut outs to be obtained for stationary objects. Tess-bite provides an alternative implementation of this service by leveraging the HTTP range requests mechanism to download pixel values directly from FFI files.
Compared to TESScut, the goal of tess-bite is provide an alternative way to obtain cut-outs which does not require a central API service, but can instead be run on a local machine or in the cloud. At this time tess-bite is an experiment, we recommend that you keep using TESScut for now!
Metadata
Release files for tess-bite 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tess-bite-0.1.0.tar.gz | 6.0 kB | Without provenance | Details for tess-bite-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tess_bite-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tess_bite-0.1.0-py3-none-any.whl |
Total release size: 12.0 kB
Release files / tess-bite-0.1.0.tar.gz
| Download URL | tess-bite-0.1.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb656f32ffe9553dc41de49fa7c39f9b99eaefffa681352996b26075d5d55715
|
|
BLAKE2b-256 checksum How to use checksums |
27ee40a92dc57c06b006065f3b568e280f866f2e0559dc2e0b6d13ca78ca068f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.6 Darwin/20.2.0
|
Release files / tess_bite-0.1.0-py3-none-any.whl
| Download URL | tess_bite-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6157c45fca7484f5211595744fdbb891d072580a3b3b9953552d67e9c2dc8690
|
|
BLAKE2b-256 checksum How to use checksums |
1bb74d31325758fef4ecc8f822adea75579781442ada1863d9c511956a35d540
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.6 Darwin/20.2.0
|
Security for tess-bite 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.