**** Data **** There are a large number of APOGEE data products and directores. The structure of the data products themselves is called the "data model". There is a new `SDSS-V data model product `_ product (you need SDSS-V wiki authentication to access this) that is now used to describe all of the data files. This is still incomplete, but the older `SDSS data model `_ is still useful during the transition period The directory structure and file names are set by the ``tree`` product. The SDSS-V settings are available `here `_. Some examples are:: apFlux = $APOGEE_REDUX/{apred}/cal/{instrument}/flux/@apgprefix|Flux-{chip}-{num:0>8}.fits apStar = $APOGEE_REDUX/{apred}/{apstar}/{telescope}/@healpixgrp|/{healpix}/apStar-{apred}-{telescope}-{obj}.fits apWave = $APOGEE_REDUX/{apred}/cal/{instrument}/wave/@apgprefix|Wave-{chip}-{num:0>8}.fits Note, you need the sdss username and password to access the data online. Main files and directories ========================== Since there are three APOGEE detectors, the data are almost always split into three files, one per detector: a (red), b (green), c (blue). For example, a 2D image for exposure 40220015 has three files with names ``ap2D-a-40220015.fits``, ``ap2D-b-40220015.fits`` and ``ap2D-c-40220015.fits``. The prefix is ``ap`` for APO and ``as`` for LCO, although ``ap`` is always used for Visit and Star files. Here's the directory layout of the main data files. Base Directory -------------- Note that the base directory for the APOGEE reduction can be accessed at Utah with the ``$APOGEE_REDUX`` environmental variable. Right now this points to ``/uufs/chpc.utah.edu/common/home/sdss50/sdsswork/mwm/apogee/spectro/redux``, but this may change in the future. It is always ``mwm/apogee/spectro/redux/`` relative to the base SDSS directory. Likewise, the raw data directory is always ``data/apogee/apo/`` for APO and ``data/apogee/lco/`` relative to the base SDSS directory. Raw files --------- The raw files are compressed in a custom "apz" format. Only the difference between up the ramp reads are kept (and the first frame), and then `fpack `_ compressed. These can be uncompressed with ``apunzip.pro``. The raw files have names of ``apR-[abc]-EXPNUM8.apz`` where EXPNUM8 is the eight-digit exposure number (e.g., 40220015) where the first four digits are the day number (where day number zero MJD 55562) and the last four digits are the exposure number in that day. Each observatory/instrument has its own base directory and the exposures are grouped by MJD. Here's an example directory of raw APO data: `59588 `_ Each nightly directory has an HTML page that makes it easy to see what exposures were taken that night `59588.log.html `_ Exposure files --------------- The 2D images generated by ``AP3D`` have names ``ap2D-[abc]-EXPNUM8.fits`` while the 1D extracted spectra from ``AP2D`` have names ``ap1D-[abc]-EXPNUM8.fits``. ``AP2D`` also generates a model for the extracted 2D image and these files are called ``ap2Dmodel-[abc]-EXPNUM8.fits.fz``. All of these files are grouped by instrument and MJD. For example, the daily processed files for APO images taken on MJD 59584 are in the ``daily/exposures/apogee-n/59584/`` directory. Here's the SAS access to those files: `59584 `_. There is a nightly QA with some useful information: `59584 QA `_ Calibration files ----------------- There are master and daily calibration files (see `Calibration Files `_ for more details). The calibration files live in ``REDUX/cal/INSTRUMENT/CALTYPE/`` directory, e.g. ``daily/cal/apogee-n/psf/``. The APO LSF files are here: `lsf/ `_. Visit files ----------- Visit files are the epoch-level spectra per star and have names of ``apVisit-REDUX-TELESCOPE-PLATE-MJD5-FIBERID.fits``. In the FPS era, we have replaced PLATE with CONFIGID. For example, ``apVisit-daily-apo25m-1279-59584-190.fits`` is the daily-reduced file for the APO MJD 59584 observations of configuration 1279 and fiberid 190. The apVisit files are grouped in directories like ``REDUX/visit/FIELD/CONFIGID/MJD/``, e.g. ``daily/visit/apo25m/20882/1279/59584/``. You can access the files online here: `20882/1279/59584 visit `_. Each visit has an apQA and apVisit QA pages that give useful summary pages and spectra. Here are examples, `apQA-1279-59584.html `_ and `apPlate-1279-59584.html `_. Star files ---------- The Star files are the combined spectra for each star and have names of ``apStar-2MASSNAME-TELESCOPE-REDUX.fits``. For example, ``apStar-daily-apo25m-2M06482624+0357058.fits`` is the daily-processed, star-level spectrum taken at APO for star "2M06482624+0357058". Note, that the RV code and visit-combination is run each time a new observation of a star is made. Therefore, there will be multiple versions of each apStar file, denoted by the MJD of the last observation, e.g. ``apStar-daily-apo25m-2M06482624+0357058-59238.fits``. The unversioned file is just a symbolic link to the most recent version. apStar files not only contain the combined spectrum on the rest wavelength scale, but also all of the visit spectra resampled onto the same wavelength scale. These can be very useful for certain types of spectral analysis. Since fields can overlap on the sky, a star can be observed in multiple fields. Therefore, stars are grouped by both telescope and `HEALPix `_ as well as HEALPix group (HEALPix / 1000). The coordinates encoded in the 2MASS coordinate-based name are used to determine the HEALPix of the star. For example, the apStar file for "2M06482624+0357058" is located in directory ``daily/stars/apo25m/91/91537/``. All of the files for HEALPix 91537 can be accessed here `91537 `_. There is a star-level QA page that lists useful summary information and plots. Here's an example page: `2M06482624+0357058.html `_.