# Data Release Description

The DESI Legacy Imaging Surveys are producing an inference model of the 14,000 square degrees of extragalactic sky visible from the northern hemisphere in three optical bands ($g,r,z$) and four infrared bands. The sky coverage is approximately bounded by -18° < δ < +84° in celestial coordinates and $|b|$ > 18° in Galactic coordinates. To achieve this goal, the Legacy Surveys are conducting 3 imaging projects on different telescopes, described in more depth at the following links:

 The Beijing-Arizona Sky Survey (BASS) The DECam Legacy Survey (DECaLS) The Mayall z-band Legacy Survey (MzLS)

An overview of the surveys is available in Dey et al. (2019).

## Contents of DR8

Data Release 8 (DR8) is the eighth public data release of the Legacy Surveys. It is the sixth public data release of images and catalogs from DECaLS (DR7 comprised the fifth release of data from DECaLS) and the third release of data from BASS and MzLS (DR6 comprised the second release of data from BASS and MzLS). DR8 is the first release to include images and catalogs from all three of the Legacy Surveys in a single release. Imaging from the Legacy Surveys is first reduced through the NOAO Community Pipeline before being processed using the Tractor. DR8 also includes WISE fluxes from all imaging through year 4 of NEOWISE-Reactivation force-photometered in the unWISE maps at the locations of Legacy Surveys optical sources.

DR8 includes BASS ($g,r$-band) images taken from 12th November 2015 through 7th March 2019 and MzLS ($z$-band) images taken from 19th November 2015 through 12th February 2018. Images from DECaLS $g,r,z$-band observations (NOAO survey program 0404) are included from 9th August 2014 through 7th March 2019. DR8 also includes DECam data from a range of non-DECaLS surveys, including observations that were conducted from 1st September 2013 to 7th March 2019. A large portion of these non-DECaLS observations were taken by the Dark Energy Survey. This information was derived from the Legacy Surveys survey-ccds-* files.

The table below indicates the area covered in DR8 for different numbers of passes and in different filters across the entire unique survey area. Unique area is resolved by including all DECam images (the majority of which are from DECaLS) but only including BASS and MzLS images if they are both at Declination > 32.375° and north of the Galactic Plane. These are area estimates derived from the geometry of the CCDs that contribute to the Legacy Surveys footprint.

Band/Number of Passes ≥ 1 ≥ 2 ≥ 3
$g$-band 19,692 deg2 18,767 deg2 15,430 deg2
$r$-band 19,698 deg2 18,759 deg2 15,321 deg2
$z$-band 19,852 deg2 18,759 deg2 15,595 deg2
All bands jointly 19,437 deg2 18,036 deg2 13,161 deg2

DR8 includes a variety of pixel-level and catalog-level products, which are described in more detail on the files page. The size of the DR8 data distribution, split out into contributions from the north (BASS/MzLS) and south (DECaLS) to match the directory structure of DR8 is:

Size* Directory Description
1.1 TB calib/ Calibration files
8.4 GB + 8.4 GB north/external/ + south/external/ Matches to other catalogs (SDSS, etc.)
3.8 TB forced/ Forced photometry catalogs.
30 MB gallery/ Notable images (e.g. NGC galaxies)
9.6 GB + 13 GB north/logs/ + south/logs/ Log files generated by Tractor processing
288 GB + 1.1 TB north/metrics/ + south/metrics/ Metrics and statisics of Tractor fits
363 GB randoms/ Catalogs of random points
167 GB + 624 GB north/sweep/ + south/sweep/ Subsets of the Tractor catalogs; photometric redshifts
479 GB + 1.8 TB north/tractor/ + south/tractor/ The Tractor catalogs

*Note that although the contents of a directory should be fixed for each Data Release, the size of a directory can change. This is typically due to updated file compression. So, the listed directory sizes should be viewed as (very reasonable) estimates.

For all of the DESI Legacy Imaging Surveys, coadded images and Tractor catalogs are presented in "bricks" of approximate size 0.25° × 0.25°. Each brick is defined in terms of a box in RA,Dec coordinates. The image stacks use a simple tangent-plane (WCS TAN) projection around the brick center. The projections for the $g,r,z$ filters are identical, with a pixel scale of 0.262″/pix. The projections for the four WISE filters also identical but with a pixel scale of 2.75″/pix. There are 662,174 bricks spread over the sky, meaning that each brick has an average area of 0.0623 deg2. The brick images have some overlap.

