.. _data_preparation: Data preparation ================ Rapthor requires that the input data be prepared using the LOFAR initial calibration (LINC) pipelines. These pipelines perform the calibration of the calibrator data, the removal of instrumental effects (e.g., station clock offsets), the setting of the overall amplitude scale, and the direction-independent calibration of the target data. The pipelines are available at https://git.astron.nl/RD/LINC and must be run before Rapthor can be used. Input measurement sets ---------------------- The input data must have the direction-independent solutions applied to the DATA column (this is provided already by LINC). The multiple frequency bands output by LINC can be input directly to Rapthor (no concatenation is needed). Data from multiple epochs, such as interleaved observations or observations from multiple nights, are supported. Sky model --------- Manual sky model input ~~~~~~~~~~~~~~~~~~~~~~ Rapthor requires an initial model that is used during the first iteration. After the first iteration, Rapthor will use the model that is the result of the previous iteration. There are several ways to create a model, but if no model is available, we recommend creating one from TGSS. To make a TGSS model, go to https://tgssadr.strw.leidenuniv.nl/, and under "LOFAR Sky Model Creator" fill in the field's coordinates. For radius, 5 degrees can be used. The other default settings are fine (cut off at 0.3 Jy, and Deconvolve Beam: yes). Automatic sky model download ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rapthor can also download a suitable sky model automatically. If ``download_initial_skymodel`` is set to ``True`` in the parset, rapthor will use the additional ``download_initial_skymodel_radius`` and ``download_initial_skymodel_server`` to download a sky model out to the given radius from the given source. See :ref:`rapthor_parset` for more explanation about these parameters.