##############################
### CEERS Data Release 0.5 ###
##############################

Date Released: 2 November, 2022

Here we provide our team's reductions of the first set of CEERS observations,
MIRI primary imaging of four pointings with NIRCam imaging in parallel. 
These CEERS Epoch 1 observations are of pointings 1, 2, 3 and 6, and were 
obtained on 21 June and 28 June 2022. 

All our data products are available at MAST as a High Level Science Product 
via DOI 10.17909/z7p0-8481.


############
### Summary

Instrument: MIRI
Mode: Imaging
Calibration Pipeline Used: jwst v1.7.2
CRDS Context pmap: 0970
Target: MIRI Pointings 1, 2, 3, 6 (as primary with parallel NIRCam imaging)
Filters: F560W, F770W, F1000W, F1280W, F1500W, F1800W, F2100W
Readout: SLOWR1 (F560W and F770W), FASTR1 (all other filters)
Observation specification: Groups and integrations vary by filter and pointing
Dithers: 3 point dither in each filter, optimized for MIRI+NIRCam coordinated parallels

Contact: Guang Yang: gyang206265@gmail.com
         Casey Papovich: papovich@tamu.edu
         

##########################################
### Epoch 1 MIRI Imaging and Reduction

This 0.5 data release includes CEERS MIRI pointings 1, 2, 3 and 6. 
For each pointing we provide fully reduced mosaics in all available filters. 
Note that the pixel scale is 0.09 arcsec/pixel (not the default 0.11 
arcsec/pixel). This means the AB-mag zeropoint = 25.70091 mag. The mosaics 
are pixel-aligned across all filters. Each mosaic is a FITS file with 11 
extensions, described below. For each pointing, we also provide a gzipped 
tarball (tar.gz) containing mosaics for all filters. 

We have reduced the raw images through the JWST Calibration Pipeline (v1.7.2)
with custom modifications and reduction steps designed to address additional
features and challenges with the data such as outlier detection, background
subtraction and astrometric alignment. We have also produced custom RMS maps 
using astroRMS (https://github.com/mmechtley/astroRMS, based on the science 
image and weight map in the pipeline produced outputs). This RMS is typically 
larger than the pipeline-produced ERR map due to positive pixel-correlated 
noise. We include this RMS map as an extension in the FITS file (see below)
and strongly recommend using it instead of the ERR map.

The data reduction is described in detail in Yang et al. (2023, submitted). 
(https://ui.adsabs.harvard.edu/abs/2023arXiv230714509Y/abstract)
Please cite this paper if you use the reduced images or reduction scripts for 
your project. 

We present the reduction of our pre-flight simulated MIRI images in 
Yang et al., 2021, ApJ, 908, 144.
(https://ui.adsabs.harvard.edu/abs/2021ApJ...908..144Y/abstract)


#######################
### Directory Contents

Mosaics for each pointing are stored in separate directories. The MIRI
mosaic filenames are of the form:
    [pointing]/hlsp_ceers_jwst_miri_[pointing]_[filter]_dr0.5_i2d.fits
where:
  - [pointing] is one of 'miri1', 'miri2', 'miri3' or 'miri6'
  - [filter] is one of 'f115w', 'f150w', 'f200w', 'f277w', 'f356w', 'f410m', or 'f444w'

The gzipped tarballs [pointing].tar.gz include all MIRI mosaics for each 
pointing.

####################
### File structure

The MIRI images are multi-extension fits files with 11 extensions:
  0. PRIMARY header
  1. SCI  - 2D science image, in units of MegaJansky per steradian [MJy/sr]
  2. RMS  - the RMS map produced by astroRMS
  3. ERR  - 2D array of uncertainties, given as standard deviation and
            constructed as the sum in quadrature of the resampled variance maps
  4. CON  - 2D context image, encoding info about which input images
            contribution to each output pixel
  5. WHT  - 2D weight image giving the relative weight of the output pixels,
            constructed from the VAR_RNOISE map during resampling
  6. VAR_POISSON  - 2D variance array based on Poisson noise only
  7. VAR_RNOISE  - 2D variance array based on read noise only
  8. VAR_FLAT  - 2D variance array based on uncertainty in the flat-field
  9. HDRTAB  - table containing metadata (FITS keyword values) for all the
               input images
 10. ASDF  - meta data for the JWST data model

For more information on JWST file names and extension explanations, see:
jwst-pipeline.readthedocs.io/en/latest/jwst/data_products/science_products.html

JWST images can be read in several ways. For example, with astropy:
  >>> from astropy.io import fits
  >>> with fits.open('hlsp_ceers_jwst_miri_miri1_f115w_dr0.5_i2d.fits') as hdu:
  ...     hdu.info()

Or using the jwst datamodels:
  >>> from jwst.datamodels import ImageModel
  >>> with ImageModel('hlsp_ceers_jwst_miri_miri1_f115w_dr0.5_i2d.fits.gz') as im:
  ...     im.info()

For more information on JWST Data Models, see:
jwst-pipeline.readthedocs.io/en/latest/jwst/datamodels/index.html