There are approximately 1.6 billion unique sources in DR8 spread over 326,154 unique bricks.

## Obtaining Images and Raw Data

Images for all 3 of the Legacy Surveys can be viewed directly using the Sky viewer and raw data can be obtained through the NOAO portal (or via ftp; see also the information near the bottom of the files page).

Sections of the Legacy Surveys for DR8 can be obtained as JPEGs or FITS files using the cutout service, for example, as follows:

This will merge the northern (MzLS+BASS) and equatorial (DECam) images at the Dec=32.375 line.

To request images from only the northern or equatorial surveys, specify dr8-north or dr8-south, for example:

where "bands" is a string such as "$grz$","$gz$","$g$", etc.

Replacing layer=dr8 (or layer=dr8-north) with layer=dr8-model (layer=dr8-north-model) or layer=dr8-resid (layer=dr8-north-resid) will instead return cutouts for the model and residual images, respectively.

The size of the image can also be specified using $width$, $height$ and $size$, where $size$ forces $width$ and $height$ to be equal. For example:

http://legacysurvey.org/viewer/jpeg-cutout?ra=190.1086&dec=1.2005&width=100&layer=dr8&pixscale=0.3&bands=grz

http://legacysurvey.org/viewer/jpeg-cutout?ra=190.1086&dec=1.2005&height=100&layer=dr8&pixscale=0.3&bands=grz

http://legacysurvey.org/viewer/jpeg-cutout?ra=190.1086&dec=1.2005&size=100&layer=dr8&pixscale=0.3&bands=grz

It is possible to retrieve multiple cutouts from the command line using standard utilites such as wget.

The maximum size for cutouts (in number of pixels) is currently 512. Pixscale=0.262 will return (approximately) the native pixels used by the Tractor.

## Source Detection

The source detection uses a PSF- and SED-matched-filter detection on the stacked images, with a 6σ detection limit. The Tractor fitting step is initialized with these positions, although these positions can be changed during the fits and low-S/N sources can be removed.

For source detection, each image is convolved by its PSF model, then a weighted stack of these is created in order to optimize the point-source detection efficiency. Next, SED-matched combinations of the three bands are created, for two SEDs: "flat" (a source with AB color zero), and "red", a source with AB color $g-r = 1$, $r-z = 1$. Sources above 6σ are detected in each of these two SED-matched filters, as well as independently in each band.

The locations of the peak fluxes of extracted sources are used to determine where objects are photometered and how the initial parameters for an object are seeded. When a source is detected in multiple bands a choice of filter must be made to seed the initial extraction. Sources detected in other bands beyond the initial filter are only kept if they are sufficiently separated from an object that was extracted in previous bands. In DR4, DR3 and earlier data releases, source detection was run first in $g$, then in $r$, $z$, "flat" and finally in "red". Starting with DR5, source detection was run first in $z$, then in $r$, $g$, "flat" and finally in "red". $z$ was chosen as the "primary" detection image to take advantage of the better PSF in that band.

Starting with DR7 the criteria for deciding whether a flux peak is a distinct source were relaxed. The minimum possible distance between neighboring peaks was reduced from 6 pixels (about 1.5 arcseconds) to 4 pixels (about 1 arcsecond). In addition, the "saddle" depth (dip in flux) necessary to model neighboring peaks as distinct sources was reduced.

Starting with DR8, many different "foreground" objects are extracted as independent sources in a similar fashion to how Gaia stars were extracted in DR7. These include bright stars, medium-bright stars, globular clusters and large galaxies (as detailed on the external catalogs page). The foreground objects consist of pre-defined geometrical masks (which are elliptical for galaxies) that are fixed at their expected positions in the Legacy Surveys images after accounting for proper motion and parallax in Gaia Data Release 2. These mask regions are ignored in the local-sky-fitting calibration code. Within the mask regions for bright stars, globular clusters and large galaxies, sources are forced to be TYPE=PSF (except for the large galaxies themselves). Within all of the mask regions, a constant sky level is fit in the mask blob for each exposure; this appears to preferentially classify sources as TYPE=PSF around Gaia stars. The reasoning behind treating bright foreground sources as special cases is that many of them have large halos or include diffuse light that is not included in the Tractor model choices. This leads such sources to be typically best fit by misleading (and computationally expensive) diffuse galaxy models.

The provenance of the foreground objects that correspond to "mask" regions, within which sources are independently extracted, is detailed on the external catalogs page. Sources that are within a mask region have BRIGHTBLOB and MASKBITS set (see the DR8 bitmasks page).

