A PyTorch Dataset for the FITS file format
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fitsdataset-0.0.3.tar.gz
.
File metadata
- Download URL: fitsdataset-0.0.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1df6cd40e49fd37aacabb6a08c228ff72db3a1d0bceeed83d3bb6bee0df8bd7 |
|
MD5 | 141a1ad9eadae0da57de293a81413bbb |
|
BLAKE2b-256 | 03639e6f9f9ddd66e9dfbe0804823d987b6292bcbc9d2c151ce4164d5036f123 |
File details
Details for the file fitsdataset-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: fitsdataset-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e80741c3f45921828eb9ba0edc2b5d5936f7e1bd422db9d3575d4bcc53f9ec3 |
|
MD5 | ea8f14cf4fb6664b069c3e566be17523 |
|
BLAKE2b-256 | 20e4c7c9ba0d983d27c4a899fd638fd4dc563d8c4e388cb2c394b414ab52867a |