FITSDataset
This package contains a custom PyTorch Dataset for quick and easy training on FITS files, commonly used in astronomical data analysis. In particular, the FITSDataset class caches FITS files as PyTorch tensors for the purpose of increasing training speed.
Contributions and feedback are welcome; please open a pull request or an issue.
Quickstart
Using Python 3.6+, install from source with
pip install fitsdataset
Create a toy dataset with samples from the Hyper Suprime-Cam survey with:
>>> from fitsdataset import FITSDataset
>>> dataset = FITSDataset("path/to/examples/hsc/", size=101, label_col="target")
Notice that the cached tensors appear in path/to/examples/hsc/tensors.
Preparing a dataset
Prepare your own FITS dataset by creating the following directory structure:
path/to/data/
info.csv
cutouts/
img1.fits
img2.fits
...
where info.csv has a filename column (basename) and a prediction target column. See here for an example.
Documentation
>>> from fitsdataset import FITSDataset
>>> help(FITSDataset)
Metadata
Release files for fitsdataset 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fitsdataset-0.0.3.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fitsdataset-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / fitsdataset-0.0.3.tar.gz
| Download URL | fitsdataset-0.0.3.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1df6cd40e49fd37aacabb6a08c228ff72db3a1d0bceeed83d3bb6bee0df8bd7
|
|
BLAKE2b-256 checksum How to use checksums |
03639e6f9f9ddd66e9dfbe0804823d987b6292bcbc9d2c151ce4164d5036f123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.16
|
Release files / fitsdataset-0.0.3-py3-none-any.whl
| Download URL | fitsdataset-0.0.3-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e80741c3f45921828eb9ba0edc2b5d5936f7e1bd422db9d3575d4bcc53f9ec3
|
|
BLAKE2b-256 checksum How to use checksums |
20e4c7c9ba0d983d27c4a899fd638fd4dc563d8c4e388cb2c394b414ab52867a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.16
|