Side-by-side replacements for common FITS I/O tasks. fitsio remains the
right tool for some metadata workflows; torchfits targets tensor pipelines and
PyTorch training. See Benchmarks for cases
where fitsio still wins on narrow table predicates.
Medians from Round-3 scorecard (exhaustive_mps_20260719_143706 / CUDA
exhaustive_cuda_20260719_144457); see Benchmarks host
scorecard. Absolute highlight times refresh with each soak — prefer
docs/benchmarks.md#performance-highlights over this migration snapshot when
numbers disagree.
fitsio: High-performance CFITSIO reads into NumPy; there is no true OS
mmap toggle (memmap= is ignored). Long-lived FITS handles across
DataLoader forks can still share CFITSIO state poorly — prefer reopen-per-
worker or torchfits datasets.
torchfits: Use torchfits.data datasets with make_loader for multi-worker loading. Map-style datasets are worker-safe (each worker reads independently); iterable datasets shard by worker_id. Since rc2, image/table reads use private CFITSIO handles per call — no shared-handle LRU across threads. Call torchfits.cache.optimize_for_dataset(paths) when the dataset exposes files (also invoked by make_loader by default) to size metadata caches before training.
fitsio: In-place updates can corrupt FITS tables if not handled carefully, and do not invalidate read buffers automatically.
torchfits: Functions under torchfits.table (like append_rows, update_rows, insert_column, rename_columns, drop_columns) perform parallel columns reconstruction and automatically invalidate all Python-side and C++ handle/meta caches, preventing stale reads.