DESI

The kszx.desi module contains functions for downloading/parsing DESI data products.

References

kszx.desi.read_galaxies(survey, dr, download=False)

Reads DESI galaxy catalog, and returns a Catalog object.

DESI catalogs are restricted to an appropriate redshift range, i.e. there is no need to apply your own redshift cut after calling this function (unlike SDSS or DESILS-LRG).

Function arguments:

  • survey (str): one of the following:

    • ‘LRG_NGC’, ‘LRG_SGC’

    • ‘QSO_NGC’, ‘QSO_SGC’

    • ‘BGS_ANY_NGC’, ‘BGS_ANY_SGC’,

    • ‘BGS_BRIGHT_NGC’, ‘BGS_BRIGHT_SGC’,

    • ‘BGS_BRIGHT-21.5_NGC’, ‘BGS_BRIGHT-21.5_SGC’,

    • ‘ELG_LOPnotqso_NGC’, ‘ELG_LOPnotqso_SGC’

    • ‘LRG+ELG_LOPnotqso_NGC’, ‘LRG+ELG_LOPnotqso_SGC’

  • dr (int): currently only dr=1 is supported

Returns a kszx.Catalog object, with the following columns:

ra_deg, dec_deg, z,    # sky location, redshift
weight                 # use this one!
wfkp                   # FKP weight
wcp, wzf, wsys,        # systematic weights (don't use these!)

Example usage:

# kszx.desi.read_galaxies() returns a kszx.Catalog.
gcat = kszx.desi.read_galaxies('LRG_NGC', 1)
kszx.desi.read_randoms(survey, dr, download=False, nfiles=None)

Reads DESI random catalog, and returns a Catalog object.

DESI catalogs are restricted to an appropriate redshift range, i.e. there is no need to apply your own redshift cut after calling this function (unlike SDSS or DESILS-LRG).

Function arguments:

  • survey (str): one of the following:

    • ‘LRG_NGC’, ‘LRG_SGC’

    • ‘QSO_NGC’, ‘QSO_SGC’

    • ‘BGS_ANY_NGC’, ‘BGS_ANY_SGC’,

    • ‘BGS_BRIGHT_NGC’, ‘BGS_BRIGHT_SGC’,

    • ‘BGS_BRIGHT-21.5_NGC’, ‘BGS_BRIGHT-21.5_SGC’,

    • ‘ELG_LOPnotqso_NGC’, ‘ELG_LOPnotqso_SGC’

    • ‘LRG+ELG_LOPnotqso_NGC’, ‘LRG+ELG_LOPnotqso_SGC’

  • dr (int): currently only dr=1 is supported.

  • nfiles (int or None): number of random catalog files to read. By default, all 18 files are read, which gives a random catalog which is ~100 times larger than the galaxy catalog.

Returns a kszx.Catalog object, with the following columns:

ra_deg, dec_deg, z,    # sky location, redshift
weight                 # use this one!
wfkp                   # FKP weight
wcp, wzf, wsys,        # systematic weights (don't use these!)

Example usage:

# kszx.desi.read_randoms() returns a kszx.Catalog.
rcat = kszx.desi.read_randoms('LRG_NGC', 1)
kszx.desi.read_fits_catalog(filename, name=None)

Reads FITS file in SDSS catalog format.

Intended as a helper for read_galaxies() or read_randoms(), but may be useful elsewhere.

Function arguments:

  • filename (string): should end in .fits.

  • name (str, optional): name of Catalog, passed to kszx.Catalog constructor.

Returns a kszx.Catalog object.

kszx.desi.download(survey, dr, nrfiles)

Downloads DESI data products (galaxies, randoms) for a given survey.

Can be called from command line: python -m kszx download_desi.

Function arguments:

  • survey (str): one of the following:

    • ‘LRG_NGC’, ‘LRG_SGC’

    • ‘QSO_NGC’, ‘QSO_SGC’

    • ‘BGS_ANY_NGC’, ‘BGS_ANY_SGC’,

    • ‘BGS_BRIGHT_NGC’, ‘BGS_BRIGHT_SGC’,

    • ‘BGS_BRIGHT-21.5_NGC’, ‘BGS_BRIGHT-21.5_SGC’,

    • ‘ELG_LOPnotqso_NGC’, ‘ELG_LOPnotqso_SGC’

    • ‘LRG+ELG_LOPnotqso_NGC’, ‘LRG+ELG_LOPnotqso_SGC’

  • dr (int): currently only dr=1 is supported.

  • nrfiles (int or None): number of random catalog files to read. By default, all 18 files are read, which gives a random catalog which is ~100 times larger than the galaxy catalog.