/* FILE: phot_init.c * PURPOSE: Initialize the calculations for Quick&Dirty photometry. * AUTHOR: Kenneth J. Mighell (mighell@noao.edu) * LANGUAGE: ANSI C * DATE: 2001JUL03 * COPYRIGHT: (C) 2001 Assoc. of Universities for Research in Astronomy Inc. */ #include "mx.h" #include "qdphot.h" int qdphot5_PhotS_CalcInit_f5 ( qdphot5_ImageS *Image, qdphot5_PhotS *Phot, double x1cood_p, double y1cood_p, int id_p ){ char mxfunc[] = "qdphot5_PhotS_CalcInit_f5"; int status = -1; double xd; double yd; double x1ind; double y1ind; double x1cood; double y1cood; int x0ini; int y0ini; x1cood = x1cood_p; y1cood = y1cood_p; Phot->x1cood = x1cood; Phot->y1cood = y1cood; x1ind = x1cood + Image->dxd; y1ind = y1cood + Image->dyd; Phot->x1ind = x1ind; Phot->y1ind = y1ind; x0ini = ((Phot->x1ind)-1) - (Image->llx0i) + 0.5; y0ini = ((Phot->y1ind)-1) - (Image->lly0i) + 0.5; Phot->x0ini = x0ini; Phot->y0ini = y0ini; xd = x1ind; yd = y1ind; Phot->xd = xd; Phot->yd = yd; Phot->id = id_p; Phot->fltrnm = Image->index; Phot->idint = Image->idint; Phot->rejects = Image->rejects; Phot->moving = MX_FALSE; /* * Make sure that the pixel (x0ini,y0ini) is at least 5 pixels * from the edges of the array */ if (x0ini < 5) goto bye; if (x0ini > ((Image->nxi)-6) ) goto bye; if (y0ini < 5) goto bye; if (y0ini > ((Image->nyi)-6) ) goto bye; status = 0; bye: return( status ); } /* end-of-file */