# SCAMP report¶

## Introduction¶

In AstroWISE the astrometric solution is computed through the following steps:

1. “Preastrom” during the ingestion of the raw images to find rough pointings;
2. “Astrometry” on single CCD image to find a good solution;
3. “GAS” (Global Astrometric Solution) on a set of dithered images to find a fine solution and produce the best mosaic.

By default the LDAC package is used to derive the astrometric solution.

The input for LDAC routines are catalogs of objects extracted by SExtractor. The user can use either the official AstroWise reference catalog, or provide his own (in case of small catalogs). The matching to the reference catolog is done by LDAC itself for steps 1 and 2. To derive GAS (step 3) the matching is done by association inside the database. To perform that association the reference catalogs must be stored in the database.

In alternative to LDAC, we implemented SCAMP to derive the astrometric solution for single images (step 2) and also for Global Astrometry (step 3). Using SCAMP, the derivation of the GAS does not require step 2 to be performed. However, if necessary, the user can still derive the astrometric solution on individual CCDs. The preliminary astrometry (step 1) is still done by LDAC during ingestion of the raw images.

As an advantage, SCAMP can use many publicaly availible reference catalogs, c.f. (USNO A1/A2/B1, GSC 1.3/2.2, SDSS R3/R5, 2MASS, UCAC 1/2). All these external reference catalogs are accessible by the VO and do not need to be stored in the database. User can also supply his own catalog, either in ASCII or FITS format.

## Scripts, Classes and DB structure¶

### NB!¶

At the moment the SCAMP implementation is not in the “main” AstroWise source code branch, but in “experimental”. Moving this modification to the “main” branch requires the type evolution of python classes and corresponding database tables.

### DB tables:¶

ScampConfig is mapped into ScampConfig table. AstrometricParameter table should be expanded by adding a new column to store the link to the corresponding ScampConfig.

## Script invocation examples¶

The following two recipes are used to derive the astrometric solution with SCAMP:

1. ScampSourceListTask – preliminary step to extract source catalogs;

is needed to extract catalogs of objects from the reduced images to be used later by the ScampAstromTask. The ScampSourceListTask can be launched by DPU:

awe> dpu.run('ScampSL',i='WFI',o='M31*',d='2000-04-28',f='#842',C=1)


or

awe> dpu.run('ScampSL',i='WFI',red_filenames=['image1.fits','image2.fits'],C=1)


The ScampSourceListTask can be launched also locally as follows:

awe> task=ScampSourceListTask(red_filenames=['image1.fits','image2.fits'])


or

awe> task = ScampSourceListTask(instrument='WFI', date='2000-04-28', \
...             chip='ccd55', filter='#844', object='CDF*', commit=1)


The task will retrieve reduced images and related weight maps from the DataStorage, extract object catalogs and store them into the DataStorage with the filenames of corresponding reduced image, but with extension “cat”.

is used to compute the astrometric solution by running SCAMP on the catalogs extracted by ScampSourceListTask. The ScampAstromTask can be launched by DPU:

awe> dpu.run('ScampAstrom',i='WFI',o='M31?',d='2000-04-28',c='ccd50',f='#842',C=1)


or

awe> dpu.run('ScampAstrom',i='WFI',red_filenames=['image1.fits','image2.fits'])


The ScampAstromTask can be launched also locally as follows:

awe> task=ScampAstromTask(red_filenames=['image1.fits','image2.fits'])


or

awe> task =ScampAstromTask(instrument='WFI',date='2000-04-28',chip='ccd55',\
...                                   filter='#844',object='CDF*',commit=1)


The task will retrieve catalogs for each reduced image. If the catalog for a given image is not available in the DataStorage, the ScampSourceListTask will be automatically started to extract the catalog.

The ScampAstromTask will run SCAMP and store derived astrometric solution into the database. The plots of residuals produced by Scamp will be also stored into the DataStorage. The plots can be seen through the inspect method.

If only one reduced image is given as input, the single chip astrometric solution will be derived (equivalent of the LDAC “Astrometry” task). In case of several input images, the Global Astrometric Solution will be derived. In that case, it is not necessary to first derive the astrometry for individual chips (as required in the current LDAC implementation).

### Scamp Inspect method¶

will show to the user the plots of the residuals produced by SCAMP. The list of images is defined in ScampConfig. By default the list is:

FGROUPS
Sky charts showing, for each group, frame limits, detections and astrometric sources before astrometric calibration.
DISTORTION
Chart showing for each astrometric instrument an astrometric model of the input frame(s) after calibration. The pixel size is represented over the field of view using a colour scale ranging from blue to red.
ASTR_INTERROR1D
Scatter plot showing the (internal, 1-dimensional) pairwise differences between coordinates of overlapping detections as a function of position along each reprojected axis.
ASTR_INTERROR2D
2-dimensional scatter plot showing the (internal) pairwise differences between coordinates of overlapping detections.
ASTR_REFERROR1D
Scatter plot showing the 1-dimensional differences between detection coordinates and coordinates of the associated astrometric reference sources as a function of position along each reprojected axis.
ASTR_REFERROR2D
2-dimensional scatter plot showing the differences between detection coordinates and coordinates of the associated astrometric reference star.

## TBD¶

At the moment the relative photometry found by SCAMP is not used. Additional investigation is needed to integrate derived relative photometry into AstroWise zeropoint determination algorithm.

The statistics of the derived astrometric solution is not stored, because the statistical parameters derived by SCAMP are defined differently from thew statistical parameters derived by LDAC.

The inspect method shows images produced during SCAMP invocation. The images are not generated on the fly from the residuals catalog, because the residuals catalog is not saved by the current version of SCAMP.