This file is indexed.

/usr/include/astrotcl/SAOWCS.h is in skycat 3.1.2+starlink1~b-8+b2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// -*-c++-*-
#ifndef _SAOWCS_h_
#define _SAOWCS_h_
/*
 * E.S.O. - VLT project / ESO Archive
 *
 * "@(#) $Id: SAOWCS.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" 
 *
 * SAOWCS.h - declarations for class SAOWCS, an implementation class for
 *            class WCS, which is a reference counted class that manages
 *            a pointer to a class derived from WCSRep.
 *
 *            This class is based on Doug Mink's (saoimage) WCS C library.
 *            Other implementations of the WCS interface may be added by
 *            Defining new subclasses of the abstract class WCSRep.
 *
 * who             when       what
 * --------------  --------   ----------------------------------------
 * Allan Brighton  30 Sep 96  Created
 *                 17 Mar 98  Renamed from WSCRep, made WCSRep abstract,
 *                            to allow new implementations based on other
 *                            libraries.
 * pbiereic        11/10/99   Added deltset()
 */


#include "WCSRep.h"
#include "WorldCoords.h"
#include "wcs.h"

/* 
 * This class defines an interface to Doug Mink's (saoimage) WCS C library.
 * The public interface is through the WCS class. 
 *
 *    Usage: WCS wcs(new SAOWCS(fits_header));
 *
 * The memory for the new object is managed by the WCS class with reference
 * counting (as long as you use normal assignment and not pointers).
 */
class SAOWCS : public WCSRep {
protected:
    WorldCoor* wcs_;		// C object to manage World Coordinates

    // The following are needed here because they are sometimes set to 0
    // in the wcs_ object
    double equinox_;		// equinox as 2000.0, 1950.0, ...
    char equinoxStr_[32];	// equinox string: "J2000", "B1950", ...
    
    double ra_, dec_;		// coordinates of image center in deg
    double width_, height_;     // image width and height in deg
    
    double xSecPix_, ySecPix_;	// number of arcsecs per pixel
    
    void setEquinox();		// set equinox value and string

public:
     // constructor (derived classes call this)
    SAOWCS(const char* header, int headerLength);

    // destructor
    virtual ~SAOWCS();

    // return class name as a string
    virtual const char* classname() const {return "SAOWCS";}

    // Return 1 if WCS info is available, else 0 ("LINEAR" doesn't count)
    int isWcs() const {return (wcs_ && ::iswcs(wcs_) && strcmp(equinoxStr_, "LINEAR") != 0);}

    // return the world coordinates string for the given ximage coords
    char* pix2wcs(double x, double y, char* buf, int bufsz, int hms_flag = 1) const;

    // return the world coords (in degrees, as 2 doubles) for the ximage coords
    int pix2wcs(double x, double y, double& ra, double& dec) const;

    // get the image coordinates for the given world coords
    int wcs2pix(double ra, double dec, double &x, double &y) const;

    // get the image coordinates distance for the given world coords distance in deg
    int wcs2pixDist(double ra, double dec, double &x, double &y) const;

    // get the world coords distance in deg for the given image coordinates distance
    int pix2wcsDist(double x, double y, double& ra, double& dec) const;

    // set up the WCS structure from the given information about the image
    int set(double ra, double dec, 
		double secpix, 
		double xrefpix, double yrefpix,
		int nxpix, int nypix, 
		double rotate, 
		int equinox, double epoch,
		const char* proj);

    // reset the center of the WCS structure
    int shift(double ra, double dec, double equinox);

    // set rotation and scaling
    int deltset(double cdelt1, double cdelt2, double rotation);

    // Return the WCS equinox
    double equinox() const {return equinox_;}
    const char* equinoxStr() const {return equinoxStr_;}

    // return the WCS epoch
    double epoch() const {return wcs_->epoch;}
   
    // return the rotation angle in degrees
    double rotate() const {return wcs_->rot;}
  
    // return the width, height, radius of the image in arcmin
    double width() const {return width_*60.;}
    double height() const {return height_*60.;}
    double radius() const;
    
    // return the number of world coordinate arcsecs per pixel
    double secPix() const {return ySecPix_;}
    double xSecPix() const {return xSecPix_;}
    double ySecPix() const {return ySecPix_;}

    // return the world coordinates of the center of the image 
    WorldCoords center() const;
    
    // return image dimensions
    int pixWidth() const {return int(wcs_->nxpix);}
    int pixHeight() const {return int(wcs_->nypix);}

    // Return the WCS distance between the 2 given WCS points in arcsec */
    double dist(double ra0, double dec0, double ra1, double dec1) const {
	return ::wcsdist(ra0, dec0, ra1, dec1) * 60.0 * 60.0;
    }
    
    // return the x,y reference pixel values
    double xRefPix() const {return wcs_->xrefpix;}
    double yRefPix() const {return wcs_->yrefpix;}

    // return the projection type
    const char* projection() const {return wcs_->ptype;}
};



#endif /* _SAOWCS_h_ */