CoolFace
Datasetpublic

Smith42/galaxies-with-hats

Galaxies with HATS This is a HATS (HEALPix Adaptive Tiling Scheme) version of Smith42/galaxies (revision v2.0): ~8.5 million 256×256 pixel PNG galaxy cutouts from the DESI Legacy Survey DR8, centred on the galaxy source, spatially partitioned on the sky, and bundled with all ~160 metadata columns (Galaxy Zoo DESI morphologies, NSA photometry, redshifts, and OSSY / ALFALFA / JHU-MPA cross-matches) in every row. Where the original dataset is ordered for ML training, this… See the full description on the dataset page: https://huggingface.co/datasets/Smith42/galaxies-with-hats.

sourceHugging Facecc-by-sa-4.0updated 3mo agoView on Hugging Face
0likes218downloads
Dataset Card

<center> <img src="assets/skycoveragetrain.png" width="80%" alt="Sky coverage and galaxy density map, train split" /> </center>

<img src="assets/galaxy-with-hat.png" width="30" alt="galaxy with hat" style="display: inline; vertical-align: middle;" /> Galaxies with HATS <img src="assets/galaxy-with-hat.png" width="30" alt="galaxy with hat" style="display: inline; vertical-align: middle;" />

This is a HATS (HEALPix Adaptive Tiling Scheme) version of Smith42/galaxies (revision v2.0): ~8.5 million 256×256 pixel PNG galaxy cutouts from the DESI Legacy Survey DR8, centred on the galaxy source, spatially partitioned on the sky, and bundled with all ~160 metadata columns (Galaxy Zoo DESI morphologies, NSA photometry, redshifts, and OSSY / ALFALFA / JHU-MPA cross-matches) in every row.

Where the original dataset is ordered for ML training, this edition is ordered for sky-based analysis: every row carries ra/dec (degrees) and a _healpix_29 spatial index, and rows are partitioned into HEALPix tiles so that cone / box / cross-match queries touch only the relevant files.

The original 98/1/1 train/validation/test splits are preserved as three separate HATS collections:

CollectionRowsHEALPix partitionsSize
`train`8,474,5661,555~709 GB
`validation`86,49927~7.3 GB
`test`86,47127~7.3 GB

Stream it with 🤗 Datasets

HATS is plain Parquet, so the usual Hugging Face stack works out of the box (see Multimodal Universe × HATS):

python
from datasets import load_dataset

galaxies = load_dataset("Smith42/galaxies_with_hats", split="train", streaming=True)
example = next(iter(galaxies))
example["image"]  # -> PIL image, decoded automatically

Unlike the original ML-ordered repo, streaming order here follows the HEALPix sky tiling, meaning that consecutive examples are sky neighbours. Great for spatially coherent browsing; if you want i.i.d.-ish batches for training, add .shuffle(buffer_size=10_000) or stream the original Smith42/galaxies instead.

Sky queries with LSDB

We recommend LSDB (pip install lsdb) for spatial work with HATS catalogs:

python
import lsdb

# Open a split (lazy -- nothing is downloaded yet)
galaxies = lsdb.open_catalog("hf://datasets/Smith42/galaxies_hats/train")

# One-degree cone around (RA, Dec) = (161.0, 48.0)
cone = lsdb.open_catalog(
    "hf://datasets/Smith42/galaxies_hats/train",
    search_filter=lsdb.ConeSearch(ra=161.0, dec=48.0, radius_arcsec=3600.0),
)
df = cone.compute()  # materialise to pandas; df["image"]["bytes"] holds the JPGs

# Cross-match your own catalog against the galaxy images
# my_cat = lsdb.from_dataframe(my_dataframe, ra_column="ra", dec_column="dec")
# matched = my_cat.crossmatch(galaxies, radius_arcsec=1.0)

Each catalog is also a plain Apache Parquet dataset (<split>/<split>/dataset/), directly readable with pandas, pyarrow, dask, Spark, or DuckDB — partitions are laid out as Norder={order}/Dir={dir}/Npix={pixel}.parquet HEALPix tiles of ~10,000 rows (≈0.8 GB) each.

python
import pandas as pd  # read a single sky tile

tile = pd.read_parquet(
    "hf://datasets/Smith42/galaxies_hats/test/test/dataset/Norder=0/Dir=0/Npix=4.parquet"
)

Catalog columns

All three collections share an identical 170-column schema: the original image (struct of PNG bytes + path, decoded as an image by 🤗 datasets), dr8_id, galaxy_size, ra, dec, and all metadata columns of Smith42/galaxies v2.0, plus the _healpix_29 spatial index added by HATS.

