Skip to main content

A PyTorch Dataset for the FITS file format

Project description

FITSDataset

PyPI version PyPI - Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitsdataset-0.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

fitsdataset-0.0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

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

Hashes for fitsdataset-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f1df6cd40e49fd37aacabb6a08c228ff72db3a1d0bceeed83d3bb6bee0df8bd7
MD5 141a1ad9eadae0da57de293a81413bbb
BLAKE2b-256 03639e6f9f9ddd66e9dfbe0804823d987b6292bcbc9d2c151ce4164d5036f123

See more details on using hashes here.

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

Hashes for fitsdataset-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1e80741c3f45921828eb9ba0edc2b5d5936f7e1bd422db9d3575d4bcc53f9ec3
MD5 ea8f14cf4fb6664b069c3e566be17523
BLAKE2b-256 20e4c7c9ba0d983d27c4a899fd638fd4dc563d8c4e388cb2c394b414ab52867a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page