
Example reduction
=================

As an introduction to the user, but also to check if IRDAP is installed correctly, a quick 
end-to-end example reduction can be performed. This demo uses a small portion of the H-band 
polarimetric data of the circumstellar disk of T Cha from ESO Program 096.C-0248(C). This
data set was the first to be reduced with IRDAP's correction method and is published in
`Pohl et al. (2017) <http://adsabs.harvard.edu/abs/2017A%26A...605A..34P>`_. It is also 
used in `van Holstein et al. (2020) <https://ui.adsabs.harvard.edu/abs/2020A%26A...633A..64V/abstract>`_ to exemplify the correction method.

To run the demo, change the current directory of the terminal to a directory of your choice and type:
::

   irdap --demo

IRDAP then performs a complete data reduction and writes the resulting files
to the terminal's current directory. 

.. note::
   An internet connection is required to run the demo, because 56.6 MB of raw data needs to be downloaded from the 
   `GitHub repository <https://github.com/robvanholstein/IRDAP/tree/master/irdap/example_data>`_.

After running the demo, you can navigate to the :file:`reduced_pdi/no_star_pol_subtr` 
subdirectory and open the files :file:`T_Cha_2016-02-20_Q_phi.fits` 
and :file:`T_Cha_2016-02-20_U_phi.fits` that
show the final *Q*:math:`_\phi`- and *U*:math:`_\phi`-images. 
Opening these files with `DS9 <http://ds9.si.edu/>`_, setting color to cool, scale to linear 
and the limits to -500 to 1500 and -300 to 150, respectively, you will see the following:

.. figure:: ./figs/t_cha_quphi_combined.svg
    :width: 750px
    :align: center
	
These images correspond to Figure 14 (left column) of `van Holstein et al. (2020) <https://ui.adsabs.harvard.edu/abs/2020A%26A...633A..64V/abstract>`_, 
but with lower signal-to-noise because for the demo the data of only 1 instead of 30 HWP cycles 
was used.

To start reducing your own data with IRDAP, continue to the :ref:`usage instructions <Usage instructions>`.