## PSF

The Tractor makes use of the PSF on each individual exposure. The PSF for the individual exposures are first computed independently for each CCD using PSFEx, generating spatially-varying pixelized models. Note that it is possible that survey-* and *-annotated-* files could record information that is missing from other files in cases where PSFex fails. This is expected behavior.

The configuration files for SExtractor and PSFex that were used for a given iteration of the Legacy Surveys legacypipe codebase are available on our GitHub page.

## Sky Level

The Community Pipeline removes a sky level that includes a sky pattern, an illumination correction, and a single, scaled fringe pattern. These steps are described on the NOAO Community Pipeline page. This makes the sky level in the processed images near zero, and removes most pattern artifacts. A constant sky level is then added back to the image that is the mean of what was removed.

Additionally, a spatially varying (spline) sky model is computed and removed, by detecting and masking sources, then computing medians in sliding 512-pixel boxes. The image stacks provided on the files page have this sky level removed. As noted under Source Detection, above, any regions (blobs) covered by foreground sources are ignored in the local-sky-fitting calibration code; a constant sky level is fit within such blobs.

## Tractor Catalogs

The Tractor code runs within the geometrical region of a brick to produce catalogs of extracted sources. This fitting is performed on the individual exposures that overlap the brick, without making use of image stacks (such as the image stacks detailed on the files page). This preserves the full information content of the data set in the fits, handles masked pixels without the need for uncertain interpolation techniques, and fits to data points without the complication of pixel covariances.

## Morphological Classification

The Tractor fitting can allow any of the source properties or image calibration parameters (such as the PSF) to float. Only the source properties were allowed to float in DR8. These are continuous properties for the object centers, fluxes, and the shape parameters.

There is also the discrete choice of which model type to use. In DR8, six morphological types are used. Five of these are used in the Tractor fitting procedure: point sources, round exponential galaxies with a variable radius ("REX"), deVaucouleurs ("DEV") profiles (elliptical galaxies), exponential ("EXP") profiles (spiral galaxies), and composite profiles that are deVaucouleurs + exponential (with the same source center). The sixth morphological type is "DUP," which is set for Gaia sources that are coincident with, and so have been fit by, an extended source. No optical flux is assigned to "DUP" sources, but they are retained to ensure that all Gaia sources appear in the catalogs even if Tractor preferred and fit a different source based on the deeper Legacy Surveys imaging. The total numbers of the different morphological types in DR8 are:

Primary Objects of Type All Northern Sources All Southern Sources Resolved Northern Sources Resolved Southern Sources Unique Sources
All 347,764,539 1,298,900,190 323,390,449 1,281,552,268 1,604,942,717
PSF 149,886,575 603,839,506 138,108,341 595,474,709 733,583,050
REX 155,668,648 532,851,020 145,663,666 525,870,732 671,534,398
EXP 25,746,175 117,234,339 24,102,538 115,835,064 139,937,602
DEV 16,195,657 43,963,922 15,266,781 43,372,596 58,639,377
COMP 223,403 900,231 210,422 890,307 1,100,729
DUP 44,081 111,172 38,701 108,860 147,561

where northern sources are from BASS and MzLS, and southern sources are from DECam surveys. Sources are resolved as distinct by only counting BASS and MzLS sources if they are both at Declination > 32.375° and north of the Galactic Plane, or, otherwise counting DECam sources. Unique sources are the total of all resolved sources.

The decision to retain an object in the catalog and to re-classify it using models more complicated than a point source is made using the penalized changes to χ² in the image after subtracting the models for other sources. The "PSF" and "REX" models are computed for every source and the better of these two is used when deciding whether to keep the source. A source is retained if its penalized χ² is improved by 25; this corresponds to a χ² difference of 27 (because of the penalty of 2 for the source centroid). Sources below this threshold are removed.

The source is classified as the better of "point source (PSF)" or "round exponential galaxy (REX)" unless the penalized χ² is improved by 9 (i.e., approximately a 3σ improvement) by treating it as a deVaucouleurs or exponential profile. The classification is a composite of deVaucouleurs + exponential if it is both a better fit to a single profile over the point source, and the composite improves the penalized χ² by another 9. These choices implicitly mean that any extended source classifications have to be at least 5.8σ detections and that composite profiles must be at least 6.5σ detections.

The fluxes are not constrained to be positive-valued. This allows the fitting of very low signal-to-noise sources without introducing biases at the faint end. It also allows the stacking of fluxes at the catalog level.

