public software.sextractor

[/] [trunk/] [src/] [wcs/] [cel.c] - Diff between revs 235 and 284

Show entire file | Details | Blame | View Log

Rev 235 Rev 284
Line 5... Line 5...
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
*
*       This file part of:      AstrOmatic WCS library
*       This file part of:      AstrOmatic WCS library
*
*
*       Copyright:              (C) 2000-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*       Copyright:              (C) 2000-2012 Emmanuel Bertin -- IAP/CNRS/UPMC
*                               (C) 1995-1999 Mark Calabretta (original version)
*                               (C) 1995-1999 Mark Calabretta (original version)
*
*
*       Licenses:               GNU General Public License
*       Licenses:               GNU General Public License
*
*
*       AstrOmatic software is free software: you can redistribute it and/or
*       AstrOmatic software is free software: you can redistribute it and/or
Line 22... Line 22...
*       GNU General Public License for more details.
*       GNU General Public License for more details.
*       You should have received a copy of the GNU General Public License
*       You should have received a copy of the GNU General Public License
*       along with AstrOmatic software.
*       along with AstrOmatic software.
*       If not, see <http://www.gnu.org/licenses/>.
*       If not, see <http://www.gnu.org/licenses/>.
*
*
*       Last modified:          10/10/2010
*       Last modified:          18/04/2012
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
/*=============================================================================
*
*
*   WCSLIB - an implementation of the FITS WCS proposal.
*   WCSLIB - an implementation of the FITS WCS proposal.
Line 228... Line 228...
*      ARC: zenithal/azimuthal equidistant
*      ARC: zenithal/azimuthal equidistant
*      ZPN: zenithal/azimuthal polynomial
*      ZPN: zenithal/azimuthal polynomial
*      ZEA: zenithal/azimuthal equal area
*      ZEA: zenithal/azimuthal equal area
*      AIR: Airy
*      AIR: Airy
*      TNX: IRAF's polynomial correction to TAN
*      TNX: IRAF's polynomial correction to TAN
 
*      TPV: AstrOmatic's polynomial correction to TAN
*
*
*   Cylindricals:
*   Cylindricals:
*      CYP: cylindrical perspective
*      CYP: cylindrical perspective
*      CAR: Cartesian
*      CAR: Cartesian
*      MER: Mercator
*      MER: Mercator
Line 260... Line 261...
*      QSC: quadrilateralized spherical cube
*      QSC: quadrilateralized spherical cube
*      TSC: tangential spherical cube
*      TSC: tangential spherical cube
*
*
*   Author: Mark Calabretta, Australia Telescope National Facility
*   Author: Mark Calabretta, Australia Telescope National Facility
*   IRAF's TNX added by E.Bertin 2000/03/28
*   IRAF's TNX added by E.Bertin 2000/03/28
 
*   TPV added by E.Bertin 2012/04/11
*   Filtering of abs(phi)>180 and abs(theta)>90 added by E.Bertin 2000/11/11
*   Filtering of abs(phi)>180 and abs(theta)>90 added by E.Bertin 2000/11/11
*   $Id: cel.c,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*   $Id: cel.c,v 1.1.1.1 2012/04/18 16:33:26 bertin Exp $
*===========================================================================*/
*===========================================================================*/
 
 
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include        "config.h"
#include        "config.h"
#endif
#endif
Line 279... Line 281...
#include "wcstrig.h"
#include "wcstrig.h"
#include "cel.h"
#include "cel.h"
#include "sph.h"
#include "sph.h"
#include "tnx.h"
#include "tnx.h"
 
 
int  npcode = 26;
int  npcode = 27;
char pcodes[26][4] =
char pcodes[27][4] =
      {"AZP", "TAN", "SIN", "STG", "ARC", "ZPN", "ZEA", "AIR", "CYP", "CAR",
      {"AZP", "TAN", "SIN", "STG", "ARC", "ZPN", "ZEA", "AIR", "CYP", "CAR",
       "MER", "CEA", "COP", "COD", "COE", "COO", "BON", "PCO", "GLS", "PAR",
       "MER", "CEA", "COP", "COD", "COE", "COO", "BON", "PCO", "GLS", "PAR",
       "AIT", "MOL", "CSC", "QSC", "TSC", "TNX"};
       "AIT", "MOL", "CSC", "QSC", "TSC", "TNX", "TPV"};
 
 
/* Map error number to error message for each function. */
/* Map error number to error message for each function. */
const char *celset_errmsg[] = {
const char *celset_errmsg[] = {
   0,
   0,
   "Invalid coordinate transformation parameters",
   "Invalid coordinate transformation parameters",
Line 318... Line 320...
   double clat0, cphip, cthe0, theta0, slat0, sphip, sthe0;
   double clat0, cphip, cthe0, theta0, slat0, sphip, sthe0;
   double latp, latp1, latp2;
   double latp, latp1, latp2;
   double u, v, x, y, z;
   double u, v, x, y, z;
 
 
   /* Set pointers to the forward and reverse projection routines. */
   /* Set pointers to the forward and reverse projection routines. */
   if (strcmp(pcode, "AZP") == 0) {
   if (strcmp(pcode, "TAN") == 0) {
      cel->prjfwd = azpfwd;
      cel->prjfwd = tanfwd;
      cel->prjrev = azprev;
      cel->prjrev = tanrev;
      theta0 = 90.0;
      theta0 = 90.0;
   } else if (strcmp(pcode, "TAN") == 0) {
   } else if (strcmp(pcode, "TPV") == 0) {
      cel->prjfwd = tanfwd;
      cel->prjfwd = tanfwd;
      cel->prjrev = tanrev;
      cel->prjrev = tanrev;
      theta0 = 90.0;
      theta0 = 90.0;
 
   } else if (strcmp(pcode, "AZP") == 0) {
 
      cel->prjfwd = azpfwd;
 
      cel->prjrev = azprev;
 
      theta0 = 90.0;
   } else if (strcmp(pcode, "SIN") == 0) {
   } else if (strcmp(pcode, "SIN") == 0) {
      cel->prjfwd = sinfwd;
      cel->prjfwd = sinfwd;
      cel->prjrev = sinrev;
      cel->prjrev = sinrev;
      theta0 = 90.0;
      theta0 = 90.0;
   } else if (strcmp(pcode, "STG") == 0) {
   } else if (strcmp(pcode, "STG") == 0) {