File: two_d_linear_wcs.h

package info (click to toggle)
cpl-plugin-vimos 4.1.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 28,228 kB
  • sloc: ansic: 169,271; cpp: 16,177; sh: 4,344; python: 3,678; makefile: 1,138; perl: 10
file content (185 lines) | stat: -rwxr-xr-x 5,068 bytes parent folder | download | duplicates (4)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* $Id: TwoDLinearWCS.h,v 1.3 2013/03/25 11:43:04 cgarcia Exp $
 *
 * This file is part of the VIMOS Pipeline
 * Copyright (C) 2002-2012 European Southern Observatory
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/*
 * $Author: cgarcia $
 * $Date: 2013/03/25 11:43:04 $
 * $Revision: 1.3 $
 * $Name:  $
 */

#ifndef TWODLINEARWCS_H
#define TWODLINEARWCS_H

#include <string>
#include "vimoswcs.h"
#include "cpl_type.h"

/**
 * This class represents a linear astrometric solution of an image.
 * Conversion from/to image coordinates to/from world coordinates are provided.
 */
class two_d_linear_wcs
{

public:

    /**
     * Default constructor. 
     */
    two_d_linear_wcs();

    /**
     * Constructor from a simple linear solution
     * @param centralRA RA of the center of the image(degrees)
     * @param centralDEC Dec of the center of the image(degrees)
     * @param PixelSize  Pixel size in arc seconds (i.e. plate scale)
     * @param dimX     Dimension in X direction (size of image)
     * @param dimY     Dimension in Y direction (size of image)
     * @param rotAngle Rotation angle wrt the north (clockwise positive)(degrees)
     * @param flip     There is a flip in the image
     * @param epoch    Epoch of the solution
     * @param equinox  Equinox to which the coordinates are refered.
     */
    two_d_linear_wcs(const double& centralRA, const double& centralDEC, 
                  const double& plateScale, const cpl_size& dimX, 
                  const cpl_size& dimY, 
                  const double& rotAngle = 0, bool flip = false,
                  const double& epoch = 2000.,const int equinox = 2000);

    /**
     * Destructor
     */
    ~two_d_linear_wcs();

    /**
     * Converts pixel positions to astrometric coordinates.
     * @param xPixel X coordinate in the image (pixel) 
     * @param yPixel Pixel in the image (pixel) 
     * @param ra     RA of the point (hours)
     * @param dec    Declination of the point (degrees)
     */
    void to_world
    (const double& xPixel, const double& yPixel, 
     double& ra, double& dec) const;

    /**
     * Converts astrometric coordinates to pixel positions.
     * @param ra     RA of the point (hours)
     * @param dec    Declination of the point (degrees)
     * @param xPixel X coordinate in the image (pixel) 
     * @param yPixel Pixel in the image (pixel)
     * @returns true if it success 
     */
    bool to_pixel
    (const double& ra, const double& dec, 
     double& xPixel, double& yPixel) const;

    /**
     * Returns the epoch of the astrometric solution
     */
    double epoch() const;

    /**
     * Returns the equinox of the astrometric solution
     */
    double equinox() const;

    /**
     * Returns the platescale
     */
    double plate_scale() const;

    /**
     * Returns the orientation in degrees of the solution (N through E).
     */
    double orientation() const;

    /**
     * Returns the CRPIX1 keyword of WCS FITS standard: 
     * X coordinate of reference pixel.
     */
    double crpix1() const;

    /**
     * Returns the CRPIX2 keyword of WCS FITS standard: 
     * Y coordinate of reference pixel.
     */
    double crpix2() const;

    /**
     * Returns the CDELT1 keyword of WCS FITS standard: 
     * Increment of WCS coord per X unit
     */
    double cdelt1() const;

    /**
     * Returns the CDELT2 keyword of WCS FITS standard: 
     * Increment of WCS coord per Y unit
     */
    double cdelt2() const;

    /**
     * Returns the CRVAL1 keyword of WCS FITS standard:
     * Value of X WCS coordinate for reference pixel.
     */
    double crval1() const;

    /**
     * Returns the CRVAL2 keyword of WCS FITS standard:
     * Value of Y WCS coordinate for reference pixel.
     */
    double crval2() const;

    /**
     * Returns the type of first WCS coordinate 
     */
    std::string ctype1() const;

    /**
     * Returns the type of second WCS coordinate 
     */
    std::string ctype2() const;

    /**
     * Returns the units of first WCS coordinate 
     */
    std::string cunit1() const;

    /**
     * Returns the units of second WCS coordinate 
     */
    std::string cunit2() const;

    /**
     * Returns the CD?_? matrix from WCS FITS standard
     */
    double * cd_matrix() const;

private:

    /**
     * Implementation of WCS using WCSLIB
     */
    struct WorldCoor *wcs_;

};

#endif