## Tractor Implementation Details

Tractor fundamentally treats the fitting as a χ² minimization problem. The current core routine uses the sparse least squares solver from the SciPy package, or the open source Ceres solver, originally developed by Google.

The galaxy profiles (the exponential and deVaucouleurs profiles mentioned above under Morphological Classification) are approximated with mixture-of-Gaussians (MoG) models and are convolved by the pixelized PSF models using a new Fourier-space method (Lang, in prep). The galaxy profile approximation introduces errors in these models typically at the level of $10^{-4}$ or smaller. The PSF models are treated as pixel-convolved quantities, and are evaluated at the integral pixel coordinates without integrating any functions over the pixels.

The Tractor algorithm could be run with both the source parameters and the calibration parameters allowed to float, at the cost of more compute time and the necessity to use much larger blobs because of the non-locality of the calibrations. A more practical approach would be to iterate between fitting source parameters in brick space, and fitting calibration parameters in exposure space.

## Photometry

The flux calibration for BASS, MzLS and DECaLS are on the AB natural system of the 90Prime, Mosaic-3 and DECam instruments, respectively. An AB system reports the same flux in any band for a source whose spectrum is constant in units of erg/cm²/Hz. A source with a spectrum of $f = 10^{-(48.6+22.5)/2.5}$ erg/cm²/Hz would be reported to have an integrated flux of 1 nanomaggie in any filter. The natural system implies that no color terms have been applied to any of the photometry, meaning that fluxes are reported as observed in the 90Prime, Mosaic-3 and DECam filter systems.

Zero point magnitudes for the CP reductions of the 90Prime, Mosaic-3 and DECam images were computed by comparing Legacy Survey PSF photometry to Pan-STARRS1 (PS1) PSF photometry, where the latter was modified with color terms to place the PS1 photometry on the 90Prime, Mosaic-3 or DECam system. The same color terms are applied to all CCDs. Zero points are computed separately for each CCD, but not for each amplifier. The average color terms to convert from PS1 to 90Prime, Mosaic-3 and DECam were computed for stars in the color range $0.4 < (g-i) < 2.7$ as follows:

\begin{align*} (g-i) & = & g_{\mathrm{PS}} - i_{\mathrm{PS}} \\ g_{\mathrm{90Prime}} & = & g_{\mathrm{PS}} + 0.00464 + 0.08672 (g-i) - 0.00668 (g-i)^2 - 0.00255 (g-i)^3 \\ r_{\mathrm{90Prime}} & = & r_{\mathrm{PS}} + 0.00110 - 0.06875 (g-i) + 0.02480 (g-i)^2 - 0.00855 (g-i)^3 \\ z_{\mathrm{Mosaic3}} & = & z_{\mathrm{PS}} + 0.03664 - 0.11084 (g-i) + 0.04477 (g-i)^2 - 0.01223 (g-i)^3 \\ g_{\mathrm{DECam}} & = & g_{\mathrm{PS}} + 0.00062 + 0.03604 (g-i) + 0.01028 (g-i)^2 - 0.00613 (g-i)^3 \\ r_{\mathrm{DECam}} & = & r_{\mathrm{PS}} + 0.00495 - 0.08435 (g-i) + 0.03222 (g-i)^2 - 0.01140 (g-i)^3 \\ z_{\mathrm{DECam}} & = & z_{\mathrm{PS}} + 0.02583 - 0.07690 (g-i) + 0.02824 (g-i)^2 - 0.00898 (g-i)^3 \\ \end{align*}

Note that the DECam zero points have been significantly updated since DR5 and the 90Prime and Mosaic-3 zero points have been significantly updated since DR6. Functions to perform the conversions are available in the legacypipe code.

The brightnesses of objects are all stored as linear fluxes in units of nanomaggies. The conversion from linear fluxes to magnitudes is $m = 22.5 - 2.5 \log_{10}(\mathrm{flux})$. These linear fluxes are well-defined even at the faint end, and the errors on the linear fluxes should be very close to a normal distribution. The fluxes can be negative for faint objects, and indeed we expect many such cases for the faintest objects.

The filter curves are available for BASS g-band, BASS r-band, MzLS z-band, MzLS z-band with corrections, DECaLS g-band, DECaLS r-band and DECaLS z-band.

Starting with DR6, PSF photometry uses the same PSF models (and sky background subtraction) for zeropoint-fitting as is later used in cataloging. So, for DR8, the measured fluxes for PS1 stars should be completely self-consistent.