The main HATS catalog contains the following columns:

**Name****`_healpix_29`****`image`****`dr8_id`****`galaxy_size`****`ra`****`dec`****`brickid`****`objid`****`smooth-or-featured_smooth_fraction`****`smooth-or-featured_featured-or-disk_fraction`****`smooth-or-featured_artifact_fraction`****`disk-edge-on_yes_fraction`****`disk-edge-on_no_fraction`****`has-spiral-arms_yes_fraction`****`has-spiral-arms_no_fraction`****`bar_strong_fraction`****`bar_weak_fraction`****`bar_no_fraction`****`bulge-size_dominant_fraction`****`bulge-size_large_fraction`****`bulge-size_moderate_fraction`****`bulge-size_small_fraction`****`bulge-size_none_fraction`****`how-rounded_round_fraction`****`how-rounded_in-between_fraction`****`how-rounded_cigar-shaped_fraction`****`edge-on-bulge_boxy_fraction`****`edge-on-bulge_none_fraction`****`edge-on-bulge_rounded_fraction`****`spiral-winding_tight_fraction`****`spiral-winding_medium_fraction`****`spiral-winding_loose_fraction`****`spiral-arm-count_1_fraction`****`spiral-arm-count_2_fraction`****`spiral-arm-count_3_fraction`****`spiral-arm-count_4_fraction`****`spiral-arm-count_more-than-4_fraction`****`spiral-arm-count_cant-tell_fraction`****`merging_none_fraction`****`merging_minor-disturbance_fraction`****`merging_major-disturbance_fraction`****`merging_merger_fraction`****`file_name`****`iauname`****`est_petro_th50`****`mag_r_desi`****`mag_g_desi`****`mag_z_desi`****`petro_theta`****`petro_th50`****`petro_th90`****`petro_phi50`****`petro_phi90`****`petro_ba50`****`petro_ba90`****`elpetro_ba`****`elpetro_phi`****`elpetro_flux_r`****`elpetro_theta_r`****`elpetro_mass`****`sersic_n`****`sersic_ba`****`sersic_phi`****`elpetro_absmag_f`****`sersic_nmgy_f`****`elpetro_absmag_n`****`sersic_nmgy_n`****`elpetro_absmag_u`****`sersic_nmgy_u`****`elpetro_absmag_g`****`sersic_nmgy_g`****`elpetro_absmag_r`****`sersic_nmgy_r`****`elpetro_absmag_i`****`sersic_nmgy_i`****`elpetro_absmag_z`****`sersic_nmgy_z`****`redshift_nsa`****`mag_f`****`mag_n`****`mag_u`****`mag_g`****`mag_r`****`mag_i`****`mag_z`****`u_minus_r`****`elpetro_mass_log`****`dr7objid_ossy`****`ra_ossy`****`dec_ossy`****`redshift_ossy`****`log_l_oiii`****`fwhm`****`e_fwhm`****`equiv_width`****`log_l_ha`****`log_m_bh`****`upper_e_log_m_bh`****`lower_e_log_m_bh`****`log_bolometric_l`****`ra_alf`****`dec_alf`****`W50`****`sigW`****`W20`****`HIflux`****`sigflux`****`SNR`****`RMS`****`Dist`****`sigDist`****`logMH`****`siglogMH`****`ra_jhu`****`dec_jhu`****`fibre_sfr_avg`****`fibre_sfr_entropy`****`fibre_sfr_median`****`fibre_sfr_mode`****`fibre_sfr_p16`****`fibre_sfr_p2p5`****`fibre_sfr_p84`****`fibre_sfr_p97p5`****`fibre_ssfr_avg`****`fibre_ssfr_entropy`****`fibre_ssfr_median`****`fibre_ssfr_mode`****`fibre_ssfr_p16`****`fibre_ssfr_p2p5`****`fibre_ssfr_p84`****`fibre_ssfr_p97p5`****`total_ssfr_avg`****`total_ssfr_entropy`****`total_ssfr_flag`****`total_ssfr_median`****`total_ssfr_mode`****`total_ssfr_p16`****`total_ssfr_p2p5`****`total_ssfr_p84`****`total_ssfr_p97p5`****`total_sfr_avg`****`total_sfr_entropy`****`total_sfr_flag`****`total_sfr_median`****`total_sfr_mode`****`total_sfr_p16`****`total_sfr_p2p5`****`total_sfr_p84`****`total_sfr_p97p5`****`photoz_id`****`ra_photoz`****`dec_photoz`****`photo_z`****`photo_zerr`****`spec_z`****`mag_abs_g_photoz`****`mag_abs_r_photoz`****`mag_abs_z_photoz`****`mass_inf_photoz`****`mass_med_photoz`****`mass_sup_photoz`****`sfr_inf_photoz`****`sfr_sup_photoz`****`ssfr_inf_photoz`****`ssfr_med_photoz`****`ssfr_sup_photoz`****`sky_separation_arcsec_from_photoz`****`redshift`****`est_petro_th50_kpc`****`__index_level_0__`**
Data Typeint64struct<bytes: binary, path: string>stringint64doubledoubleint32int32floatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatstringstringdoublefloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatdoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoublefloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatdoubledoublefloatfloatfloatfloatfloatfloatfloatdoublefloatfloatfloatfloatfloatfloatfloatdoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubleint64
Null count0N/A0000000007,585,145 (89.5%)7,585,145 (89.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)7,923,531 (93.5%)1,508,220 (17.8%)1,508,220 (17.8%)1,508,220 (17.8%)8,288,807 (97.81%)8,288,807 (97.81%)8,288,807 (97.81%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)8,116,934 (95.78%)000007,882,536 (93.01%)0014,543 (0.17%)17,007 (0.2%)7,882,536 (93.01%)7,882,536 (93.01%)7,882,536 (93.01%)7,882,571 (93.01%)7,882,570 (93.01%)7,882,571 (93.01%)7,882,570 (93.01%)7,882,570 (93.01%)7,882,570 (93.01%)7,882,536 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,536 (93.01%)7,882,536 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,537 (93.01%)7,882,542 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,536 (93.01%)7,882,542 (93.01%)7,882,540 (93.01%)7,882,536 (93.01%)7,934,716 (93.63%)7,902,017 (93.24%)7,882,672 (93.02%)7,882,572 (93.01%)7,882,571 (93.01%)7,882,596 (93.01%)7,882,795 (93.02%)7,882,579 (93.01%)7,882,542 (93.01%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,471,529 (99.96%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)8,446,786 (99.67%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,440 (90.88%)7,701,440 (90.88%)7,701,438 (90.88%)7,701,440 (90.88%)7,701,440 (90.88%)7,701,440 (90.88%)7,701,440 (90.88%)7,701,438 (90.88%)7,701,686 (90.88%)7,702,153 (90.89%)7,701,438 (90.88%)7,702,153 (90.89%)7,702,153 (90.89%)7,702,153 (90.89%)7,702,153 (90.89%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)7,701,438 (90.88%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)632,529 (7.46%)624,776 (7.37%)7,400,771 (87.33%)624,776 (7.37%)626,277 (7.39%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)624,776 (7.37%)620,954 (7.33%)620,954 (7.33%)0
Example row396125208651480696{'bytes': b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x01\x00\x00\x…594276_2294010179.552.645942762290.77930.16120.05948<NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA>0.099850.88880.01132<NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA>0.77960.17140.038120.01085data/594276_229.jpg<NA>2.62217.7318.1917.4<NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA>8.002e+15179.552.640.079620.0192<NA>-19.72-20.14-20.458.9168.958.9841.7321.868-7.196-7.128-7.04400.079623.9437154494
Minimum value739458926660N/A100000_108110942.953e-05-65.92861200.013510.018370.027480.013250.011190.029620.010140.014880.025450.029170.0062990.0080420.024870.0170.0066050.010360.012390.0074990.015650.010610.029940.013030.020920.010850.0095530.029660.0067510.0061360.0061340.010040.038160.023090.010190.008846data/100000_1081.jpgJ000000.74-091320.20.81558.82-13.78-16.47-0-0-00.013310.007782-0.9724-0.9724-0.97240.007782-1.958e+05-9999-00.50.150.0003052-26.29-1.794e+15-26.32-1.832e+16-27.26-1.15e+04-28.27-2.413e+07-28.59-1.538e+07-28.64-3.35e+07-28.14-4.193e+07-0.003335-15.01-3.2187.6858.3145.7796.6857.777-7.035-∞5.877e+170.5123-10.960.01596-999913204.18.540.596.13-0-0-9.990.00333-0.206191-0-7.610.021.21.282.10.26.110.040.000686-11.25-5-6.917-∞-5-∞-∞-∞-∞-13.3-6.957-13.35-16-13.79-14.87-12.87-12.27-99-7.253-0-99-99-99-99-99-99-99-6.851-0-99-99-99-99-99-998e+152.953e-05-65.890.0013.075e-050.0001144-32.36-32.48-33.13-99-99-99-99-99-99-99-99-0-0.003335-0.91130
Maximum value3458764069707388219N/A99999_70424982436084.78660728310410.92040.95510.91790.98880.98680.98990.97040.89590.65970.95780.52120.62310.82730.91480.89170.97140.9650.97640.66630.95170.97070.93730.7310.96540.9110.95060.80750.5640.51580.70380.95120.58150.74440.8767data/99999_704.jpgJ235959.50+003645.420.1619∞∞254.8154.4163.41801801111806.528e+05357.45.242e+1261180∞1.012e+15∞1.937e+10∞8.431e+05∞4.725e+05∞4.879e+06∞2.119e+06∞7.75e+050.15∞∞∞∞∞∞∞12.1612.725.888e+17359.868.50.199943.221.556e+044.29e+04833.943.369.091.681.0946.7736036.28885296896424.31.168339.74259.630.910.940.8136084.273.9503.9253.953.9083.9013.9423.949-10-1-1-1-1-1-1-6.02803-6.037-6-6.095-6.205-6.012-6.0023.9023.8753.93.8583.8513.8923.8998.002e+1536084.770.50.29962.221.26-10.0119.1513.1713.213.245.8245.965-7.068-7-6.9329.9822.2102.88689368

Full per-collection details (file structure, partition lists, per-column tables) are in each collection's own README: `train`, `validation`, `test`.

Provenance and fidelity

  • —Source: Smith42/galaxies, revision v2.0 (images and metadata pre-merged), CC-BY-SA-4.0.
  • —Conversion: hats-import v0.9.2 / hats v0.9.2, partitioned on ra/dec with pixel_threshold=10_000, sorted by dr8_id within partitions.

The original dataset

Here we have ~8.5 million galaxy cutouts from the DESI legacy survey DR8, centred on the galaxy source (256×256 pixel PNGs in the v2.0 revision used here; the original main revision serves 512×512 JPGs). 1% of the images are split into a test set, and 1% into a validation set; the remaining 98% comprise the training set.

For the ML-ordered original and AstroPT embeddings, see Smith42/galaxies and Smith42/galaxies_embeddings.

Useful links

Paper here: https://arxiv.org/abs/2405.14930

Models here: https://huggingface.co/Smith42/astroPT

And here: https://huggingface.co/Smith42/astroPT_v2.0

Code here: https://github.com/smith42/astroPT

Upstream catalogue is on Zenodo and the paper describing the catalogue is available as Walmsley+2023.

HATS and LSDB are developed by the LINCC Frameworks team — see lsdb.io for citation guidance.

If you find this dataset useful please consider citing the sources below 🚀🚀:

@article{ref_dey2019,
	author = {Dey, A. and Schlegel, D. J. and Lang, D. and Blum, R. and Burleigh, K. and Fan, X. and Findlay, J. R. and Finkbeiner, D. and Herrera, D. and Juneau, S. and others},
	title = {{Overview of the DESI Legacy Imaging Surveys}},
	journal = {Astronomical Journal},
	volume = {157},
	number = {5},
	pages = {168},
	year = {2019},
	issn = {1538-3881},
	publisher = {The American Astronomical Society},
	doi = {10.3847/1538-3881/ab089d}
}
@article{ref_walmsley2023,
	author = {Walmsley, M. and G{\ifmmode\acute{e}\else\'{e}\fi}ron, T. and Kruk, S. and Scaife, A. M. M. and Lintott, C. and Masters, K. L. and Dawson, J. M. and Dickinson, H. and Fortson, L. and Garland, I. L. and others},
	title = {{Galaxy Zoo DESI: Detailed morphology measurements for 8.7M galaxies in the DESI Legacy Imaging Surveys}},
	journal = {Monthly Notices of the Royal Astronomical Society},
	volume = {526},
	number = {3},
	pages = {4768--4786},
	year = {2023},
	issn = {0035-8711},
	publisher = {Oxford Academic},
	doi = {10.1093/mnras/stad2919}
}
@article{ref_smith2024,
	author = {Smith, M. J. and Roberts, R. J. and Angeloudi, E. and Huertas-Company, M.},
	title = {{AstroPT: Scaling Large Observation Models for Astronomy}},
	journal = {ArXiv e-prints},
	year = {2024},
	eprint = {2405.14930},
	doi = {10.48550/arXiv.2405.14930}
}