source: trunk/external/atnf/pks/pks_maths.h@ 1460

Last change on this file since 1460 was 1427, checked in by Malte Marquarding, 16 years ago

sync with livedata/implement/atnf

File size: 3.2 KB
Line 
1//----------------------------------------------------------------------------
2//# pks_maths.h: Mathematical functions for Parkes single dish data reduction
3//----------------------------------------------------------------------------
4//# Copyright (C) 1994-2006
5//# Associated Universities, Inc. Washington DC, USA.
6//#
7//# This library is free software; you can redistribute it and/or modify it
8//# under the terms of the GNU Library General Public License as published by
9//# the Free Software Foundation; either version 2 of the License, or (at your
10//# option) any later version.
11//#
12//# This library is distributed in the hope that it will be useful, but WITHOUT
13//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15//# License for more details.
16//#
17//# You should have received a copy of the GNU Library General Public License
18//# along with this library; if not, write to the Free Software Foundation,
19//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
20//#
21//# Correspondence concerning AIPS++ should be addressed as follows:
22//# Internet email: aips2-request@nrao.edu.
23//# Postal address: AIPS++ Project Office
24//# National Radio Astronomy Observatory
25//# 520 Edgemont Road
26//# Charlottesville, VA 22903-2475 USA
27//#
28//# Original: Mark Calabretta
29//# $Id: pks_maths.h,v 1.6 2006-05-19 00:12:06 mcalabre Exp $
30//----------------------------------------------------------------------------
31#ifndef ATNF_PKS_MATHS_H
32#define ATNF_PKS_MATHS_H
33
34// AIPS++ includes.
35#include <casa/aips.h>
36#include <casa/Arrays/Vector.h>
37
38
39#include <casa/namespace.h>
40
41// Global mathematical functions for single-dish data reduction.
42
43// Nearest integral value.
44Int nint(Double v);
45Double anint(Double v);
46
47// Round value v to the nearest integral multiple of precision p.
48Double round(Double v, Double p);
49
50// Compute the weighted median value of an array.
51Float median(const Vector<Float> &v, const Vector<Float> &wgt);
52
53// Angular distance between two directions (angles in radian).
54Double angularDist(Double lng1, Double lat1, Double lng2, Double lat2);
55
56// Generalized position angle of the field point (lng,lat) from reference
57// point (lng0,lat0) and the angular distance between them (angles in radian).
58void distPA(Double lng0, Double lat0, Double lng, Double lat, Double &dist,
59 Double &pa);
60
61// Euler angle based transformation of spherical coordinates (radian).
62void eulerx(Double lng0, Double lat0, Double phi0, Double theta, Double phi,
63 Double &lng1, Double &lat1);
64
65// Low precision coordinates of the sun.
66void sol(Double mjd, Double &elng, Double &ra, Double &dec);
67
68// Low precision Greenwich mean and apparent sidereal time (radian); UT1 is
69// given in MJD form.
70void gst(Double ut1, Double &gmst, Double &gast);
71
72// Convert (ra,dec) to (az,el). Position as a Cartesian triplet (m), UT1 in
73// MJD form, and all angles in radian.
74void azel(const Vector<Double> position, Double ut1, Double ra, Double dec,
75 Double &az, Double &el);
76
77// Compute the Solar elevation (radian) using the above functions.
78Double solel(const Vector<Double> position, Double ut1);
79
80#endif
Note: See TracBrowser for help on using the repository browser.