The WISE Level 1 images and the unWISE image stacks are on a Vega system. We have converted these to an AB system using the recommended conversions by the WISE team. Namely, $\mathrm{Flux}_{\mathrm{AB}} = \mathrm{Flux}_{\mathrm{Vega}} \times 10^{-(\Delta m/2.5)}$ where $\Delta m$ = 2.699, 3.339, 5.174, and 6.620 mag in the W1, W2, W3 and W4 bands. For example, a WISE W1 image should be multiplied by $10^{-2.699/2.5} = 0.083253$ to give units consistent with the Tractor catalogs. These conversion factors are recorded in the Tractor catalog headers ("WISEAB1", etc). The result is that the optical and WISE fluxes we provide should all be within a few percent of being on an AB system.

## Galactic Extinction

The most recent values of the Galactic extinction coefficients are available on the DR8 catalogs page.

## Astrometry

Starting with DR8, astrometry is tied entirely to Gaia Data Release 2. Each image is calibrated to Gaia Data Release 2, yielding an astrometric solution that is offset by the average difference between the position of Gaia stars at an epoch of 2015.0 and the epoch of the DR8 image. Source extraction is then fixed to the Gaia Data Release 2 system, such that positions of sources are tied to predicted Gaia positions at the epoch of the corresponding Legacy Surveys observation. Astrometric residuals are typically smaller than ±0.03″.

Astrometric calibration of all optical Legacy Survey data is conducted using Gaia astrometric positions of stars matched to Pan-STARRS1 (PS1). The same matched objects are used for both astrometric and photometric calibration.

## Image Stacks

The image stacks (that are detailed on the files page) are provided for convenience, but were not used in the Tractor fits. These images overlap adjacent images by approximately 130 pixels in each direction. These are tangent projections centered at each brick center, North up, with dimensions of 3600 × 3600 and a scale of 0.262″/pix for the $g,r,z$ data and 2.75″/pix for the WISE data. The image stacks are computed using Lanczos-3 interpolation. They have not been designed for "precision" work, although they should be sufficient for many use cases.

## Depths

The histograms below depict the median 5σ point source (AB) depths for areas with different numbers of observations in the different regions of DR8:

These are based upon the formal errors in the Tractor catalogs for point sources, and can be compared to the predicted proposed depths for 2 observations at 1.5″ seeing of $g=24.7$, $r=23.9$, $z=23.0$.

## Glossary

BASS
Beijing-Arizona Sky Survey.
Blob
Continguous region of pixels above a detection threshold and neighboring pixels; Tractor is optimized within blobs.
Brick
A region bounded by lines of constant RA and DEC; reductions are performed within bricks of size approximately 0.25° × 0.25°.
CP
Community Pipeline (reduction pipeline operated by NOAO).
DECaLS
Dark Energy Camera Legacy Survey.
DR2
DESI Legacy Surveys Imaging Data Release 2.
DR3
DESI Legacy Surveys Imaging Data Release 3.
DR4
DESI Legacy Surveys Imaging Data Release 4.
DR5
DESI Legacy Surveys Imaging Data Release 5.
DR6
DESI Legacy Surveys Imaging Data Release 6.
DR7
DESI Legacy Surveys Imaging Data Release 7.
DECam
Dark Energy Camera on the NOAO Blanco 4-meter telescope.
maggie
Linear flux units, where an object with an AB magnitude of 0 has a flux of 1.0 maggie. A convenient unit is the nanomaggie: a flux of 1 nanomaggie corresponds to an AB magnitude of 22.5.
MoG
Mixture-of-Gaussians to approximate galaxy models.
MzLS
Mayall z-band Legacy Survey.
NOAO
National Optical Astronomy Observatory.
nanomaggie
Linear flux units, where an object with an AB magnitude of 22.5 has a flux of $1 \times 10^{-9}$ maggie or 1.0 nanomaggie.
PSF
PSFEx
Emmanuel Bertin's PSF fitting code.
SDSS
Sloan Digital Sky Survey.
SDSS DR12
Sloan Digital Sky Survey Data Release 12.
SDSS DR13
Sloan Digital Sky Survey Data Release 13.
SED
Spectral energy distribution.
SourceExtractor
Source Extractor reduction code.
SFD98
Schlegel, Finkbeiner & Davis 1998 extinction maps.
Tractor
Dustin Lang's inference code.
unWISE
New coadds of the WISE imaging, at original full resolution.
WISE
Wide Infrared Survey Explorer.